From b78697656564c03f43c8d980b9cf875caaadfc6e Mon Sep 17 00:00:00 2001 From: evenegas Date: Tue, 20 May 2025 15:53:57 -0600 Subject: [PATCH] se hizo el service cuestionario-alumno --- .gitignore | 2 + docker-compose.yml | 14 + package-lock.json | 1196 ++++++++++++++--- package.json | 17 +- src/app.module.ts | 56 +- src/auth/auth.module.ts | 15 + src/auth/auth.service.ts | 31 + src/carrera/carrera.controller.ts | 34 + src/carrera/carrera.module.ts | 9 + src/carrera/carrera.service.ts | 26 + src/carrera/dto/create-carrera.dto.ts | 1 + src/carrera/dto/update-carrera.dto.ts | 4 + src/carrera/entities/carrera.entity.ts | 19 + src/caso-especial/caso-especial.controller.ts | 34 + src/caso-especial/caso-especial.module.ts | 9 + src/caso-especial/caso-especial.service.ts | 26 + .../dto/create-caso-especial.dto.ts | 1 + .../dto/update-caso-especial.dto.ts | 4 + .../entities/caso-especial.entity.ts | 57 + .../cuestionario-alumno.controller.ts | 34 + .../cuestionario-alumno.module.ts | 9 + .../cuestionario-alumno.service.ts | 26 + .../dto/create-cuestionario-alumno.dto.ts | 3 + .../dto/update-cuestionario-alumno.dto.ts | 4 + .../entities/cuestionario-alumno.entity.ts | 111 ++ .../cuestionario-alumno2.controller.ts | 34 + .../cuestionario-alumno2.module.ts | 9 + .../cuestionario-alumno2.service.ts | 119 ++ .../dto/create-cuestionario-alumno2.dto.ts | 188 +++ .../dto/update-cuestionario-alumno2.dto.ts | 4 + .../entities/cuestionario-alumno2.entity.ts | 145 ++ .../cuestionario-programa.controller.ts | 34 + .../cuestionario-programa.module.ts | 9 + .../cuestionario-programa.service.ts | 26 + .../dto/create-cuestionario-programa.dto.ts | 1 + .../dto/update-cuestionario-programa.dto.ts | 4 + .../entities/cuestionario-programa.entity.ts | 35 + .../cuestionario-programa2.controller.ts | 34 + .../cuestionario-programa2.module.ts | 9 + .../cuestionario-programa2.service.ts | 26 + .../dto/create-cuestionario-programa2.dto.ts | 1 + .../dto/update-cuestionario-programa2.dto.ts | 4 + .../entities/cuestionario-programa2.entity.ts | 90 ++ src/drive/drive.module.ts | 9 + src/drive/drive.service.ts | 172 +++ src/helpers/archivo.service.ts | 41 + src/main.ts | 4 + src/messageByStatus.ts | 11 + src/programa/dto/create-programa.dto.ts | 1 + src/programa/dto/update-programa.dto.ts | 4 + src/programa/entities/programa.entity.ts | 33 + src/programa/programa.controller.ts | 34 + src/programa/programa.module.ts | 9 + src/programa/programa.service.ts | 26 + src/servicio/dto/create-servicio.dto.ts | 1 + src/servicio/dto/update-servicio.dto.ts | 4 + src/servicio/entities/servicio.entity.ts | 88 ++ src/servicio/servicio.controller.ts | 34 + src/servicio/servicio.module.ts | 9 + src/servicio/servicio.service.ts | 26 + src/status/dto/create-status.dto.ts | 1 + src/status/dto/update-status.dto.ts | 4 + src/status/entities/status.entity.ts | 19 + src/status/status.controller.ts | 34 + src/status/status.module.ts | 9 + src/status/status.service.ts | 26 + .../dto/create-tipo-usuario.dto.ts | 1 + .../dto/update-tipo-usuario.dto.ts | 4 + .../entities/tipo-usuario.entity.ts | 16 + src/tipo-usuario/tipo-usuario.controller.ts | 34 + src/tipo-usuario/tipo-usuario.module.ts | 9 + src/tipo-usuario/tipo-usuario.service.ts | 26 + src/usuario/dto/create-usuario.dto.ts | 1 + src/usuario/dto/update-usuario.dto.ts | 4 + src/usuario/entities/usuario.entity.ts | 38 + src/usuario/usuario.controller.ts | 34 + src/usuario/usuario.module.ts | 9 + src/usuario/usuario.service.ts | 26 + src/validaciones/validacion.service.ts | 172 +++ 79 files changed, 3318 insertions(+), 169 deletions(-) create mode 100644 docker-compose.yml create mode 100644 src/auth/auth.module.ts create mode 100644 src/auth/auth.service.ts create mode 100644 src/carrera/carrera.controller.ts create mode 100644 src/carrera/carrera.module.ts create mode 100644 src/carrera/carrera.service.ts create mode 100644 src/carrera/dto/create-carrera.dto.ts create mode 100644 src/carrera/dto/update-carrera.dto.ts create mode 100644 src/carrera/entities/carrera.entity.ts create mode 100644 src/caso-especial/caso-especial.controller.ts create mode 100644 src/caso-especial/caso-especial.module.ts create mode 100644 src/caso-especial/caso-especial.service.ts create mode 100644 src/caso-especial/dto/create-caso-especial.dto.ts create mode 100644 src/caso-especial/dto/update-caso-especial.dto.ts create mode 100644 src/caso-especial/entities/caso-especial.entity.ts create mode 100644 src/cuestionario-alumno/cuestionario-alumno.controller.ts create mode 100644 src/cuestionario-alumno/cuestionario-alumno.module.ts create mode 100644 src/cuestionario-alumno/cuestionario-alumno.service.ts create mode 100644 src/cuestionario-alumno/dto/create-cuestionario-alumno.dto.ts create mode 100644 src/cuestionario-alumno/dto/update-cuestionario-alumno.dto.ts create mode 100644 src/cuestionario-alumno/entities/cuestionario-alumno.entity.ts create mode 100644 src/cuestionario-alumno2/cuestionario-alumno2.controller.ts create mode 100644 src/cuestionario-alumno2/cuestionario-alumno2.module.ts create mode 100644 src/cuestionario-alumno2/cuestionario-alumno2.service.ts create mode 100644 src/cuestionario-alumno2/dto/create-cuestionario-alumno2.dto.ts create mode 100644 src/cuestionario-alumno2/dto/update-cuestionario-alumno2.dto.ts create mode 100644 src/cuestionario-alumno2/entities/cuestionario-alumno2.entity.ts create mode 100644 src/cuestionario-programa/cuestionario-programa.controller.ts create mode 100644 src/cuestionario-programa/cuestionario-programa.module.ts create mode 100644 src/cuestionario-programa/cuestionario-programa.service.ts create mode 100644 src/cuestionario-programa/dto/create-cuestionario-programa.dto.ts create mode 100644 src/cuestionario-programa/dto/update-cuestionario-programa.dto.ts create mode 100644 src/cuestionario-programa/entities/cuestionario-programa.entity.ts create mode 100644 src/cuestionario-programa2/cuestionario-programa2.controller.ts create mode 100644 src/cuestionario-programa2/cuestionario-programa2.module.ts create mode 100644 src/cuestionario-programa2/cuestionario-programa2.service.ts create mode 100644 src/cuestionario-programa2/dto/create-cuestionario-programa2.dto.ts create mode 100644 src/cuestionario-programa2/dto/update-cuestionario-programa2.dto.ts create mode 100644 src/cuestionario-programa2/entities/cuestionario-programa2.entity.ts create mode 100644 src/drive/drive.module.ts create mode 100644 src/drive/drive.service.ts create mode 100644 src/helpers/archivo.service.ts create mode 100644 src/messageByStatus.ts create mode 100644 src/programa/dto/create-programa.dto.ts create mode 100644 src/programa/dto/update-programa.dto.ts create mode 100644 src/programa/entities/programa.entity.ts create mode 100644 src/programa/programa.controller.ts create mode 100644 src/programa/programa.module.ts create mode 100644 src/programa/programa.service.ts create mode 100644 src/servicio/dto/create-servicio.dto.ts create mode 100644 src/servicio/dto/update-servicio.dto.ts create mode 100644 src/servicio/entities/servicio.entity.ts create mode 100644 src/servicio/servicio.controller.ts create mode 100644 src/servicio/servicio.module.ts create mode 100644 src/servicio/servicio.service.ts create mode 100644 src/status/dto/create-status.dto.ts create mode 100644 src/status/dto/update-status.dto.ts create mode 100644 src/status/entities/status.entity.ts create mode 100644 src/status/status.controller.ts create mode 100644 src/status/status.module.ts create mode 100644 src/status/status.service.ts create mode 100644 src/tipo-usuario/dto/create-tipo-usuario.dto.ts create mode 100644 src/tipo-usuario/dto/update-tipo-usuario.dto.ts create mode 100644 src/tipo-usuario/entities/tipo-usuario.entity.ts create mode 100644 src/tipo-usuario/tipo-usuario.controller.ts create mode 100644 src/tipo-usuario/tipo-usuario.module.ts create mode 100644 src/tipo-usuario/tipo-usuario.service.ts create mode 100644 src/usuario/dto/create-usuario.dto.ts create mode 100644 src/usuario/dto/update-usuario.dto.ts create mode 100644 src/usuario/entities/usuario.entity.ts create mode 100644 src/usuario/usuario.controller.ts create mode 100644 src/usuario/usuario.module.ts create mode 100644 src/usuario/usuario.service.ts create mode 100644 src/validaciones/validacion.service.ts diff --git a/.gitignore b/.gitignore index 4b56acf..1c1827d 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,5 @@ pids # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +#Base de datos +mysql \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..391588e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +services: + mysql: + image: mariadb:latest + container_name: Iris_back + restart: always + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: Iris + MYSQL_USER: user_crud + MYSQL_PASSWORD: root + volumes: + - ./mysql:/var/lib/mysql + ports: + - "3307:3306" diff --git a/package-lock.json b/package-lock.json index 3865607..581bbb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,23 @@ "license": "UNLICENSED", "dependencies": { "@nestjs/common": "^11.0.1", - "@nestjs/core": "^11.0.1", + "@nestjs/config": "^4.0.2", + "@nestjs/core": "^11.1.1", + "@nestjs/jwt": "^11.0.0", + "@nestjs/mapped-types": "*", + "@nestjs/passport": "^11.0.5", "@nestjs/platform-express": "^11.0.1", + "@nestjs/typeorm": "^11.0.0", + "class-validator": "^0.14.2", + "convert-array-to-csv": "^2.0.0", + "googleapis": "^148.0.0", + "moment": "^2.30.1", + "mysql": "^2.18.1", + "passport": "^0.7.0", + "passport-jwt": "^4.0.1", "reflect-metadata": "^0.2.2", - "rxjs": "^7.8.1" + "rxjs": "^7.8.1", + "typeorm": "^0.3.23" }, "devDependencies": { "@eslint/eslintrc": "^3.2.0", @@ -732,7 +745,7 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "0.3.9" @@ -745,7 +758,7 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", @@ -1291,7 +1304,6 @@ "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, "license": "ISC", "dependencies": { "string-width": "^5.1.2", @@ -1309,7 +1321,6 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -1322,14 +1333,12 @@ "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, "license": "MIT" }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", @@ -1347,7 +1356,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", @@ -1857,7 +1865,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -1888,7 +1896,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { @@ -2454,12 +2462,12 @@ } }, "node_modules/@nestjs/common": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.0.tgz", - "integrity": "sha512-8MrajltjtIN6eW9cTpv+1IZogqz2Zsrc8YDt0LwQPUq8cSq0j50DETdQpPsNMeib+p9avkV41+NrzGk1z2o5Wg==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.1.tgz", + "integrity": "sha512-crzp+1qeZ5EGL0nFTPy9NrVMAaUWewV5AwtQyv6SQ9yQPXwRl9W9hm1pt0nAtUu5QbYMbSuo7lYcF81EjM+nCA==", "license": "MIT", "dependencies": { - "file-type": "20.4.1", + "file-type": "20.5.0", "iterare": "1.2.1", "load-esm": "1.0.2", "tslib": "2.8.1", @@ -2470,8 +2478,8 @@ "url": "https://opencollective.com/nest" }, "peerDependencies": { - "class-transformer": "*", - "class-validator": "*", + "class-transformer": ">=0.4.1", + "class-validator": ">=0.13.2", "reflect-metadata": "^0.1.12 || ^0.2.0", "rxjs": "^7.1.0" }, @@ -2484,10 +2492,25 @@ } } }, + "node_modules/@nestjs/config": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@nestjs/config/-/config-4.0.2.tgz", + "integrity": "sha512-McMW6EXtpc8+CwTUwFdg6h7dYcBUpH5iUILCclAsa+MbCEvC9ZKu4dCHRlJqALuhjLw97pbQu62l4+wRwGeZqA==", + "license": "MIT", + "dependencies": { + "dotenv": "16.4.7", + "dotenv-expand": "12.0.1", + "lodash": "4.17.21" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0 || ^11.0.0", + "rxjs": "^7.1.0" + } + }, "node_modules/@nestjs/core": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.0.tgz", - "integrity": "sha512-IeXbTRPrr6xAVbETlDE+miSkNmYf/cPhCa9GU9gFtPO6pVNuAeG/dNrjLVc23mJtUlT/ibdsoW35TlSyHLkzEA==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.1.tgz", + "integrity": "sha512-UFoUAgLKFT+RwHTANJdr0dF7p0qS9QjkaUPjg8aafnjM/qxxxrUVDB49nVvyMlk+Hr1+vvcNaOHbWWQBxoZcHA==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -2525,10 +2548,53 @@ } } }, + "node_modules/@nestjs/jwt": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@nestjs/jwt/-/jwt-11.0.0.tgz", + "integrity": "sha512-v7YRsW3Xi8HNTsO+jeHSEEqelX37TVWgwt+BcxtkG/OfXJEOs6GZdbdza200d6KqId1pJQZ6UPj1F0M6E+mxaA==", + "license": "MIT", + "dependencies": { + "@types/jsonwebtoken": "9.0.7", + "jsonwebtoken": "9.0.2" + }, + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0" + } + }, + "node_modules/@nestjs/mapped-types": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.1.0.tgz", + "integrity": "sha512-W+n+rM69XsFdwORF11UqJahn4J3xi4g/ZEOlJNL6KoW5ygWSmBB2p0S2BZ4FQeS/NDH72e6xIcu35SfJnE8bXw==", + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^10.0.0 || ^11.0.0", + "class-transformer": "^0.4.0 || ^0.5.0", + "class-validator": "^0.13.0 || ^0.14.0", + "reflect-metadata": "^0.1.12 || ^0.2.0" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/passport": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/@nestjs/passport/-/passport-11.0.5.tgz", + "integrity": "sha512-ulQX6mbjlws92PIM15Naes4F4p2JoxGnIJuUsdXQPT+Oo2sqQmENEZXM7eYuimocfHnKlcfZOuyzbA33LwUlOQ==", + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^10.0.0 || ^11.0.0", + "passport": "^0.5.0 || ^0.6.0 || ^0.7.0" + } + }, "node_modules/@nestjs/platform-express": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-11.1.0.tgz", - "integrity": "sha512-lxv73GT9VdQaxndciqKcyzLsT2j3gMRX+tO6J06oa7RIfp4Dp4oMTIu57lM1gkIJ+gLGq29bob+mfPv/K8RIuw==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-11.1.1.tgz", + "integrity": "sha512-IUxk380qnUtz0PCRQ5i+o9UHlGMrFzGPIJxDwyt3JZZwx2AngOlcEcm5e+7YeJQEr2QYX2QyC4tUQg0zde+D7A==", "license": "MIT", "dependencies": { "cors": "2.8.5", @@ -2645,9 +2711,9 @@ } }, "node_modules/@nestjs/testing": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-11.1.0.tgz", - "integrity": "sha512-gQ+NGshkHbNrDNXMVaPiwduqZ8YHpXrnsQqhSsnyNYOcDNPdBbB+0FDq7XiiklluXqjdLAN8i+bS7MbGlZIhKw==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-11.1.1.tgz", + "integrity": "sha512-stzm8YrLDGAijHYQw+8Z9dD6lGdvahL0hIjGVZ/0KBxLZht0/rvRjgV31UK+DUqXaF7yhJTw9ryrPaITxI1J6A==", "dev": true, "license": "MIT", "dependencies": { @@ -2672,6 +2738,19 @@ } } }, + "node_modules/@nestjs/typeorm": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@nestjs/typeorm/-/typeorm-11.0.0.tgz", + "integrity": "sha512-SOeUQl70Lb2OfhGkvnh4KXWlsd+zA08RuuQgT7kKbzivngxzSo1Oc7Usu5VxCxACQC9wc2l9esOHILSJeK7rJA==", + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^10.0.0 || ^11.0.0", + "@nestjs/core": "^10.0.0 || ^11.0.0", + "reflect-metadata": "^0.1.13 || ^0.2.0", + "rxjs": "^7.2.0", + "typeorm": "^0.3.0" + } + }, "node_modules/@noble/hashes": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", @@ -2749,6 +2828,16 @@ "@noble/hashes": "^1.1.5" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@pkgr/core": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.4.tgz", @@ -2809,6 +2898,12 @@ "@sinonjs/commons": "^3.0.0" } }, + "node_modules/@sqltools/formatter": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", + "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==", + "license": "MIT" + }, "node_modules/@swc/cli": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@swc/cli/-/cli-0.6.0.tgz", @@ -3147,28 +3242,28 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@types/babel__core": { @@ -3367,6 +3462,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.7.tgz", + "integrity": "sha512-ugo316mmTYBl2g81zDFnZ7cfxlut3o+/EQdaP7J8QN2kY6lJ22hmQYCK5EHcJHbrW+dkCGSCPgbG8JtYj6qSrg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/methods": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/@types/methods/-/methods-1.1.4.tgz", @@ -3382,10 +3486,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.15.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.17.tgz", - "integrity": "sha512-wIX2aSZL5FE+MR0JlvF87BNVrtFWf6AE6rxSE9X7OwnVvoyCQjpzSRJ+M87se/4QCkCiebQAqrJ0y6fwIyi7nw==", - "dev": true, + "version": "22.15.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.18.tgz", + "integrity": "sha512-v1DKRfUdyW+jJhZNEI1PYy29S2YRxMV5AOO/x/SjKmW0acCIOqmbj6Haf9eHAhsPmrhlHSxEhv/1WszcLWV4cg==", "license": "MIT", "dependencies": { "undici-types": "~6.21.0" @@ -3459,6 +3562,12 @@ "@types/superagent": "^8.1.0" } }, + "node_modules/@types/validator": { + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.0.tgz", + "integrity": "sha512-nh7nrWhLr6CBq9ldtw0wx+z9wKnnv/uTVLA9g/3/TcOYxbpOSZE+MhKPmWqU+K0NvThjhv12uD8MuqijB0WzEA==", + "license": "MIT" + }, "node_modules/@types/yargs": { "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", @@ -3477,19 +3586,19 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.32.0.tgz", - "integrity": "sha512-/jU9ettcntkBFmWUzzGgsClEi2ZFiikMX5eEQsmxIAWMOn4H3D4rvHssstmAHGVvrYnaMqdWWWg0b5M6IN/MTQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.32.1.tgz", + "integrity": "sha512-6u6Plg9nP/J1GRpe/vcjjabo6Uc5YQPAMxsgQyGC/I0RuukiG1wIe3+Vtg3IrSCVJDmqK3j8adrtzXSENRtFgg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.32.0", - "@typescript-eslint/type-utils": "8.32.0", - "@typescript-eslint/utils": "8.32.0", - "@typescript-eslint/visitor-keys": "8.32.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/type-utils": "8.32.1", + "@typescript-eslint/utils": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "graphemer": "^1.4.0", - "ignore": "^5.3.1", + "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" }, @@ -3506,17 +3615,27 @@ "typescript": ">=4.8.4 <5.9.0" } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.4.tgz", + "integrity": "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/@typescript-eslint/parser": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.0.tgz", - "integrity": "sha512-B2MdzyWxCE2+SqiZHAjPphft+/2x2FlO9YBx7eKE1BCb+rqBlQdhtAEhzIEdozHd55DXPmxBdpMygFJjfjjA9A==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.1.tgz", + "integrity": "sha512-LKMrmwCPoLhM45Z00O1ulb6jwyVr2kr3XJp+G+tSEZcbauNnScewcQwtJqXDhXeYPDEjZ8C1SjXm015CirEmGg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.32.0", - "@typescript-eslint/types": "8.32.0", - "@typescript-eslint/typescript-estree": "8.32.0", - "@typescript-eslint/visitor-keys": "8.32.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4" }, "engines": { @@ -3532,14 +3651,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.32.0.tgz", - "integrity": "sha512-jc/4IxGNedXkmG4mx4nJTILb6TMjL66D41vyeaPWvDUmeYQzF3lKtN15WsAeTr65ce4mPxwopPSo1yUUAWw0hQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.32.1.tgz", + "integrity": "sha512-7IsIaIDeZn7kffk7qXC3o6Z4UblZJKV3UBpkvRNpr5NSyLji7tvTcvmnMNYuYLyh26mN8W723xpo3i4MlD33vA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.32.0", - "@typescript-eslint/visitor-keys": "8.32.0" + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3550,14 +3669,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.32.0.tgz", - "integrity": "sha512-t2vouuYQKEKSLtJaa5bB4jHeha2HJczQ6E5IXPDPgIty9EqcJxpr1QHQ86YyIPwDwxvUmLfP2YADQ5ZY4qddZg==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.32.1.tgz", + "integrity": "sha512-mv9YpQGA8iIsl5KyUPi+FGLm7+bA4fgXaeRcFKRDRwDMu4iwrSHeDPipwueNXhdIIZltwCJv+NkxftECbIZWfA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.32.0", - "@typescript-eslint/utils": "8.32.0", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/utils": "8.32.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -3574,9 +3693,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.32.0.tgz", - "integrity": "sha512-O5Id6tGadAZEMThM6L9HmVf5hQUXNSxLVKeGJYWNhhVseps/0LddMkp7//VDkzwJ69lPL0UmZdcZwggj9akJaA==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.32.1.tgz", + "integrity": "sha512-YmybwXUJcgGqgAp6bEsgpPXEg6dcCyPyCSr0CAAueacR/CCBi25G3V8gGQ2kRzQRBNol7VQknxMs9HvVa9Rvfg==", "dev": true, "license": "MIT", "engines": { @@ -3588,14 +3707,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.32.0.tgz", - "integrity": "sha512-pU9VD7anSCOIoBFnhTGfOzlVFQIA1XXiQpH/CezqOBaDppRwTglJzCC6fUQGpfwey4T183NKhF1/mfatYmjRqQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.32.1.tgz", + "integrity": "sha512-Y3AP9EIfYwBb4kWGb+simvPaqQoT5oJuzzj9m0i6FCY6SPvlomY2Ei4UEMm7+FXtlNJbor80ximyslzaQF6xhg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.32.0", - "@typescript-eslint/visitor-keys": "8.32.0", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -3641,16 +3760,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.32.0.tgz", - "integrity": "sha512-8S9hXau6nQ/sYVtC3D6ISIDoJzS1NsCK+gluVhLN2YkBPX+/1wkwyUiDKnxRh15579WoOIyVWnoyIf3yGI9REw==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.32.1.tgz", + "integrity": "sha512-DsSFNIgLSrc89gpq1LJB7Hm1YpuhK086DRDJSNrewcGvYloWW1vZLHBTIvarKZDcAORIy/uWNx8Gad+4oMpkSA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.32.0", - "@typescript-eslint/types": "8.32.0", - "@typescript-eslint/typescript-estree": "8.32.0" + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3665,13 +3784,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.32.0.tgz", - "integrity": "sha512-1rYQTCLFFzOI5Nl0c8LUpJT8HxpwVRn9E4CkMsYfuN6ctmQqExjSTzzSk0Tz2apmXy7WU6/6fyaZVVA/thPN+w==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.32.1.tgz", + "integrity": "sha512-ar0tjQfObzhSaW3C3QNmTc5ofj0hDoNQ5XWrCy6zDyabdr0TWhCkClp+rywGNj/odAFBVzzJrK4tEq5M4Hmu4w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.32.0", + "@typescript-eslint/types": "8.32.1", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -4518,7 +4637,7 @@ "version": "8.14.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", - "dev": true, + "devOptional": true, "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -4541,7 +4660,7 @@ "version": "8.3.4", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "acorn": "^8.11.0" @@ -4550,6 +4669,15 @@ "node": ">=0.4.0" } }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -4649,7 +4777,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -4662,7 +4789,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -4678,7 +4804,6 @@ "version": "3.17.0", "resolved": "https://registry.npmjs.org/ansis/-/ansis-3.17.0.tgz", "integrity": "sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==", - "dev": true, "license": "ISC", "engines": { "node": ">=14" @@ -4711,6 +4836,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/app-root-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/append-field": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", @@ -4742,7 +4876,7 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/argparse": { @@ -4917,7 +5051,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, "license": "MIT" }, "node_modules/bare-events": { @@ -4932,7 +5065,6 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, "funding": [ { "type": "github", @@ -4949,6 +5081,15 @@ ], "license": "MIT" }, + "node_modules/bignumber.js": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", + "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/bin-version": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/bin-version/-/bin-version-6.0.0.tgz", @@ -5146,6 +5287,12 @@ "node": "*" } }, + "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/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -5251,9 +5398,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001717", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001717.tgz", - "integrity": "sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==", + "version": "1.0.30001718", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz", + "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==", "dev": true, "funding": [ { @@ -5354,6 +5501,17 @@ "dev": true, "license": "MIT" }, + "node_modules/class-validator": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.2.tgz", + "integrity": "sha512-3kMVRF2io8N8pY1IFIXlho9r8IPUUIfHe2hYVtiebvAzU2XeQFXTv+XI4WX+TnXmtwXMDcjngcpkiPM0O9PvLw==", + "license": "MIT", + "dependencies": { + "@types/validator": "^13.11.8", + "libphonenumber-js": "^1.11.1", + "validator": "^13.9.0" + } + }, "node_modules/cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -5410,7 +5568,6 @@ "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==", - "dev": true, "license": "ISC", "dependencies": { "string-width": "^4.2.0", @@ -5425,7 +5582,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -5435,7 +5591,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -5448,7 +5603,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -5494,7 +5648,6 @@ "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, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -5507,7 +5660,6 @@ "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, "license": "MIT" }, "node_modules/combined-stream": { @@ -5613,6 +5765,12 @@ "node": ">= 0.6" } }, + "node_modules/convert-array-to-csv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-array-to-csv/-/convert-array-to-csv-2.0.0.tgz", + "integrity": "sha512-dxUINCt28k6WbXGMoB+AaKjGY0Y6GkKwZmT+kvD4nJgVCOKsnIQ3G6n0v2II1lG4NwXQk6EWZ+pPDub9wcqqMg==", + "license": "MIT" + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -5717,14 +5875,13 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -5735,10 +5892,16 @@ "node": ">= 8" } }, + "node_modules/dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", + "license": "MIT" + }, "node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -5880,7 +6043,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, + "devOptional": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" @@ -5896,6 +6059,33 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-expand": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-12.0.1.tgz", + "integrity": "sha512-LaKRbou8gt0RNID/9RoI+J2rvXsBRPMV7p+ElHlPhcSARbCPDYcYG2s1TIzAfWv4YSgyY5taidWzzs31lNV3yQ==", + "license": "BSD-2-Clause", + "dependencies": { + "dotenv": "^16.4.5" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -5914,9 +6104,17 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, "license": "MIT" }, + "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", @@ -5940,9 +6138,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.151", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.151.tgz", - "integrity": "sha512-Rl6uugut2l9sLojjS4H4SAr3A4IgACMLgpuEMPYCVcKydzfyPrn5absNRju38IhQOf/NwjJY8OGWjlteqYeBCA==", + "version": "1.5.152", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.152.tgz", + "integrity": "sha512-xBOfg/EBaIlVsHipHl2VdTPJRSvErNUaqW8ejTq5OlOlIYx1wOllCHsAvAIrr55jD1IYEfdR86miUEt8H5IeJg==", "dev": true, "license": "ISC" }, @@ -5963,7 +6161,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, "license": "MIT" }, "node_modules/encodeurl": { @@ -6056,7 +6253,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -6495,6 +6691,12 @@ "node": ">=4" } }, + "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" + }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -6651,9 +6853,9 @@ } }, "node_modules/file-type": { - "version": "20.4.1", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-20.4.1.tgz", - "integrity": "sha512-hw9gNZXUfZ02Jo0uafWLaFVPter5/k2rfcrjFJJHX/77xtSDOfJuEFb6oKlFV86FLP1SuyHMW1PSk0U9M5tKkQ==", + "version": "20.5.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-20.5.0.tgz", + "integrity": "sha512-BfHZtG/l9iMm4Ecianu7P8HRD2tBHLtjXinm4X62XBOYzi7CYA7jyqfJzOvXHqzVrVPYqBo2/GvbARMaaJkKVg==", "license": "MIT", "dependencies": { "@tokenizer/inflate": "^0.2.6", @@ -6818,7 +7020,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, "license": "ISC", "dependencies": { "cross-spawn": "^7.0.6", @@ -6997,6 +7198,49 @@ "url": "https://github.com/sponsors/ljharb" } }, + "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", + "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", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/gcp-metadata": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", + "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", + "license": "Apache-2.0", + "dependencies": { + "gaxios": "^6.1.1", + "google-logging-utils": "^0.0.2", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -7011,7 +7255,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" @@ -7160,6 +7403,96 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/google-auth-library": { + "version": "9.15.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", + "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", + "license": "Apache-2.0", + "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/jwa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/google-auth-library/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", + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/google-logging-utils": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", + "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, + "node_modules/googleapis": { + "version": "148.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-148.0.0.tgz", + "integrity": "sha512-8PDG5VItm6E1TdZWDqtRrUJSlBcNwz0/MwCa6AL81y/RxPGXJRUwKqGZfCoVX1ZBbfr3I4NkDxBmeTyOAZSWqw==", + "license": "Apache-2.0", + "dependencies": { + "google-auth-library": "^9.0.0", + "googleapis-common": "^7.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/googleapis-common": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/googleapis-common/-/googleapis-common-7.2.0.tgz", + "integrity": "sha512-/fhDZEJZvOV3X5jmD+fKxMqma5q2Q9nZNSF3kn1F18tpxmA86BcTxAGBQdM0N89Z3bEaIs+HVznSmFJEAmMTjA==", + "license": "Apache-2.0", + "dependencies": { + "extend": "^3.0.2", + "gaxios": "^6.0.3", + "google-auth-library": "^9.7.0", + "qs": "^6.7.0", + "url-template": "^2.0.8", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/googleapis-common/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", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -7212,6 +7545,40 @@ "dev": true, "license": "MIT" }, + "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", + "dependencies": { + "gaxios": "^6.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/gtoken/node_modules/jwa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/gtoken/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", + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -7316,6 +7683,19 @@ "node": ">=10.19.0" } }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -7489,7 +7869,6 @@ "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==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -7558,7 +7937,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -7590,7 +7968,6 @@ "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/istanbul-lib-coverage": { @@ -8412,6 +8789,15 @@ "node": ">=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", + "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", @@ -8473,6 +8859,49 @@ "graceful-fs": "^4.1.6" } }, + "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/jwa": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", + "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "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/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -8527,6 +8956,12 @@ "node": ">= 0.8.0" } }, + "node_modules/libphonenumber-js": { + "version": "1.12.8", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.8.tgz", + "integrity": "sha512-f1KakiQJa9tdc7w1phC2ST+DyxWimy9c3g3yeF+84QtEanJr2K77wAmBPP22riU05xldniHsvXuflnLZ4oysqA==", + "license": "MIT" + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -8583,7 +9018,42 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true, + "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.memoize": { @@ -8600,6 +9070,12 @@ "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/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -8670,7 +9146,7 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/makeerror": { @@ -8863,7 +9339,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" @@ -8881,6 +9356,15 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -8958,6 +9442,42 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/mysql": { + "version": "2.18.1", + "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz", + "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==", + "license": "MIT", + "dependencies": { + "bignumber.js": "9.0.0", + "readable-stream": "2.3.7", + "safe-buffer": "5.1.2", + "sqlstring": "2.3.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mysql/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/mysql/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/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8998,6 +9518,26 @@ "lodash": "^4.17.21" } }, + "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", + "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-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -9237,7 +9777,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, "license": "BlueOak-1.0.0" }, "node_modules/parent-module": { @@ -9281,6 +9820,42 @@ "node": ">= 0.8" } }, + "node_modules/passport": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/passport/-/passport-0.7.0.tgz", + "integrity": "sha512-cPLl+qZpSc+ireUvt+IzqbED1cHHkDoVYMo30jbJIdOOjQ1MQYZBPiNvmi8UM6lJuOpTPXJGZQk0DtC4y61MYQ==", + "license": "MIT", + "dependencies": { + "passport-strategy": "1.x.x", + "pause": "0.0.1", + "utils-merge": "^1.0.1" + }, + "engines": { + "node": ">= 0.4.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jaredhanson" + } + }, + "node_modules/passport-jwt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/passport-jwt/-/passport-jwt-4.0.1.tgz", + "integrity": "sha512-UCKMDYhNuGOBE9/9Ycuoyh7vP6jpeTp/+sfMJl7nLff/t6dps+iaeE0hhNkKN8/HZHcJ7lCdOyDxHdDoxoSvdQ==", + "license": "MIT", + "dependencies": { + "jsonwebtoken": "^9.0.0", + "passport-strategy": "^1.0.0" + } + }, + "node_modules/passport-strategy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", + "integrity": "sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -9305,7 +9880,6 @@ "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": { "node": ">=8" @@ -9364,6 +9938,11 @@ "node": ">=8" } }, + "node_modules/pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==" + }, "node_modules/peek-readable": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-7.0.0.tgz", @@ -9785,7 +10364,6 @@ "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==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -10039,10 +10617,9 @@ } }, "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", - "dev": true, + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -10133,11 +10710,23 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "license": "ISC" }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, "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": { "shebang-regex": "^3.0.0" @@ -10150,7 +10739,6 @@ "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": { "node": ">=8" @@ -10232,7 +10820,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, "license": "ISC", "engines": { "node": ">=14" @@ -10322,6 +10909,31 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/sql-highlight": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/sql-highlight/-/sql-highlight-6.0.0.tgz", + "integrity": "sha512-+fLpbAbWkQ+d0JEchJT/NrRRXbYRNbG15gFpANx73EwxQB1PRjj+k/OI0GTU0J63g8ikGkJECQp9z8XEJZvPRw==", + "funding": [ + "https://github.com/scriptcoded/sql-highlight?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/scriptcoded" + } + ], + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/sqlstring": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", + "integrity": "sha512-ooAzh/7dxIG5+uDik1z/Rd1vli0+38izZhGzSa34FwR7IbelPWCCKSNIl8jlL/F7ERvy8CB2jNeM1E9i9mXMAQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -10432,7 +11044,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -10448,7 +11059,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -10463,7 +11073,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -10473,7 +11082,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -10486,7 +11094,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -10496,7 +11103,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -10509,7 +11115,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" @@ -10526,7 +11131,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -10539,7 +11143,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -10678,13 +11281,13 @@ } }, "node_modules/synckit": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.4.tgz", - "integrity": "sha512-Q/XQKRaJiLiFIBNN+mndW7S/RHxvwzuZS6ZwmRzUBqJBv/5QIKCEwkBC8GBf8EQJKYnaFs0wOZbKTXBPj8L9oQ==", + "version": "0.11.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.5.tgz", + "integrity": "sha512-frqvfWyDA5VPVdrWfH24uM6SI/O8NLpVbIIJxb8t/a3YGsp4AW9CYgSKC0OaSEfexnp7Y1pVh2Y6IHO8ggGDmA==", "dev": true, "license": "MIT", "dependencies": { - "@pkgr/core": "^0.2.3", + "@pkgr/core": "^0.2.4", "tslib": "^2.8.1" }, "engines": { @@ -10717,9 +11320,9 @@ } }, "node_modules/terser": { - "version": "5.39.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz", - "integrity": "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==", + "version": "5.39.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.1.tgz", + "integrity": "sha512-Mm6+uad0ZuDtcV8/4uOZQDQ8RuiC5Pu+iZRedJtF7yA/27sPL7d++In/AJKpWZlU3SYMPPkVfwetn6sgZ66pUA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -10996,6 +11599,12 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -11020,9 +11629,9 @@ } }, "node_modules/ts-jest": { - "version": "29.3.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.2.tgz", - "integrity": "sha512-bJJkrWc6PjFVz5g2DGCNUo8z7oFEYaz1xP1NpeDU7KNLMWPpEyV8Chbpkn8xjzgRDpQhnGMyvyldoL7h8JXyug==", + "version": "29.3.3", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.3.tgz", + "integrity": "sha512-y6jLm19SL4GroiBmHwFK4dSHUfDNmOrJbRfp6QmDIlI9p5tT5Q8ItccB4pTIslCIqOZuQnBwpTR0bQ5eUMYwkw==", "dev": true, "license": "MIT", "dependencies": { @@ -11033,8 +11642,8 @@ "json5": "^2.2.3", "lodash.memoize": "^4.1.2", "make-error": "^1.3.6", - "semver": "^7.7.1", - "type-fest": "^4.39.1", + "semver": "^7.7.2", + "type-fest": "^4.41.0", "yargs-parser": "^21.1.1" }, "bin": { @@ -11107,7 +11716,7 @@ "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", @@ -11250,11 +11859,221 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "license": "MIT" }, + "node_modules/typeorm": { + "version": "0.3.23", + "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.23.tgz", + "integrity": "sha512-CJUZWW7O5zZG0TA7bRpntJx97AvvQwsoSa1UgYlzTOtmkwODrqIyxP9wtzHpBssEKie5chnLiCVyxKNeYo65wQ==", + "license": "MIT", + "dependencies": { + "@sqltools/formatter": "^1.2.5", + "ansis": "^3.17.0", + "app-root-path": "^3.1.0", + "buffer": "^6.0.3", + "dayjs": "^1.11.13", + "debug": "^4.4.0", + "dotenv": "^16.4.7", + "glob": "^10.4.5", + "sha.js": "^2.4.11", + "sql-highlight": "^6.0.0", + "tslib": "^2.8.1", + "uuid": "^11.1.0", + "yargs": "^17.7.2" + }, + "bin": { + "typeorm": "cli.js", + "typeorm-ts-node-commonjs": "cli-ts-node-commonjs.js", + "typeorm-ts-node-esm": "cli-ts-node-esm.js" + }, + "engines": { + "node": ">=16.13.0" + }, + "funding": { + "url": "https://opencollective.com/typeorm" + }, + "peerDependencies": { + "@google-cloud/spanner": "^5.18.0 || ^6.0.0 || ^7.0.0", + "@sap/hana-client": "^2.12.25", + "better-sqlite3": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0", + "hdb-pool": "^0.1.6", + "ioredis": "^5.0.4", + "mongodb": "^5.8.0 || ^6.0.0", + "mssql": "^9.1.1 || ^10.0.1 || ^11.0.1", + "mysql2": "^2.2.5 || ^3.0.1", + "oracledb": "^6.3.0", + "pg": "^8.5.1", + "pg-native": "^3.0.0", + "pg-query-stream": "^4.0.0", + "redis": "^3.1.1 || ^4.0.0", + "reflect-metadata": "^0.1.14 || ^0.2.0", + "sql.js": "^1.4.0", + "sqlite3": "^5.0.3", + "ts-node": "^10.7.0", + "typeorm-aurora-data-api-driver": "^2.0.0 || ^3.0.0" + }, + "peerDependenciesMeta": { + "@google-cloud/spanner": { + "optional": true + }, + "@sap/hana-client": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "hdb-pool": { + "optional": true + }, + "ioredis": { + "optional": true + }, + "mongodb": { + "optional": true + }, + "mssql": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-native": { + "optional": true + }, + "pg-query-stream": { + "optional": true + }, + "redis": { + "optional": true + }, + "sql.js": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "ts-node": { + "optional": true + }, + "typeorm-aurora-data-api-driver": { + "optional": true + } + } + }, + "node_modules/typeorm/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typeorm/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "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", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/typeorm/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typeorm/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/typeorm/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/typeorm/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typeorm/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/typescript": { "version": "5.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -11265,15 +12084,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.32.0.tgz", - "integrity": "sha512-UMq2kxdXCzinFFPsXc9o2ozIpYCCOiEC46MG3yEh5Vipq6BO27otTtEBZA1fQ66DulEUgE97ucQ/3YY66CPg0A==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.32.1.tgz", + "integrity": "sha512-D7el+eaDHAmXvrZBy1zpzSNIRqnCOrkwTgZxTu3MUqRWk8k0q9m9Ho4+vPf7iHtgUfrK/o8IZaEApsxPlHTFCg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.32.0", - "@typescript-eslint/parser": "8.32.0", - "@typescript-eslint/utils": "8.32.0" + "@typescript-eslint/eslint-plugin": "8.32.1", + "@typescript-eslint/parser": "8.32.1", + "@typescript-eslint/utils": "8.32.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -11326,7 +12145,6 @@ "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, "license": "MIT" }, "node_modules/universalify": { @@ -11389,17 +12207,45 @@ "punycode": "^2.1.0" } }, + "node_modules/url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==", + "license": "BSD" + }, "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" }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/v8-to-istanbul": { @@ -11417,6 +12263,15 @@ "node": ">=10.12.0" } }, + "node_modules/validator": { + "version": "13.15.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.0.tgz", + "integrity": "sha512-36B2ryl4+oL5QxZ3AzD0t5SsMNGvTtQHpjgFO5tbNxfXbMFkY822ktCDe1MnlqV3301QQI9SLHDNJokDI+Z9pA==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -11473,6 +12328,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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" + }, "node_modules/webpack": { "version": "5.99.8", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.8.tgz", @@ -11673,11 +12534,20 @@ "url": "https://opencollective.com/webpack" } }, + "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", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "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": { "isexe": "^2.0.0" @@ -11719,7 +12589,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -11737,7 +12606,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -11747,7 +12615,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -11819,7 +12686,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, "license": "ISC", "engines": { "node": ">=10" @@ -11836,7 +12702,6 @@ "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, "license": "MIT", "dependencies": { "cliui": "^8.0.1", @@ -11855,7 +12720,6 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, "license": "ISC", "engines": { "node": ">=12" @@ -11879,7 +12743,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=6" diff --git a/package.json b/package.json index 9db2125..9008d6b 100644 --- a/package.json +++ b/package.json @@ -21,10 +21,23 @@ }, "dependencies": { "@nestjs/common": "^11.0.1", - "@nestjs/core": "^11.0.1", + "@nestjs/config": "^4.0.2", + "@nestjs/core": "^11.1.1", + "@nestjs/jwt": "^11.0.0", + "@nestjs/mapped-types": "*", + "@nestjs/passport": "^11.0.5", "@nestjs/platform-express": "^11.0.1", + "@nestjs/typeorm": "^11.0.0", + "class-validator": "^0.14.2", + "convert-array-to-csv": "^2.0.0", + "googleapis": "^148.0.0", + "moment": "^2.30.1", + "mysql": "^2.18.1", + "passport": "^0.7.0", + "passport-jwt": "^4.0.1", "reflect-metadata": "^0.2.2", - "rxjs": "^7.8.1" + "rxjs": "^7.8.1", + "typeorm": "^0.3.23" }, "devDependencies": { "@eslint/eslintrc": "^3.2.0", diff --git a/src/app.module.ts b/src/app.module.ts index 8662803..bbd262c 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,9 +1,63 @@ import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; +import { ConfigModule } from '@nestjs/config'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { CarreraModule } from './carrera/carrera.module'; +import { CasoEspecialModule } from './caso-especial/caso-especial.module'; +import { CuestionarioAlumnoModule } from './cuestionario-alumno/cuestionario-alumno.module'; +import { CuestionarioAlumno2Module } from './cuestionario-alumno2/cuestionario-alumno2.module'; +import { CuestionarioProgramaModule } from './cuestionario-programa/cuestionario-programa.module'; +import { CuestionarioPrograma2Module } from './cuestionario-programa2/cuestionario-programa2.module'; +import { ProgramaModule } from './programa/programa.module'; +import { ServicioModule } from './servicio/servicio.module'; +import { StatusModule } from './status/status.module'; +import { TipoUsuarioModule } from './tipo-usuario/tipo-usuario.module'; +import { UsuarioModule } from './usuario/usuario.module'; @Module({ - imports: [], + imports: [ + ConfigModule.forRoot( + {isGlobal: true} + ), + + TypeOrmModule.forRoot({ + type: 'mysql', + host: process.env.db_host, + username: process.env.db_username, + database: process.env.db_database, + password: process.env.db_password, + port: Number(process.env.db_port), + synchronize: true, + dropSchema: false, // elimina la base de datos + // logging: true, // Habilita los logs para depuración + autoLoadEntities: true, // Carga automáticamente las entidades + + }), + + CarreraModule, + + CasoEspecialModule, + + CuestionarioAlumnoModule, + + CuestionarioAlumno2Module, + + CuestionarioProgramaModule, + + CuestionarioPrograma2Module, + + ProgramaModule, + + ServicioModule, + + StatusModule, + + TipoUsuarioModule, + + UsuarioModule, + + ], controllers: [AppController], providers: [AppService], }) diff --git a/src/auth/auth.module.ts b/src/auth/auth.module.ts new file mode 100644 index 0000000..c6e8fa6 --- /dev/null +++ b/src/auth/auth.module.ts @@ -0,0 +1,15 @@ +import { JwtModule } from '@nestjs/jwt'; +import { Module } from '@nestjs/common'; +import { AuthService } from './auth.service'; + +@Module({ + imports: [ + JwtModule.register({ + secret: 'secretoSuperSeguro', // Usa un .env en producción + signOptions: { expiresIn: '1h' }, + }), + ], + providers: [AuthService], + exports: [AuthService], +}) +export class AuthModule {} diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts new file mode 100644 index 0000000..ff4d500 --- /dev/null +++ b/src/auth/auth.service.ts @@ -0,0 +1,31 @@ +import { Injectable, UnauthorizedException } from '@nestjs/common'; +import { JwtService } from '@nestjs/jwt'; + +@Injectable() +export class AuthService { + constructor(private readonly jwtService: JwtService) {} + + async jwtVerificar(token:string){ + try{ + const payload= this.jwtService.verify(token) + return payload; + }catch(err){ + if (err.name === 'TokenExpiredError') { + throw new UnauthorizedException('El token ha expirado'); + } else if (err.name === 'JsonWebTokenError') { + throw new UnauthorizedException('Token inválido'); + } else { + throw new UnauthorizedException('Error al verificar el token'); + } + } + + + } + + async jwtCreate(idUsuario: number, idTipoUsuario:number) { + const payload = { Usuario:idUsuario , tipoUsuario: idTipoUsuario }; + return { + access_token: this.jwtService.sign(payload), + }; + } +} diff --git a/src/carrera/carrera.controller.ts b/src/carrera/carrera.controller.ts new file mode 100644 index 0000000..0f9a9ef --- /dev/null +++ b/src/carrera/carrera.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { CarreraService } from './carrera.service'; +import { CreateCarreraDto } from './dto/create-carrera.dto'; +import { UpdateCarreraDto } from './dto/update-carrera.dto'; + +@Controller('carrera') +export class CarreraController { + constructor(private readonly carreraService: CarreraService) {} + + @Post() + create(@Body() createCarreraDto: CreateCarreraDto) { + return this.carreraService.create(createCarreraDto); + } + + @Get() + findAll() { + return this.carreraService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.carreraService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateCarreraDto: UpdateCarreraDto) { + return this.carreraService.update(+id, updateCarreraDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.carreraService.remove(+id); + } +} diff --git a/src/carrera/carrera.module.ts b/src/carrera/carrera.module.ts new file mode 100644 index 0000000..501fae1 --- /dev/null +++ b/src/carrera/carrera.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { CarreraService } from './carrera.service'; +import { CarreraController } from './carrera.controller'; + +@Module({ + controllers: [CarreraController], + providers: [CarreraService], +}) +export class CarreraModule {} diff --git a/src/carrera/carrera.service.ts b/src/carrera/carrera.service.ts new file mode 100644 index 0000000..cc97aa4 --- /dev/null +++ b/src/carrera/carrera.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateCarreraDto } from './dto/create-carrera.dto'; +import { UpdateCarreraDto } from './dto/update-carrera.dto'; + +@Injectable() +export class CarreraService { + create(createCarreraDto: CreateCarreraDto) { + return 'This action adds a new carrera'; + } + + findAll() { + return `This action returns all carrera`; + } + + findOne(id: number) { + return `This action returns a #${id} carrera`; + } + + update(id: number, updateCarreraDto: UpdateCarreraDto) { + return `This action updates a #${id} carrera`; + } + + remove(id: number) { + return `This action removes a #${id} carrera`; + } +} diff --git a/src/carrera/dto/create-carrera.dto.ts b/src/carrera/dto/create-carrera.dto.ts new file mode 100644 index 0000000..0015231 --- /dev/null +++ b/src/carrera/dto/create-carrera.dto.ts @@ -0,0 +1 @@ +export class CreateCarreraDto {} diff --git a/src/carrera/dto/update-carrera.dto.ts b/src/carrera/dto/update-carrera.dto.ts new file mode 100644 index 0000000..c6d55b1 --- /dev/null +++ b/src/carrera/dto/update-carrera.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateCarreraDto } from './create-carrera.dto'; + +export class UpdateCarreraDto extends PartialType(CreateCarreraDto) {} diff --git a/src/carrera/entities/carrera.entity.ts b/src/carrera/entities/carrera.entity.ts new file mode 100644 index 0000000..3f5682a --- /dev/null +++ b/src/carrera/entities/carrera.entity.ts @@ -0,0 +1,19 @@ +import { CasoEspecial } from "src/caso-especial/entities/caso-especial.entity"; +import { Servicio } from "src/servicio/entities/servicio.entity"; +import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from "typeorm"; + + +@Entity('carrera') +export class Carrera { + @PrimaryGeneratedColumn() + idCarrera:number; + + @Column({type: 'varchar', length: 50, nullable: false}) + carrera:string; + + @OneToMany(()=>Servicio, (servicio)=>servicio.carrera) + servicio:Servicio[]; + + @OneToMany(()=>CasoEspecial,(casoEspecial)=>casoEspecial.carrera) + casoEspecial:CasoEspecial[]; +} diff --git a/src/caso-especial/caso-especial.controller.ts b/src/caso-especial/caso-especial.controller.ts new file mode 100644 index 0000000..e9e4cb2 --- /dev/null +++ b/src/caso-especial/caso-especial.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { CasoEspecialService } from './caso-especial.service'; +import { CreateCasoEspecialDto } from './dto/create-caso-especial.dto'; +import { UpdateCasoEspecialDto } from './dto/update-caso-especial.dto'; + +@Controller('caso-especial') +export class CasoEspecialController { + constructor(private readonly casoEspecialService: CasoEspecialService) {} + + @Post() + create(@Body() createCasoEspecialDto: CreateCasoEspecialDto) { + return this.casoEspecialService.create(createCasoEspecialDto); + } + + @Get() + findAll() { + return this.casoEspecialService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.casoEspecialService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateCasoEspecialDto: UpdateCasoEspecialDto) { + return this.casoEspecialService.update(+id, updateCasoEspecialDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.casoEspecialService.remove(+id); + } +} diff --git a/src/caso-especial/caso-especial.module.ts b/src/caso-especial/caso-especial.module.ts new file mode 100644 index 0000000..16705e4 --- /dev/null +++ b/src/caso-especial/caso-especial.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { CasoEspecialService } from './caso-especial.service'; +import { CasoEspecialController } from './caso-especial.controller'; + +@Module({ + controllers: [CasoEspecialController], + providers: [CasoEspecialService], +}) +export class CasoEspecialModule {} diff --git a/src/caso-especial/caso-especial.service.ts b/src/caso-especial/caso-especial.service.ts new file mode 100644 index 0000000..d47c0f3 --- /dev/null +++ b/src/caso-especial/caso-especial.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateCasoEspecialDto } from './dto/create-caso-especial.dto'; +import { UpdateCasoEspecialDto } from './dto/update-caso-especial.dto'; + +@Injectable() +export class CasoEspecialService { + create(createCasoEspecialDto: CreateCasoEspecialDto) { + return 'This action adds a new casoEspecial'; + } + + findAll() { + return `This action returns all casoEspecial`; + } + + findOne(id: number) { + return `This action returns a #${id} casoEspecial`; + } + + update(id: number, updateCasoEspecialDto: UpdateCasoEspecialDto) { + return `This action updates a #${id} casoEspecial`; + } + + remove(id: number) { + return `This action removes a #${id} casoEspecial`; + } +} diff --git a/src/caso-especial/dto/create-caso-especial.dto.ts b/src/caso-especial/dto/create-caso-especial.dto.ts new file mode 100644 index 0000000..afc2c14 --- /dev/null +++ b/src/caso-especial/dto/create-caso-especial.dto.ts @@ -0,0 +1 @@ +export class CreateCasoEspecialDto {} diff --git a/src/caso-especial/dto/update-caso-especial.dto.ts b/src/caso-especial/dto/update-caso-especial.dto.ts new file mode 100644 index 0000000..ab8f6e8 --- /dev/null +++ b/src/caso-especial/dto/update-caso-especial.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateCasoEspecialDto } from './create-caso-especial.dto'; + +export class UpdateCasoEspecialDto extends PartialType(CreateCasoEspecialDto) {} diff --git a/src/caso-especial/entities/caso-especial.entity.ts b/src/caso-especial/entities/caso-especial.entity.ts new file mode 100644 index 0000000..8592c21 --- /dev/null +++ b/src/caso-especial/entities/caso-especial.entity.ts @@ -0,0 +1,57 @@ +import { Carrera } from "src/carrera/entities/carrera.entity"; +import { Status } from "src/status/entities/status.entity"; +import { Usuario } from "src/usuario/entities/usuario.entity"; +import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from "typeorm"; + +@Entity('caso_especial') +export class CasoEspecial { + @PrimaryGeneratedColumn() + idCasoEspecial: number; + + @Column({ type: 'varchar', length: 3 }) + creditos: string; + + @Column({ type: 'varchar', length: 60 }) + correo: string; + + @Column({ type: 'varchar', length: 15 }) + telefono: string; + + @Column({ type: 'varchar', length: 200, nullable: true, default: null }) + institucion: string | null; + + @Column({ type: 'varchar', length: 200, nullable: true, default: null }) + dependencia: string | null; + + @Column({ type: 'varchar', length: 1, nullable: true, default: null }) + motivo: string | null; + + @Column({ type: 'varchar', length: 200 }) + direccion: string; + + @Column({ type: 'timestamp' }) + fechaInicio: Date; + + @Column({ type: 'timestamp' }) + fechaFin: Date; + + @Column({ type: 'timestamp' }) + fechaNacimiento: Date; + + @Column({ type: 'varchar', length: 60 }) + carpeta: string; + + @Column({ type: 'varchar', length: 60 }) + archivoZip: string; + + @ManyToMany(()=>Usuario, (usuario)=>usuario.casoEspecial) + usuario:Usuario; + + @ManyToMany(()=>Carrera, (carrera)=>carrera.casoEspecial) + carrera:Carrera; + + @ManyToMany(()=>Status, (status)=>status.casoEspecial) + status:Status; + + +} diff --git a/src/cuestionario-alumno/cuestionario-alumno.controller.ts b/src/cuestionario-alumno/cuestionario-alumno.controller.ts new file mode 100644 index 0000000..d4693e7 --- /dev/null +++ b/src/cuestionario-alumno/cuestionario-alumno.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { CuestionarioAlumnoService } from './cuestionario-alumno.service'; +import { CreateCuestionarioAlumnoDto } from './dto/create-cuestionario-alumno.dto'; +import { UpdateCuestionarioAlumnoDto } from './dto/update-cuestionario-alumno.dto'; + +@Controller('cuestionario-alumno') +export class CuestionarioAlumnoController { + constructor(private readonly cuestionarioAlumnoService: CuestionarioAlumnoService) {} + + @Post() + create(@Body() createCuestionarioAlumnoDto: CreateCuestionarioAlumnoDto) { + return this.cuestionarioAlumnoService.create(createCuestionarioAlumnoDto); + } + + @Get() + findAll() { + return this.cuestionarioAlumnoService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.cuestionarioAlumnoService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateCuestionarioAlumnoDto: UpdateCuestionarioAlumnoDto) { + return this.cuestionarioAlumnoService.update(+id, updateCuestionarioAlumnoDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.cuestionarioAlumnoService.remove(+id); + } +} diff --git a/src/cuestionario-alumno/cuestionario-alumno.module.ts b/src/cuestionario-alumno/cuestionario-alumno.module.ts new file mode 100644 index 0000000..cd4e80f --- /dev/null +++ b/src/cuestionario-alumno/cuestionario-alumno.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { CuestionarioAlumnoService } from './cuestionario-alumno.service'; +import { CuestionarioAlumnoController } from './cuestionario-alumno.controller'; + +@Module({ + controllers: [CuestionarioAlumnoController], + providers: [CuestionarioAlumnoService], +}) +export class CuestionarioAlumnoModule {} diff --git a/src/cuestionario-alumno/cuestionario-alumno.service.ts b/src/cuestionario-alumno/cuestionario-alumno.service.ts new file mode 100644 index 0000000..7605048 --- /dev/null +++ b/src/cuestionario-alumno/cuestionario-alumno.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateCuestionarioAlumnoDto } from './dto/create-cuestionario-alumno.dto'; +import { UpdateCuestionarioAlumnoDto } from './dto/update-cuestionario-alumno.dto'; + +@Injectable() +export class CuestionarioAlumnoService { + create(createCuestionarioAlumnoDto: CreateCuestionarioAlumnoDto) { + return 'This action adds a new cuestionarioAlumno'; + } + + leer() { + return `This action returns all cuestionarioAlumno`; + } + + findOne(id: number) { + return `This action returns a #${id} cuestionarioAlumno`; + } + + update(id: number, updateCuestionarioAlumnoDto: UpdateCuestionarioAlumnoDto) { + return `This action updates a #${id} cuestionarioAlumno`; + } + + remove(id: number) { + return `This action removes a #${id} cuestionarioAlumno`; + } +} diff --git a/src/cuestionario-alumno/dto/create-cuestionario-alumno.dto.ts b/src/cuestionario-alumno/dto/create-cuestionario-alumno.dto.ts new file mode 100644 index 0000000..074bd25 --- /dev/null +++ b/src/cuestionario-alumno/dto/create-cuestionario-alumno.dto.ts @@ -0,0 +1,3 @@ +export class CreateCuestionarioAlumnoDto { + +} diff --git a/src/cuestionario-alumno/dto/update-cuestionario-alumno.dto.ts b/src/cuestionario-alumno/dto/update-cuestionario-alumno.dto.ts new file mode 100644 index 0000000..099aed4 --- /dev/null +++ b/src/cuestionario-alumno/dto/update-cuestionario-alumno.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateCuestionarioAlumnoDto } from './create-cuestionario-alumno.dto'; + +export class UpdateCuestionarioAlumnoDto extends PartialType(CreateCuestionarioAlumnoDto) {} diff --git a/src/cuestionario-alumno/entities/cuestionario-alumno.entity.ts b/src/cuestionario-alumno/entities/cuestionario-alumno.entity.ts new file mode 100644 index 0000000..135ee85 --- /dev/null +++ b/src/cuestionario-alumno/entities/cuestionario-alumno.entity.ts @@ -0,0 +1,111 @@ +import { Servicio } from "src/servicio/entities/servicio.entity"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; + +@Entity('cuestionario_alumno') +export class CuestionarioAlumno { + @PrimaryGeneratedColumn() + idCuestionarioAlumno: number; + + @Column({ type: 'varchar', length: 1 }) + sexo: string; + + @Column({ type: 'varchar', length: 2 }) + edad: string; + + @Column({ type: 'varchar', length: 100 }) + servicioMedico: string; + + @Column() + p1: boolean; + + @Column() + p2: boolean; + + @Column({ type: 'varchar', length: 150 }) + p3: string; + + @Column() + p4: boolean; + + @Column({ type: 'varchar', length: 7 }) + p5: string; + + @Column() + p6: boolean; + + @Column() + p7: boolean; + + @Column({ type: 'varchar', length: 5 }) + p8: string; + + @Column() + p9: boolean; + + @Column() + p10: boolean; + + @Column() + p11: boolean; + + @Column() + p12: boolean; + + @Column() + p13: boolean; + + @Column({ type: 'varchar', length: 7 }) + p14: string; + + @Column({ type: 'varchar', length: 7 }) + p15: string; + + @Column({ type: 'varchar', length: 2 }) + p16: string; + + @Column({ type: 'varchar', length: 5 }) + p17: string; + + @Column() + p18: boolean; + + @Column() + p19: boolean; + + @Column() + p20: boolean; + + @Column({ type: 'varchar', length: 9 }) + p21: string; + + @Column({ type: 'varchar', length: 23 }) + p22: string; + + @Column({ type: 'varchar', length: 8 }) + p23: string; + + @Column({ type: 'varchar', length: 8 }) + p24: string; + + @Column() + p25: boolean; + + @Column() + p26: boolean; + + @Column({ type: 'varchar', length: 400 }) + p27: string; + + @Column({ type: 'varchar', length: 1 }) + p28: string; + + @Column({ type: 'varchar', length: 1 }) + p29: string; + + @Column({ type: 'varchar', length: 400 }) + p30: string; + + @OneToMany(()=>Servicio,(servicio)=>servicio.cuestionarioAlumno2) + servicio:Servicio[]; + +} diff --git a/src/cuestionario-alumno2/cuestionario-alumno2.controller.ts b/src/cuestionario-alumno2/cuestionario-alumno2.controller.ts new file mode 100644 index 0000000..e01a602 --- /dev/null +++ b/src/cuestionario-alumno2/cuestionario-alumno2.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { CuestionarioAlumno2Service } from './cuestionario-alumno2.service'; +import { CreateCuestionarioAlumno2Dto } from './dto/create-cuestionario-alumno2.dto'; +import { UpdateCuestionarioAlumno2Dto } from './dto/update-cuestionario-alumno2.dto'; + +@Controller('cuestionario-alumno2') +export class CuestionarioAlumno2Controller { + constructor(private readonly cuestionarioAlumno2Service: CuestionarioAlumno2Service) {} + + @Post() + create(@Body() createCuestionarioAlumno2Dto: CreateCuestionarioAlumno2Dto) { + return this.cuestionarioAlumno2Service.create(createCuestionarioAlumno2Dto); + } + + @Get() + findAll() { + return this.cuestionarioAlumno2Service.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.cuestionarioAlumno2Service.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateCuestionarioAlumno2Dto: UpdateCuestionarioAlumno2Dto) { + return this.cuestionarioAlumno2Service.update(+id, updateCuestionarioAlumno2Dto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.cuestionarioAlumno2Service.remove(+id); + } +} diff --git a/src/cuestionario-alumno2/cuestionario-alumno2.module.ts b/src/cuestionario-alumno2/cuestionario-alumno2.module.ts new file mode 100644 index 0000000..4422a07 --- /dev/null +++ b/src/cuestionario-alumno2/cuestionario-alumno2.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { CuestionarioAlumno2Service } from './cuestionario-alumno2.service'; +import { CuestionarioAlumno2Controller } from './cuestionario-alumno2.controller'; + +@Module({ + controllers: [CuestionarioAlumno2Controller], + providers: [CuestionarioAlumno2Service], +}) +export class CuestionarioAlumno2Module {} diff --git a/src/cuestionario-alumno2/cuestionario-alumno2.service.ts b/src/cuestionario-alumno2/cuestionario-alumno2.service.ts new file mode 100644 index 0000000..3aa3a76 --- /dev/null +++ b/src/cuestionario-alumno2/cuestionario-alumno2.service.ts @@ -0,0 +1,119 @@ +import { Injectable } from '@nestjs/common'; +import { CreateCuestionarioAlumno2Dto } from './dto/create-cuestionario-alumno2.dto'; +import { UpdateCuestionarioAlumno2Dto } from './dto/update-cuestionario-alumno2.dto'; +import { InjectRepository } from '@nestjs/typeorm'; +import { Servicio } from 'src/servicio/entities/servicio.entity'; +import { IsNull, Not, Repository } from 'typeorm'; +import { CuestionarioAlumno } from 'src/cuestionario-alumno/entities/cuestionario-alumno.entity'; +import { CuestionarioAlumno2 } from './entities/cuestionario-alumno2.entity'; +import { messageByStatus } from 'src/messageByStatus'; +import { ArchivoService } from 'src/helpers/archivo.service'; +import { ValidacionService } from 'src/validaciones/validacion.service'; +const { convertArrayToCSV } = require('convert-array-to-csv'); + + + +@Injectable() +export class CuestionarioAlumno2Service { + constructor( + @InjectRepository(Servicio) + private servicioRepository:Repository, + @InjectRepository(CuestionarioAlumno2) + private cuestionarioAlumno2Repository:Repository, + @InjectRepository(CuestionarioAlumno) + private cuestionarioAlumnoRepository:Repository, + private validacionService:ValidacionService, + private archivoService:ArchivoService, + + + ){} + + async create(createCuestionarioAlumno2Dto: CreateCuestionarioAlumno2Dto) { + + let idServicio=createCuestionarioAlumno2Dto.idServicio + + let cuestionario2= await this.validacionService.validarCuestionarioAlumno2(createCuestionarioAlumno2Dto) + + + let servicio = await this.servicioRepository.findOne({where:{idServicio}}); + if(!servicio){ + throw new Error('No existe este Servicio Social.'); + } + + if(servicio.cuestionarioAlumno2.idCuestionarioAlumno2){ + throw new Error('Este Servicio Social ya cuenta con cuestionario de alumno'); + } + + console.log('el servicio social si existe'); + + + console.log('antes de create ques2'); + + if (messageByStatus.hasOwnProperty(servicio.status.idStatus)){ + throw new Error(messageByStatus[servicio.status.idStatus]); + } + + + + console.log("datos a registrar en la tabla cuestionarioAlumno2", { ...cuestionario2} ); + + let respuestasRegistradas = await this.cuestionarioAlumno2Repository.save( cuestionario2); + console.log('despues de registrar cuestionario', respuestasRegistradas); + + + console.log('agregar el id a la tabla servicio, esta validado en el front'); + + let resX= await this.servicioRepository.update( + {idServicio}, + {cuestionarioAlumno2:respuestasRegistradas} + ) + + return resX; + } + + async get(version:string, anio:string){ + const year = this.validacionService.validarNumero(anio, 'año', true, 4); + const path = `server/uploads/${year}_cuestionario_alumno.csv`; + + let data = []; + + console.log(year); + let temp + + if(version == 'v1'){ + temp = this.cuestionarioAlumnoRepository.find({ + where: { + idCuestionarioAlumno: Not(IsNull()), + }, + }) + } + + if(version == 'v2'){ + temp = this.cuestionarioAlumno2Repository.find({ + where: { + idCuestionarioAlumno2: Not(IsNull()), + }, + }) + } + + if(!temp){ + throw new Error() + } + + data = temp.map(item => ({ ...item })); + + await this.archivoService.eliminarArchivo(path).catch((err) => { + console.log(err); + }); + + return this.archivoService.crearArchivo(path, convertArrayToCSV(data)); + + + + + + + + } + +} diff --git a/src/cuestionario-alumno2/dto/create-cuestionario-alumno2.dto.ts b/src/cuestionario-alumno2/dto/create-cuestionario-alumno2.dto.ts new file mode 100644 index 0000000..ab1cefb --- /dev/null +++ b/src/cuestionario-alumno2/dto/create-cuestionario-alumno2.dto.ts @@ -0,0 +1,188 @@ +import { IsNotEmpty, IsOptional, IsString, IsNumber } from 'class-validator'; + + + +export class CreateCuestionarioAlumno2Dto { + + + @IsNumber() + @IsNotEmpty() + idServicio:number + + + @IsString() + @IsNotEmpty() + p1: string; + + @IsString() + @IsNotEmpty() + p2: string; + + @IsString() + @IsNotEmpty() + p4: string; + + @IsString() + @IsOptional() + p5?: string; + + @IsString() + @IsNotEmpty() + p6: string; + + @IsString() + @IsNotEmpty() + p7: string; + + @IsString() + @IsOptional() + p8?: string; + + @IsString() + @IsNotEmpty() + p9: string; + + @IsString() + @IsNotEmpty() + p3_1: string; + + @IsString() + @IsNotEmpty() + p3_2: string; + + @IsString() + @IsNotEmpty() + p3_3: string; + + @IsString() + @IsNotEmpty() + p3_4: string; + + @IsString() + @IsNotEmpty() + p10_1: string; + + @IsString() + @IsNotEmpty() + p10_2: string; + + @IsString() + @IsNotEmpty() + p10_3: string; + + @IsString() + @IsNotEmpty() + p11_1: string; + + @IsString() + @IsNotEmpty() + p11_2: string; + + @IsString() + @IsNotEmpty() + p11_3: string; + + @IsString() + @IsNotEmpty() + p11_4: string; + + @IsString() + @IsNotEmpty() + p12_A_1: string; + + @IsString() + @IsNotEmpty() + p12_A_2: string; + + @IsString() + @IsNotEmpty() + p12_A_3: string; + + @IsString() + @IsNotEmpty() + p12_A_4: string; + + @IsString() + @IsNotEmpty() + p12_B_1: string; + + @IsString() + @IsNotEmpty() + p12_B_2: string; + + @IsString() + @IsNotEmpty() + p12_B_3: string; + + @IsString() + @IsNotEmpty() + p12_B_4: string; + + @IsString() + @IsNotEmpty() + p12_C_1: string; + + @IsString() + @IsNotEmpty() + p12_C_2: string; + + @IsString() + @IsNotEmpty() + p12_C_3: string; + + @IsString() + @IsNotEmpty() + p12_C_4: string; + + @IsString() + @IsNotEmpty() + p12_D_1: string; + + @IsString() + @IsNotEmpty() + p12_D_2: string; + + @IsString() + @IsNotEmpty() + p12_D_3: string; + + @IsString() + @IsNotEmpty() + p12_D_4: string; + + @IsString() + @IsNotEmpty() + p12_D_5: string; + + @IsString() + @IsNotEmpty() + p13: string; + + @IsString() + @IsNotEmpty() + p14: string; + + @IsString() + @IsNotEmpty() + p15: string; + + @IsString() + @IsOptional() + p16: string; + + @IsString() + @IsNotEmpty() + p17_1: string; + + @IsString() + @IsNotEmpty() + p17_2: string; + + @IsString() + @IsNotEmpty() + p17_3: string; + + @IsString() + @IsOptional() + p18: string; +} diff --git a/src/cuestionario-alumno2/dto/update-cuestionario-alumno2.dto.ts b/src/cuestionario-alumno2/dto/update-cuestionario-alumno2.dto.ts new file mode 100644 index 0000000..0fe081d --- /dev/null +++ b/src/cuestionario-alumno2/dto/update-cuestionario-alumno2.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateCuestionarioAlumno2Dto } from './create-cuestionario-alumno2.dto'; + +export class UpdateCuestionarioAlumno2Dto extends PartialType(CreateCuestionarioAlumno2Dto) {} diff --git a/src/cuestionario-alumno2/entities/cuestionario-alumno2.entity.ts b/src/cuestionario-alumno2/entities/cuestionario-alumno2.entity.ts new file mode 100644 index 0000000..2af2e99 --- /dev/null +++ b/src/cuestionario-alumno2/entities/cuestionario-alumno2.entity.ts @@ -0,0 +1,145 @@ +import { Servicio } from "src/servicio/entities/servicio.entity"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; + +@Entity('cuestionario_alumno_2') +export class CuestionarioAlumno2 { + + @PrimaryGeneratedColumn() + idCuestionarioAlumno2: number; + + @Column({ type: 'varchar', length: 100, nullable: false }) + p1: string; + + @Column({ type: 'varchar', length: 50, nullable: false }) + p2: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p4: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p5: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p6: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p7: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p8: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p9: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p3_1: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p3_2: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p3_3: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p3_4: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p10_1: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p10_2: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p10_3: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p11_1: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p11_2: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p11_3: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p11_4: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_A_1: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_A_2: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_A_3: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_A_4: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_B_1: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_B_2: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_B_3: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_B_4: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_C_1: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_C_2: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_C_3: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_C_4: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_D_1: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_D_2: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_D_3: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_D_4: string; + + @Column({ type: 'varchar', length: 20, nullable: false }) + p12_D_5: string; + + @Column({ type: 'varchar', length: 100, nullable: false }) + p13: string; + + @Column({ type: 'varchar', length: 100, nullable: false }) + p14: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p15: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p16: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p17_1: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p17_2: string; + + @Column({ type: 'varchar', length: 5, nullable: false }) + p17_3: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p18: string; + + @OneToMany(()=>Servicio,(servicio)=>servicio.cuestionarioAlumno2) + servicio:Servicio[]; + +} diff --git a/src/cuestionario-programa/cuestionario-programa.controller.ts b/src/cuestionario-programa/cuestionario-programa.controller.ts new file mode 100644 index 0000000..d685ef1 --- /dev/null +++ b/src/cuestionario-programa/cuestionario-programa.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { CuestionarioProgramaService } from './cuestionario-programa.service'; +import { CreateCuestionarioProgramaDto } from './dto/create-cuestionario-programa.dto'; +import { UpdateCuestionarioProgramaDto } from './dto/update-cuestionario-programa.dto'; + +@Controller('cuestionario-programa') +export class CuestionarioProgramaController { + constructor(private readonly cuestionarioProgramaService: CuestionarioProgramaService) {} + + @Post() + create(@Body() createCuestionarioProgramaDto: CreateCuestionarioProgramaDto) { + return this.cuestionarioProgramaService.create(createCuestionarioProgramaDto); + } + + @Get() + findAll() { + return this.cuestionarioProgramaService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.cuestionarioProgramaService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateCuestionarioProgramaDto: UpdateCuestionarioProgramaDto) { + return this.cuestionarioProgramaService.update(+id, updateCuestionarioProgramaDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.cuestionarioProgramaService.remove(+id); + } +} diff --git a/src/cuestionario-programa/cuestionario-programa.module.ts b/src/cuestionario-programa/cuestionario-programa.module.ts new file mode 100644 index 0000000..5505c8a --- /dev/null +++ b/src/cuestionario-programa/cuestionario-programa.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { CuestionarioProgramaService } from './cuestionario-programa.service'; +import { CuestionarioProgramaController } from './cuestionario-programa.controller'; + +@Module({ + controllers: [CuestionarioProgramaController], + providers: [CuestionarioProgramaService], +}) +export class CuestionarioProgramaModule {} diff --git a/src/cuestionario-programa/cuestionario-programa.service.ts b/src/cuestionario-programa/cuestionario-programa.service.ts new file mode 100644 index 0000000..5fb4877 --- /dev/null +++ b/src/cuestionario-programa/cuestionario-programa.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateCuestionarioProgramaDto } from './dto/create-cuestionario-programa.dto'; +import { UpdateCuestionarioProgramaDto } from './dto/update-cuestionario-programa.dto'; + +@Injectable() +export class CuestionarioProgramaService { + create(createCuestionarioProgramaDto: CreateCuestionarioProgramaDto) { + return 'This action adds a new cuestionarioPrograma'; + } + + findAll() { + return `This action returns all cuestionarioPrograma`; + } + + findOne(id: number) { + return `This action returns a #${id} cuestionarioPrograma`; + } + + update(id: number, updateCuestionarioProgramaDto: UpdateCuestionarioProgramaDto) { + return `This action updates a #${id} cuestionarioPrograma`; + } + + remove(id: number) { + return `This action removes a #${id} cuestionarioPrograma`; + } +} diff --git a/src/cuestionario-programa/dto/create-cuestionario-programa.dto.ts b/src/cuestionario-programa/dto/create-cuestionario-programa.dto.ts new file mode 100644 index 0000000..034f54d --- /dev/null +++ b/src/cuestionario-programa/dto/create-cuestionario-programa.dto.ts @@ -0,0 +1 @@ +export class CreateCuestionarioProgramaDto {} diff --git a/src/cuestionario-programa/dto/update-cuestionario-programa.dto.ts b/src/cuestionario-programa/dto/update-cuestionario-programa.dto.ts new file mode 100644 index 0000000..7af4e55 --- /dev/null +++ b/src/cuestionario-programa/dto/update-cuestionario-programa.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateCuestionarioProgramaDto } from './create-cuestionario-programa.dto'; + +export class UpdateCuestionarioProgramaDto extends PartialType(CreateCuestionarioProgramaDto) {} diff --git a/src/cuestionario-programa/entities/cuestionario-programa.entity.ts b/src/cuestionario-programa/entities/cuestionario-programa.entity.ts new file mode 100644 index 0000000..6807c73 --- /dev/null +++ b/src/cuestionario-programa/entities/cuestionario-programa.entity.ts @@ -0,0 +1,35 @@ +import { Servicio } from "src/servicio/entities/servicio.entity"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; + +@Entity('cuestionario_programa') +export class CuestionarioPrograma { + @PrimaryGeneratedColumn() + idCuestionarioPrograma: number; + + @Column({ type: 'varchar', length: 400, nullable: false }) + actividad1: string; + + @Column({ type: 'varchar', length: 400, nullable: false }) + actividad2: string; + + @Column({ type: 'varchar', length: 400, nullable: false }) + actividad3: string; + + @Column({ type: 'varchar', length: 400, nullable: false }) + actividad4: string; + + @Column({ type: 'varchar', length: 400, nullable: false }) + actividad5: string; + + @Column({ type: 'varchar', length: 9, nullable: false }) + retroalimentacion: string; + + @Column({ type: 'varchar', length: 800, nullable: false }) + p6: string; + + @Column({ type: 'varchar', length: 800, nullable: false }) + p7: string; + + @OneToMany(()=>Servicio,(servicio)=>servicio.cuestionarioPrograma) + servicio:Servicio[]; +} diff --git a/src/cuestionario-programa2/cuestionario-programa2.controller.ts b/src/cuestionario-programa2/cuestionario-programa2.controller.ts new file mode 100644 index 0000000..8b406dd --- /dev/null +++ b/src/cuestionario-programa2/cuestionario-programa2.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { CuestionarioPrograma2Service } from './cuestionario-programa2.service'; +import { CreateCuestionarioPrograma2Dto } from './dto/create-cuestionario-programa2.dto'; +import { UpdateCuestionarioPrograma2Dto } from './dto/update-cuestionario-programa2.dto'; + +@Controller('cuestionario-programa2') +export class CuestionarioPrograma2Controller { + constructor(private readonly cuestionarioPrograma2Service: CuestionarioPrograma2Service) {} + + @Post() + create(@Body() createCuestionarioPrograma2Dto: CreateCuestionarioPrograma2Dto) { + return this.cuestionarioPrograma2Service.create(createCuestionarioPrograma2Dto); + } + + @Get() + findAll() { + return this.cuestionarioPrograma2Service.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.cuestionarioPrograma2Service.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateCuestionarioPrograma2Dto: UpdateCuestionarioPrograma2Dto) { + return this.cuestionarioPrograma2Service.update(+id, updateCuestionarioPrograma2Dto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.cuestionarioPrograma2Service.remove(+id); + } +} diff --git a/src/cuestionario-programa2/cuestionario-programa2.module.ts b/src/cuestionario-programa2/cuestionario-programa2.module.ts new file mode 100644 index 0000000..5bd98b3 --- /dev/null +++ b/src/cuestionario-programa2/cuestionario-programa2.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { CuestionarioPrograma2Service } from './cuestionario-programa2.service'; +import { CuestionarioPrograma2Controller } from './cuestionario-programa2.controller'; + +@Module({ + controllers: [CuestionarioPrograma2Controller], + providers: [CuestionarioPrograma2Service], +}) +export class CuestionarioPrograma2Module {} diff --git a/src/cuestionario-programa2/cuestionario-programa2.service.ts b/src/cuestionario-programa2/cuestionario-programa2.service.ts new file mode 100644 index 0000000..3737177 --- /dev/null +++ b/src/cuestionario-programa2/cuestionario-programa2.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateCuestionarioPrograma2Dto } from './dto/create-cuestionario-programa2.dto'; +import { UpdateCuestionarioPrograma2Dto } from './dto/update-cuestionario-programa2.dto'; + +@Injectable() +export class CuestionarioPrograma2Service { + create(createCuestionarioPrograma2Dto: CreateCuestionarioPrograma2Dto) { + return 'This action adds a new cuestionarioPrograma2'; + } + + findAll() { + return `This action returns all cuestionarioPrograma2`; + } + + findOne(id: number) { + return `This action returns a #${id} cuestionarioPrograma2`; + } + + update(id: number, updateCuestionarioPrograma2Dto: UpdateCuestionarioPrograma2Dto) { + return `This action updates a #${id} cuestionarioPrograma2`; + } + + remove(id: number) { + return `This action removes a #${id} cuestionarioPrograma2`; + } +} diff --git a/src/cuestionario-programa2/dto/create-cuestionario-programa2.dto.ts b/src/cuestionario-programa2/dto/create-cuestionario-programa2.dto.ts new file mode 100644 index 0000000..e3a1ba4 --- /dev/null +++ b/src/cuestionario-programa2/dto/create-cuestionario-programa2.dto.ts @@ -0,0 +1 @@ +export class CreateCuestionarioPrograma2Dto {} diff --git a/src/cuestionario-programa2/dto/update-cuestionario-programa2.dto.ts b/src/cuestionario-programa2/dto/update-cuestionario-programa2.dto.ts new file mode 100644 index 0000000..18d949e --- /dev/null +++ b/src/cuestionario-programa2/dto/update-cuestionario-programa2.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateCuestionarioPrograma2Dto } from './create-cuestionario-programa2.dto'; + +export class UpdateCuestionarioPrograma2Dto extends PartialType(CreateCuestionarioPrograma2Dto) {} diff --git a/src/cuestionario-programa2/entities/cuestionario-programa2.entity.ts b/src/cuestionario-programa2/entities/cuestionario-programa2.entity.ts new file mode 100644 index 0000000..2a27feb --- /dev/null +++ b/src/cuestionario-programa2/entities/cuestionario-programa2.entity.ts @@ -0,0 +1,90 @@ +import { Servicio } from "src/servicio/entities/servicio.entity"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; + +@Entity('cuestionario_programa_2') +export class CuestionarioPrograma2 { + @PrimaryGeneratedColumn() + idCuestionarioPrograma2: number; + + // Sección p3_A_* + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_A_1: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_A_2: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_A_3: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_A_4: string; + + // Sección p3_B_* + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_B_1: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_B_2: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_B_3: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_B_4: string; + + // Sección p3_C_* + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_C_1: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_C_2: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_C_3: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_C_4: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_C_5: string; + + // Sección p3_D_* + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_D_1: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_D_2: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_D_3: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_D_4: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_D_5: string; + + // Sección p3_E_* + @Column({ type: 'varchar', length: 50, nullable: true }) + p3_E_1: string; + + // p1, p2, p4, p5, p6 + @Column({ type: 'varchar', length: 100, nullable: true }) + p1: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + p2: string; + + @Column({ type: 'varchar', length: 100, nullable: true }) + p4: string; + + @Column({ type: 'varchar', length: 5, nullable: true }) + p5: string; + + @Column({ type: 'varchar', length: 100, nullable: true }) + p6: string; + + @OneToMany(()=>Servicio,(servicio)=>servicio.cuestionarioAlumno2) + servicio:Servicio[]; + +} diff --git a/src/drive/drive.module.ts b/src/drive/drive.module.ts new file mode 100644 index 0000000..faaad0c --- /dev/null +++ b/src/drive/drive.module.ts @@ -0,0 +1,9 @@ +// src/drive/drive.module.ts +import { Module } from '@nestjs/common'; +import { DriveService } from './drive.service'; + +@Module({ + providers: [DriveService], + exports: [DriveService], +}) +export class DriveModule {} diff --git a/src/drive/drive.service.ts b/src/drive/drive.service.ts new file mode 100644 index 0000000..8996f1e --- /dev/null +++ b/src/drive/drive.service.ts @@ -0,0 +1,172 @@ +// src/drive/drive.service.ts +import { Injectable, InternalServerErrorException } from '@nestjs/common'; +import { google } from 'googleapis'; +import * as fs from 'fs'; +import * as path from 'path'; +import { error } from 'console'; + +@Injectable() +export class DriveService { + private SCOPES = ['https://www.googleapis.com/auth/drive']; + + private loadCredentials() { + try { + const credenciales = JSON.parse( + fs.readFileSync(path.resolve('./cred.json'), 'utf8'), + ); + credenciales.private_key = credenciales.private_key.replace(/\\n/g, '\n'); + return new google.auth.JWT( + credenciales.client_email, + undefined, + credenciales.private_key, + this.SCOPES, + ); + } catch (err) { + console.error('❌ Error cargando credenciales:', err); + throw new InternalServerErrorException('Error al cargar credenciales'); + } + } + + async list(pageToken = '') { + const authClient = await this.loadCredentials(); + const drive = google.drive({ version: 'v3', auth: authClient }); + + try { + const res = await drive.files.list({ + corpora: 'user', + supportsTeamDrives: true, + includeTeamDriveItems: true, + spaces: 'drive', + pageSize: 1000, + pageToken, + orderBy: 'name', + }); + return res.data; + } catch (err) { + throw new InternalServerErrorException( + 'Error al listar archivos: ' + err.message, + ); + } + } + + async deleteFile(fileId: string) { + if (fileId === process.env.CARPETA) { + throw new Error('No se puede eliminar este archivo/carpeta.'); + } + const authClient = await this.loadCredentials(); + const drive = google.drive({ version: 'v3', auth: authClient }); + + try { + return await drive.files.delete({ fileId }); + } catch (err) { + throw new InternalServerErrorException( + 'Error al eliminar archivo: ' + err.message, + ); + } + } + + async uploadFile(filePath: string, name: string, mimeType: string, parent: string) { + const authClient = await this.loadCredentials(); + const drive = google.drive({ version: 'v3', auth: authClient }); + + const requestBody = { + name, + parents: [parent], + }; + const media = { + mimeType, + body: fs.createReadStream(filePath), + }; + + try { + const res = await drive.files.create({ + requestBody, + media, + fields: 'id', + }); + fs.unlinkSync(filePath); + return res.data.id; + } catch (err) { + throw new InternalServerErrorException( + 'Error al subir archivo: ' + err.message, + ); + } + } + + async mkDir(name: string): Promise { + const authClient = await this.loadCredentials(); + const drive = google.drive({ version: 'v3', auth: authClient }); + + + if(!name){ + throw new Error() + } + if(!process.env.CARPETA){ + throw new Error() + } + + const requestBody = { + name, + mimeType: 'application/vnd.google-apps.folder', + parents: [process.env.CARPETA], + }; + + + try { + const res = await drive.files.create({ + requestBody, + fields: 'id', + }); + + if(!res.data.id){ + throw new Error() + } + + return res.data.id; + + } catch (err) { + throw new InternalServerErrorException( + 'Error al crear carpeta: ' + err.message, + ); + } + } + + async update(fileId: string, addParents: string, removeParents: string) { + const authClient = await this.loadCredentials(); + const drive = google.drive({ version: 'v3', auth: authClient }); + + try { + const res = await drive.files.update({ + fileId, + addParents, + removeParents, + }); + return res.data; + } catch (err) { + throw new InternalServerErrorException( + 'Error al actualizar archivo: ' + err.message, + ); + } + } + + async folder(numeroCuenta: string) { + let pageToken = ''; + do { + const res = await this.list(pageToken); + if(!res.files){ + throw new Error() + } + for (const file of res.files) { + if ( + file.name === numeroCuenta && + file.mimeType === 'application/vnd.google-apps.folder' + ) { + return file.id; + } + } + pageToken = res.nextPageToken || ''; + + } while (pageToken); + return this.mkDir(numeroCuenta); + } +} diff --git a/src/helpers/archivo.service.ts b/src/helpers/archivo.service.ts new file mode 100644 index 0000000..62afc61 --- /dev/null +++ b/src/helpers/archivo.service.ts @@ -0,0 +1,41 @@ +import { Injectable } from '@nestjs/common'; +import * as fs from 'fs'; +import * as moment from 'moment'; + +@Injectable() +export class ArchivoService { + crearDDMMAAAA(date: any): string { + const fechaMoment = moment(date); + let ddmmaaaa = ''; + + if (fechaMoment.isValid()) { + ddmmaaaa = `${fechaMoment.date()}/${fechaMoment.month() + 1}/${fechaMoment.year()}`; + } + + return ddmmaaaa; + } + + eliminarArchivo(path: string): Promise<{ message: string }> { + return new Promise((resolve, reject) => { + fs.unlink(path, (err) => { + if (err) { + reject(err); + } else { + resolve({ message: 'Se eliminó el archivo correctamente.' }); + } + }); + }); + } + + crearArchivo(path: string, texto: string): Promise<{ message: string }> { + return new Promise((resolve, reject) => { + fs.appendFile(path, texto, (err) => { + if (err) { + reject(err); + } else { + resolve({ message: 'Se creó el archivo correctamente.' }); + } + }); + }); + } +} diff --git a/src/main.ts b/src/main.ts index f76bc8d..9278ba0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,6 +3,10 @@ import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); + + + app.enableCors(); await app.listen(process.env.PORT ?? 3000); + console.log(`Aplicación corriendo en: http://localhost:${process.env.PORT ?? 3000}`); } bootstrap(); diff --git a/src/messageByStatus.ts b/src/messageByStatus.ts new file mode 100644 index 0000000..9183097 --- /dev/null +++ b/src/messageByStatus.ts @@ -0,0 +1,11 @@ +export const messageByStatus = { + 1: 'Aun no se puede contestar el cuestionario este Servicio Social.', + 2: 'Aun no se puede contestar el cuestionario este Servicio Social.', + 3: 'Aun no se puede contestar el cuestionario este Servicio Social.', + 5: 'Este Servicio Social ya paso la fase de contestar el cuestionario.', + 6: 'Este Servicio Social ya paso la fase de contestar el cuestionario.', + 7: 'Este Servicio Social se encuentra rechazado. No se puede avanzar hasta que se corrija lo necesario.', + 8: 'Este Servicio Social se encuentra rechazado. No se puede avanzar hasta que se corrija lo necesario.', + 9: 'Este Servicio Social se encuentra rechazado. No se puede avanzar hasta que se corrija lo necesario.', + 10: 'Este Servicio Social fue cancelado.', + }; diff --git a/src/programa/dto/create-programa.dto.ts b/src/programa/dto/create-programa.dto.ts new file mode 100644 index 0000000..3b00753 --- /dev/null +++ b/src/programa/dto/create-programa.dto.ts @@ -0,0 +1 @@ +export class CreateProgramaDto {} diff --git a/src/programa/dto/update-programa.dto.ts b/src/programa/dto/update-programa.dto.ts new file mode 100644 index 0000000..1ab1cec --- /dev/null +++ b/src/programa/dto/update-programa.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateProgramaDto } from './create-programa.dto'; + +export class UpdateProgramaDto extends PartialType(CreateProgramaDto) {} diff --git a/src/programa/entities/programa.entity.ts b/src/programa/entities/programa.entity.ts new file mode 100644 index 0000000..f62d010 --- /dev/null +++ b/src/programa/entities/programa.entity.ts @@ -0,0 +1,33 @@ +import { Servicio } from "src/servicio/entities/servicio.entity"; +import { Usuario } from "src/usuario/entities/usuario.entity"; +import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm"; + +@Entity('programa') +export class Programa { + @PrimaryGeneratedColumn() + idPrograma: number; + + @Column({ type: 'varchar', length: 120 }) + institucion: string; + + @Column({ type: 'varchar', length: 120 }) + dependencia: string; + + @Column({ type: 'varchar', length: 280 }) + programa: string; + + @Column({ type: 'varchar', length: 20 }) + clavePrograma: string; + + @Column({ type: 'boolean', default: false }) + acatlan: boolean; + + @Column({ type: 'boolean', default: true }) + activo: boolean; + + @ManyToOne(()=>Usuario,(usuario)=>usuario.programa) + usuario:Usuario; + + @OneToMany(()=>Servicio,(servicio)=>servicio.cuestionarioAlumno2) + servicio:Servicio[]; +} diff --git a/src/programa/programa.controller.ts b/src/programa/programa.controller.ts new file mode 100644 index 0000000..b95e39a --- /dev/null +++ b/src/programa/programa.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { ProgramaService } from './programa.service'; +import { CreateProgramaDto } from './dto/create-programa.dto'; +import { UpdateProgramaDto } from './dto/update-programa.dto'; + +@Controller('programa') +export class ProgramaController { + constructor(private readonly programaService: ProgramaService) {} + + @Post() + create(@Body() createProgramaDto: CreateProgramaDto) { + return this.programaService.create(createProgramaDto); + } + + @Get() + findAll() { + return this.programaService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.programaService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateProgramaDto: UpdateProgramaDto) { + return this.programaService.update(+id, updateProgramaDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.programaService.remove(+id); + } +} diff --git a/src/programa/programa.module.ts b/src/programa/programa.module.ts new file mode 100644 index 0000000..aac5c70 --- /dev/null +++ b/src/programa/programa.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { ProgramaService } from './programa.service'; +import { ProgramaController } from './programa.controller'; + +@Module({ + controllers: [ProgramaController], + providers: [ProgramaService], +}) +export class ProgramaModule {} diff --git a/src/programa/programa.service.ts b/src/programa/programa.service.ts new file mode 100644 index 0000000..16f6de1 --- /dev/null +++ b/src/programa/programa.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateProgramaDto } from './dto/create-programa.dto'; +import { UpdateProgramaDto } from './dto/update-programa.dto'; + +@Injectable() +export class ProgramaService { + create(createProgramaDto: CreateProgramaDto) { + return 'This action adds a new programa'; + } + + findAll() { + return `This action returns all programa`; + } + + findOne(id: number) { + return `This action returns a #${id} programa`; + } + + update(id: number, updateProgramaDto: UpdateProgramaDto) { + return `This action updates a #${id} programa`; + } + + remove(id: number) { + return `This action removes a #${id} programa`; + } +} diff --git a/src/servicio/dto/create-servicio.dto.ts b/src/servicio/dto/create-servicio.dto.ts new file mode 100644 index 0000000..edd74e9 --- /dev/null +++ b/src/servicio/dto/create-servicio.dto.ts @@ -0,0 +1 @@ +export class CreateServicioDto {} diff --git a/src/servicio/dto/update-servicio.dto.ts b/src/servicio/dto/update-servicio.dto.ts new file mode 100644 index 0000000..c830b2d --- /dev/null +++ b/src/servicio/dto/update-servicio.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateServicioDto } from './create-servicio.dto'; + +export class UpdateServicioDto extends PartialType(CreateServicioDto) {} diff --git a/src/servicio/entities/servicio.entity.ts b/src/servicio/entities/servicio.entity.ts new file mode 100644 index 0000000..087cc45 --- /dev/null +++ b/src/servicio/entities/servicio.entity.ts @@ -0,0 +1,88 @@ +import { Carrera } from "src/carrera/entities/carrera.entity"; +import { CuestionarioAlumno } from "src/cuestionario-alumno/entities/cuestionario-alumno.entity"; +import { CuestionarioAlumno2 } from "src/cuestionario-alumno2/entities/cuestionario-alumno2.entity"; +import { CuestionarioPrograma } from "src/cuestionario-programa/entities/cuestionario-programa.entity"; +import { CuestionarioPrograma2 } from "src/cuestionario-programa2/entities/cuestionario-programa2.entity"; +import { Programa } from "src/programa/entities/programa.entity"; +import { Status } from "src/status/entities/status.entity"; +import { Usuario } from "src/usuario/entities/usuario.entity"; +import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm"; + +@Entity('servicio') +export class Servicio { + + @PrimaryGeneratedColumn() + idServicio: number; + + @Column({ type: 'varchar', length: 3 }) + creditos: string; + + @Column({ type: 'varchar', length: 60 }) + correo: string; + + @Column({ type: 'varchar', length: 15, nullable: true, default: null }) + telefono?: string; + + @Column({ type: 'varchar', length: 200, nullable: true, default: null }) + direccion?: string; + + @Column({ type: 'date' }) + fechaInicio: Date; + + @Column({ type: 'date' }) + fechaFin: Date; + + @Column({ type: 'date', nullable: true, default: null }) + fechaLiberacion?: Date; + + @Column({ type: 'date', nullable: true, default: null }) + fechaNacimiento?: Date; + + @Column({ type: 'varchar', length: 60 }) + carpeta: string; + + @Column({ type: 'varchar', length: 60 }) + cartaAceptacion: string; + + @Column({ type: 'varchar', length: 60, nullable: true, default: null }) + cartaTermino?: string; + + @Column({ type: 'varchar', length: 60, nullable: true, default: null }) + informeGlobal?: string; + + @Column({ type: 'varchar', length: 250, nullable: true, default: null }) + programaInterno?: string; + + @Column({ type: 'varchar', length: 50, nullable: true, default: null }) + profesor?: string; + + @Column({ type: 'boolean', nullable: true, default: null }) + vistoBuenoAcatlan?: boolean; + + @ManyToOne(()=>Usuario,(usuario)=>usuario.servicio) + usuario:Usuario + + @ManyToOne(()=>CuestionarioAlumno2,(cuestionarioAlumno2)=>cuestionarioAlumno2.servicio) + cuestionarioAlumno2:CuestionarioAlumno2; + + @ManyToOne(()=>CuestionarioPrograma2,(cuestionarioPrograma2)=>cuestionarioPrograma2.servicio) + cuestionarioPrograma2:CuestionarioPrograma2; + + @ManyToOne(()=>CuestionarioPrograma,(cuestionarioPrograma)=>cuestionarioPrograma.servicio) + cuestionarioPrograma:CuestionarioPrograma; + + @ManyToOne(()=>CuestionarioAlumno,(cuestionarioAlumno)=>cuestionarioAlumno.servicio) + cuestionarioAlumno:CuestionarioAlumno; + + @ManyToOne(()=>Status,(status)=>status.servicio) + status:Status; + + @ManyToOne(()=>Programa,(programa)=>programa.servicio) + programa:Programa; + + @ManyToOne(()=>Carrera,(carrera)=>carrera.servicio) + carrera:Carrera; + + + +} diff --git a/src/servicio/servicio.controller.ts b/src/servicio/servicio.controller.ts new file mode 100644 index 0000000..b1a964a --- /dev/null +++ b/src/servicio/servicio.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { ServicioService } from './servicio.service'; +import { CreateServicioDto } from './dto/create-servicio.dto'; +import { UpdateServicioDto } from './dto/update-servicio.dto'; + +@Controller('servicio') +export class ServicioController { + constructor(private readonly servicioService: ServicioService) {} + + @Post() + create(@Body() createServicioDto: CreateServicioDto) { + return this.servicioService.create(createServicioDto); + } + + @Get() + findAll() { + return this.servicioService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.servicioService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateServicioDto: UpdateServicioDto) { + return this.servicioService.update(+id, updateServicioDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.servicioService.remove(+id); + } +} diff --git a/src/servicio/servicio.module.ts b/src/servicio/servicio.module.ts new file mode 100644 index 0000000..7c691f3 --- /dev/null +++ b/src/servicio/servicio.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { ServicioService } from './servicio.service'; +import { ServicioController } from './servicio.controller'; + +@Module({ + controllers: [ServicioController], + providers: [ServicioService], +}) +export class ServicioModule {} diff --git a/src/servicio/servicio.service.ts b/src/servicio/servicio.service.ts new file mode 100644 index 0000000..7d7bd27 --- /dev/null +++ b/src/servicio/servicio.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateServicioDto } from './dto/create-servicio.dto'; +import { UpdateServicioDto } from './dto/update-servicio.dto'; + +@Injectable() +export class ServicioService { + create(createServicioDto: CreateServicioDto) { + return 'This action adds a new servicio'; + } + + findAll() { + return `This action returns all servicio`; + } + + findOne(id: number) { + return `This action returns a #${id} servicio`; + } + + update(id: number, updateServicioDto: UpdateServicioDto) { + return `This action updates a #${id} servicio`; + } + + remove(id: number) { + return `This action removes a #${id} servicio`; + } +} diff --git a/src/status/dto/create-status.dto.ts b/src/status/dto/create-status.dto.ts new file mode 100644 index 0000000..1144cbc --- /dev/null +++ b/src/status/dto/create-status.dto.ts @@ -0,0 +1 @@ +export class CreateStatusDto {} diff --git a/src/status/dto/update-status.dto.ts b/src/status/dto/update-status.dto.ts new file mode 100644 index 0000000..e6e049b --- /dev/null +++ b/src/status/dto/update-status.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateStatusDto } from './create-status.dto'; + +export class UpdateStatusDto extends PartialType(CreateStatusDto) {} diff --git a/src/status/entities/status.entity.ts b/src/status/entities/status.entity.ts new file mode 100644 index 0000000..b6a031c --- /dev/null +++ b/src/status/entities/status.entity.ts @@ -0,0 +1,19 @@ +import { CasoEspecial } from "src/caso-especial/entities/caso-especial.entity"; +import { Servicio } from "src/servicio/entities/servicio.entity"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; + + +@Entity('status') +export class Status { + @PrimaryGeneratedColumn() + idStatus: number; + + @Column({ type: 'varchar', length: 30 }) + status: string; + + @OneToMany(()=>Servicio, (servicio)=>servicio.status) + servicio:Servicio[]; + + @OneToMany(()=>CasoEspecial, (casoEspecial)=>casoEspecial.status) + casoEspecial:CasoEspecial[]; +} diff --git a/src/status/status.controller.ts b/src/status/status.controller.ts new file mode 100644 index 0000000..a6ed1ab --- /dev/null +++ b/src/status/status.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { StatusService } from './status.service'; +import { CreateStatusDto } from './dto/create-status.dto'; +import { UpdateStatusDto } from './dto/update-status.dto'; + +@Controller('status') +export class StatusController { + constructor(private readonly statusService: StatusService) {} + + @Post() + create(@Body() createStatusDto: CreateStatusDto) { + return this.statusService.create(createStatusDto); + } + + @Get() + findAll() { + return this.statusService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.statusService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateStatusDto: UpdateStatusDto) { + return this.statusService.update(+id, updateStatusDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.statusService.remove(+id); + } +} diff --git a/src/status/status.module.ts b/src/status/status.module.ts new file mode 100644 index 0000000..c0e6a62 --- /dev/null +++ b/src/status/status.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { StatusService } from './status.service'; +import { StatusController } from './status.controller'; + +@Module({ + controllers: [StatusController], + providers: [StatusService], +}) +export class StatusModule {} diff --git a/src/status/status.service.ts b/src/status/status.service.ts new file mode 100644 index 0000000..143b7f1 --- /dev/null +++ b/src/status/status.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateStatusDto } from './dto/create-status.dto'; +import { UpdateStatusDto } from './dto/update-status.dto'; + +@Injectable() +export class StatusService { + create(createStatusDto: CreateStatusDto) { + return 'This action adds a new status'; + } + + findAll() { + return `This action returns all status`; + } + + findOne(id: number) { + return `This action returns a #${id} status`; + } + + update(id: number, updateStatusDto: UpdateStatusDto) { + return `This action updates a #${id} status`; + } + + remove(id: number) { + return `This action removes a #${id} status`; + } +} diff --git a/src/tipo-usuario/dto/create-tipo-usuario.dto.ts b/src/tipo-usuario/dto/create-tipo-usuario.dto.ts new file mode 100644 index 0000000..58bbab8 --- /dev/null +++ b/src/tipo-usuario/dto/create-tipo-usuario.dto.ts @@ -0,0 +1 @@ +export class CreateTipoUsuarioDto {} diff --git a/src/tipo-usuario/dto/update-tipo-usuario.dto.ts b/src/tipo-usuario/dto/update-tipo-usuario.dto.ts new file mode 100644 index 0000000..e1426db --- /dev/null +++ b/src/tipo-usuario/dto/update-tipo-usuario.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateTipoUsuarioDto } from './create-tipo-usuario.dto'; + +export class UpdateTipoUsuarioDto extends PartialType(CreateTipoUsuarioDto) {} diff --git a/src/tipo-usuario/entities/tipo-usuario.entity.ts b/src/tipo-usuario/entities/tipo-usuario.entity.ts new file mode 100644 index 0000000..0ca669b --- /dev/null +++ b/src/tipo-usuario/entities/tipo-usuario.entity.ts @@ -0,0 +1,16 @@ +import { Usuario } from "src/usuario/entities/usuario.entity"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; + +@Entity('tipo_usuario') +export class TipoUsuario { + + @PrimaryGeneratedColumn() + idTipoUsuario: number; + + @Column({ type: 'varchar', length: 15 }) + tipoUsuario: string; + + @OneToMany(()=>Usuario, (usuario)=>usuario.tipoUsuario) + usuario:Usuario; + +} diff --git a/src/tipo-usuario/tipo-usuario.controller.ts b/src/tipo-usuario/tipo-usuario.controller.ts new file mode 100644 index 0000000..e0d1cb8 --- /dev/null +++ b/src/tipo-usuario/tipo-usuario.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { TipoUsuarioService } from './tipo-usuario.service'; +import { CreateTipoUsuarioDto } from './dto/create-tipo-usuario.dto'; +import { UpdateTipoUsuarioDto } from './dto/update-tipo-usuario.dto'; + +@Controller('tipo-usuario') +export class TipoUsuarioController { + constructor(private readonly tipoUsuarioService: TipoUsuarioService) {} + + @Post() + create(@Body() createTipoUsuarioDto: CreateTipoUsuarioDto) { + return this.tipoUsuarioService.create(createTipoUsuarioDto); + } + + @Get() + findAll() { + return this.tipoUsuarioService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.tipoUsuarioService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateTipoUsuarioDto: UpdateTipoUsuarioDto) { + return this.tipoUsuarioService.update(+id, updateTipoUsuarioDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.tipoUsuarioService.remove(+id); + } +} diff --git a/src/tipo-usuario/tipo-usuario.module.ts b/src/tipo-usuario/tipo-usuario.module.ts new file mode 100644 index 0000000..7cfdd59 --- /dev/null +++ b/src/tipo-usuario/tipo-usuario.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { TipoUsuarioService } from './tipo-usuario.service'; +import { TipoUsuarioController } from './tipo-usuario.controller'; + +@Module({ + controllers: [TipoUsuarioController], + providers: [TipoUsuarioService], +}) +export class TipoUsuarioModule {} diff --git a/src/tipo-usuario/tipo-usuario.service.ts b/src/tipo-usuario/tipo-usuario.service.ts new file mode 100644 index 0000000..807eebe --- /dev/null +++ b/src/tipo-usuario/tipo-usuario.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateTipoUsuarioDto } from './dto/create-tipo-usuario.dto'; +import { UpdateTipoUsuarioDto } from './dto/update-tipo-usuario.dto'; + +@Injectable() +export class TipoUsuarioService { + create(createTipoUsuarioDto: CreateTipoUsuarioDto) { + return 'This action adds a new tipoUsuario'; + } + + findAll() { + return `This action returns all tipoUsuario`; + } + + findOne(id: number) { + return `This action returns a #${id} tipoUsuario`; + } + + update(id: number, updateTipoUsuarioDto: UpdateTipoUsuarioDto) { + return `This action updates a #${id} tipoUsuario`; + } + + remove(id: number) { + return `This action removes a #${id} tipoUsuario`; + } +} diff --git a/src/usuario/dto/create-usuario.dto.ts b/src/usuario/dto/create-usuario.dto.ts new file mode 100644 index 0000000..d7960fe --- /dev/null +++ b/src/usuario/dto/create-usuario.dto.ts @@ -0,0 +1 @@ +export class CreateUsuarioDto {} diff --git a/src/usuario/dto/update-usuario.dto.ts b/src/usuario/dto/update-usuario.dto.ts new file mode 100644 index 0000000..a2b8fbc --- /dev/null +++ b/src/usuario/dto/update-usuario.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateUsuarioDto } from './create-usuario.dto'; + +export class UpdateUsuarioDto extends PartialType(CreateUsuarioDto) {} diff --git a/src/usuario/entities/usuario.entity.ts b/src/usuario/entities/usuario.entity.ts new file mode 100644 index 0000000..406f410 --- /dev/null +++ b/src/usuario/entities/usuario.entity.ts @@ -0,0 +1,38 @@ +import { CasoEspecial } from "src/caso-especial/entities/caso-especial.entity"; +import { Programa } from "src/programa/entities/programa.entity"; +import { Servicio } from "src/servicio/entities/servicio.entity"; +import { TipoUsuario } from "src/tipo-usuario/entities/tipo-usuario.entity"; +import { Column, Entity, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn, Unique } from "typeorm"; + +@Entity('usuario') +@Unique(['usuario']) +export class Usuario { + + @PrimaryGeneratedColumn() + idUsuario: number; + + @Column({ type: 'varchar', length: 100 }) + usuario: string; + + @Column({ type: 'varchar', length: 60, nullable: true, default: null }) + password: string | null; + + @Column({ type: 'varchar', length: 70, nullable: true, default: null }) + nombre: string | null; + + @Column({ type: 'boolean', default: true }) + activo: boolean; + + @ManyToOne(()=>TipoUsuario,(tipoUsuario)=>tipoUsuario.usuario) + tipoUsuario:TipoUsuario; + + @OneToMany(()=>CasoEspecial,(casoEspecial)=>casoEspecial.usuario) + casoEspecial:CasoEspecial[]; + + @OneToMany(()=>Programa,(programa)=>programa.usuario) + programa:Programa[]; + + @OneToMany(()=>Servicio,(servicio)=>servicio.usuario) + servicio:Servicio[]; + +} diff --git a/src/usuario/usuario.controller.ts b/src/usuario/usuario.controller.ts new file mode 100644 index 0000000..5b3b392 --- /dev/null +++ b/src/usuario/usuario.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { UsuarioService } from './usuario.service'; +import { CreateUsuarioDto } from './dto/create-usuario.dto'; +import { UpdateUsuarioDto } from './dto/update-usuario.dto'; + +@Controller('usuario') +export class UsuarioController { + constructor(private readonly usuarioService: UsuarioService) {} + + @Post() + create(@Body() createUsuarioDto: CreateUsuarioDto) { + return this.usuarioService.create(createUsuarioDto); + } + + @Get() + findAll() { + return this.usuarioService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.usuarioService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateUsuarioDto: UpdateUsuarioDto) { + return this.usuarioService.update(+id, updateUsuarioDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.usuarioService.remove(+id); + } +} diff --git a/src/usuario/usuario.module.ts b/src/usuario/usuario.module.ts new file mode 100644 index 0000000..100d41c --- /dev/null +++ b/src/usuario/usuario.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { UsuarioService } from './usuario.service'; +import { UsuarioController } from './usuario.controller'; + +@Module({ + controllers: [UsuarioController], + providers: [UsuarioService], +}) +export class UsuarioModule {} diff --git a/src/usuario/usuario.service.ts b/src/usuario/usuario.service.ts new file mode 100644 index 0000000..878b91d --- /dev/null +++ b/src/usuario/usuario.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateUsuarioDto } from './dto/create-usuario.dto'; +import { UpdateUsuarioDto } from './dto/update-usuario.dto'; + +@Injectable() +export class UsuarioService { + create(createUsuarioDto: CreateUsuarioDto) { + return 'This action adds a new usuario'; + } + + findAll() { + return `This action returns all usuario`; + } + + findOne(id: number) { + return `This action returns a #${id} usuario`; + } + + update(id: number, updateUsuarioDto: UpdateUsuarioDto) { + return `This action updates a #${id} usuario`; + } + + remove(id: number) { + return `This action removes a #${id} usuario`; + } +} diff --git a/src/validaciones/validacion.service.ts b/src/validaciones/validacion.service.ts new file mode 100644 index 0000000..1934732 --- /dev/null +++ b/src/validaciones/validacion.service.ts @@ -0,0 +1,172 @@ +import { Injectable } from "@nestjs/common"; +import { InjectRepository } from "@nestjs/typeorm"; +import moment from "moment"; +import { Servicio } from "src/servicio/entities/servicio.entity"; +import { Repository } from "typeorm"; +import validator from "validator"; + + +@Injectable() +export class ValidacionService { + constructor( + @InjectRepository(Servicio) + private servicioRepository:Repository, + ){} + + caracterEspecial(char) { + const charset = [' ', '.', ',', ':', ';', '?', '¿', '!', '¡', '(', ')', '"', "'", '-', '_', '/', '#', '%', '\n']; + return charset.includes(char); + } + + yaExiste(campo, m) { + throw new Error(`Ya se encuentra en uso ${m ? 'el' : 'la'} ${campo}.`); + } + + noValido(campo, m, razon) { + throw new Error(`${m ? 'El' : 'La'} ${campo} no es valid${m ? 'o' : 'a'}, ${razon}.`); + } + + noHay(variable, campo, m) { + if (!variable) throw new Error(`No se mando ${m ? 'el' : 'la'} ${campo}.`); + } + + validacionBasicaStr(texto, campo, m, length) { + this.noHay(texto, campo, m); + if (typeof texto !== 'string') this.noValido(campo, m, 'no se mando una string'); + if (length && texto.length > length) this.noValido(campo, m, 'tiene más caracteres de lo permitido'); + return texto; + } + + validarNumeroEntero(numero, campo, m = true) { + this.noHay(numero, campo, m); + if (typeof numero === 'number') numero = numero.toString(); + if (!validator.isNumeric(numero, { no_symbols: true })) this.noValido(campo, m, 'no es un número entero válido'); + return Number(numero); + } + + validarCorreo(correo, campo = 'correo', m = true, length) { + this.validacionBasicaStr(correo, campo, m, length); + if (!validator.isEmail(correo)) this.noValido(campo, m, 'no es un correo válido'); + return correo; + } + + validarTexto(texto, campo, m, length) { + this.validacionBasicaStr(texto, campo, m, length); + for (const char of texto) { + if (!validator.isAlpha(char, 'es-ES') && char !== ' ' && char !== '.') { + this.noValido(campo, m, 'contiene caracteres no válidos'); + } + } + return texto; + } + + validarAlfanumerico(texto, campo, m, length) { + this.validacionBasicaStr(texto, campo, m, length); + for (const char of texto) { + if (!this.caracterEspecial(char) && !validator.isAlphanumeric(char, 'es-ES')) { + this.noValido(campo, m, 'contiene caracteres no válidos'); + } + } + return texto; + } + + validarNumeroCuenta(numeroCuenta, campo = 'numero de cuenta', m = true) { + this.validacionBasicaStr(numeroCuenta, campo, m, 9); + if (!validator.isNumeric(numeroCuenta, { no_symbols: true })) { + this.noValido(campo, m, 'tiene caracteres que no son números'); + } + return numeroCuenta; + } + + validarFecha(fecha, campo, m) { + const fechaMoment = moment(fecha); + this.noHay(fecha, campo, m); + if (!fechaMoment.isValid()) this.noValido(campo, m, 'no es una fecha válida'); + return fechaMoment; + } + + validarNumero(numero, campo, m, length, no_symbols = true, makeNumber = false) { + this.validacionBasicaStr(numero, campo, m, length); + if (!validator.isNumeric(numero, { no_symbols })) { + this.noValido(campo, m, 'tiene caracteres que no son números'); + } + return makeNumber ? Number(numero) : numero; + } + + validarObjetoVacio(obj) { + return Object.keys(obj).length === 0; + } + + async validarPreTermino(idServicio) { + const res = await this.servicioRepository.findOne({ where: { idServicio } }); + + if ( + (res?.cuestionarioPrograma.idCuestionarioPrograma || res?.cuestionarioPrograma2.idCuestionarioPrograma2) && + (res.cuestionarioAlumno.idCuestionarioAlumno || res.cuestionarioAlumno2.idCuestionarioAlumno2) && + res.cartaTermino && + res.informeGlobal + ) { + await this.servicioRepository.update({ idServicio }, { status: {idStatus:5} }); + return 'Este Servicio Social pasó a Término, espera a que COESI autorice tu liberación.'; + } + return ''; + } + + validarCuestionarioAlumno2(body) { + const optionalKeys = ['p5', 'p8', 'p16', 'p18']; + if (Array.isArray(body.p1)) body.p1 = body.p1.join(', '); + + for (const [key, value] of Object.entries(body)) { + if (!optionalKeys.includes(key) && (value === null || value === undefined || value === '')) { + throw new Error(`El campo ${key} no puede estar vacío.`); + } + } + + const expectedKeys = [ + 'p1', 'p2', 'p4', 'p6', 'p7', 'p9', 'p13', 'p14', 'p15', + 'p3_1', 'p3_2', 'p3_3', 'p3_4', + 'p10_1', 'p10_2', 'p10_3', + 'p11_1', 'p11_2', 'p11_3', 'p11_4', + 'p17_1', 'p17_2', 'p17_3', + 'p12_A_1', 'p12_A_2', 'p12_A_3', 'p12_A_4', + 'p12_B_1', 'p12_B_2', 'p12_B_3', 'p12_B_4', + 'p12_C_1', 'p12_C_2', 'p12_C_3', 'p12_C_4', 'p12_C_5', + 'p12_D_1', 'p12_D_2', 'p12_D_3', 'p12_D_4', 'p12_D_5' + ]; + + for (const key of expectedKeys) { + if (!(key in body)) { + throw new Error(`Falta la respuesta para la pregunta ${key}.`); + } + } + + return body; + } + + validarCuestionarioPrograma2(body) { + const camposOpcionales = ['p6']; + if (Array.isArray(body.p1)) body.p1 = body.p1.join(', '); + + for (const [key, value] of Object.entries(body)) { + if (!camposOpcionales.includes(key) && (value === null || value === undefined || value === '')) { + throw new Error(`El campo ${key} no puede estar vacío.`); + } + } + + const expectedKeys = [ + 'p1', 'p2', 'p4', 'p5', + 'p3_A_1', 'p3_A_2', 'p3_A_3', 'p3_A_4', + 'p3_B_1', 'p3_B_2', 'p3_B_3', 'p3_B_4', + 'p3_C_1', 'p3_C_2', 'p3_C_3', 'p3_C_4', 'p3_C_5', + 'p3_D_1', 'p3_D_2', 'p3_D_3', 'p3_D_4', 'p3_D_5' + ]; + + for (const key of expectedKeys) { + if (!(key in body)) { + throw new Error(`Falta la respuesta para la pregunta ${key}.`); + } + } + + return body; + } +} \ No newline at end of file