diff --git a/.eslintrc.json b/.eslintrc.json index bffb357a..4de216d1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,24 @@ { - "extends": "next/core-web-vitals" + "env": { + "browser": true, + "es2021": true + }, + "extends": [ + "plugin:@typescript-eslint/recommended", + "next", + "next/core-web-vitals", + "prettier" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 12, + "sourceType": "module" + }, + "rules": { + "@typescript-eslint/no-explicit-any": "off" + }, + "plugins": ["@typescript-eslint"] } diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 807c8521..c71e63e4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,15 +1,15 @@ version: 2 updates: - - package-ecosystem: 'npm' - directory: '/' + - package-ecosystem: "npm" + directory: "/" target-branch: main schedule: - interval: 'weekly' + interval: "weekly" open-pull-requests-limit: 20 commit-message: - prefix: 'deps' - + prefix: "deps" + - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" \ No newline at end of file + interval: "weekly" diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..cc760e48 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + printWidth: 80, + semi: true, + singleQuote: true, + tabWidth: 2, + useTabs: false, +}; diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..31414458 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Next.js: debug server-side", + "type": "node-terminal", + "request": "launch", + "command": "yarn run dev" + }, + { + "name": "Next.js: debug client-side", + "type": "chrome", + "request": "launch", + "url": "http://localhost:3000" + }, + { + "name": "Next.js: debug full stack", + "type": "node-terminal", + "request": "launch", + "command": "yarn run dev", + "serverReadyAction": { + "pattern": "started server on .+, url: (https?://.+)", + "uriFormat": "%s", + "action": "debugWithChrome" + } + } + ] +} diff --git a/audit-ci.jsonc b/audit-ci.jsonc index 09dffc4f..7f0f7425 100644 --- a/audit-ci.jsonc +++ b/audit-ci.jsonc @@ -1,16 +1,16 @@ { - // audit-ci supports reading JSON, JSONC, and JSON5 config files. - // Add a $schema property to enable JSON schema validation. - "$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json", - // You only need one of ["low", "moderate", "high", "critical"]. - "low": true, - "allowlist": [ - { - "GHSA-9c47-m6qq-7p4h|eslint-plugin-import>tsconfig-paths>json5": { - "active": true, // This field is optional and defaults to true. - "expiry": "", // There's no need to set an expiry date because we are unaffected. - "notes": "Transitive development-only dependency for linting doesn't impact the security of this application in production or for developers." - } + // audit-ci supports reading JSON, JSONC, and JSON5 config files. + // Add a $schema property to enable JSON schema validation. + "$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json", + // You only need one of ["low", "moderate", "high", "critical"]. + "low": true, + "allowlist": [ + { + "GHSA-9c47-m6qq-7p4h|eslint-plugin-import>tsconfig-paths>json5": { + "active": true, // This field is optional and defaults to true. + "expiry": "", // There's no need to set an expiry date because we are unaffected. + "notes": "Transitive development-only dependency for linting doesn't impact the security of this application in production or for developers." } - ] - } + } + ] +} diff --git a/package.json b/package.json index e858481a..6ccae485 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "aws-amplify": "^5.1.4", "axios": "^1.4.0", "cookie": "^0.5.0", - "eslint": "8.35.0", + "eslint": "^8.40.0", "eslint-config-next": "13.2.3", "next": "13.2.3", "prop-types": ">=15.7.0", @@ -39,11 +39,17 @@ "yup": "0.32.11" }, "devDependencies": { - "@types/axios": "^0.14.0", "@types/cookie": "^0.5.1", "@types/node": "^18.16.3", "@types/react": "^18.2.1", "@types/react-dom": "^18.2.2", - "@types/react-google-recaptcha": "^2.1.5" + "@types/react-google-recaptcha": "^2.1.5", + "@typescript-eslint/eslint-plugin": "^5.59.5", + "@typescript-eslint/parser": "^5.59.5", + "eslint-config-prettier": "^8.8.0", + "eslint-import-resolver-typescript": "^3.5.5", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-prettier": "^4.2.1", + "prettier": ">=2.0.0" } } diff --git a/public/assets/forma.png b/public/assets/forma.png index d37a2f5a..b99d6dbb 100644 Binary files a/public/assets/forma.png and b/public/assets/forma.png differ diff --git a/public/assets/glass.png b/public/assets/glass.png index 2fe34da9..d9a2191e 100644 Binary files a/public/assets/glass.png and b/public/assets/glass.png differ diff --git a/public/assets/ladingChica.png b/public/assets/ladingChica.png deleted file mode 100644 index ca6b2899..00000000 Binary files a/public/assets/ladingChica.png and /dev/null differ diff --git a/public/assets/ladingChica2.png b/public/assets/ladingChica2.png deleted file mode 100644 index fc90b4e3..00000000 Binary files a/public/assets/ladingChica2.png and /dev/null differ diff --git a/public/assets/ladingHome.svg b/public/assets/ladingHome.svg deleted file mode 100644 index b57210e2..00000000 --- a/public/assets/ladingHome.svg +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/assets/landingChica.png b/public/assets/landingChica.png new file mode 100644 index 00000000..b3cad6e8 Binary files /dev/null and b/public/assets/landingChica.png differ diff --git a/public/assets/landingChica2.png b/public/assets/landingChica2.png new file mode 100644 index 00000000..44e98e12 Binary files /dev/null and b/public/assets/landingChica2.png differ diff --git a/public/assets/landingChico.png b/public/assets/landingChico.png new file mode 100644 index 00000000..19338c62 Binary files /dev/null and b/public/assets/landingChico.png differ diff --git a/public/assets/landingHome.svg b/public/assets/landingHome.svg new file mode 100644 index 00000000..954dcd53 --- /dev/null +++ b/public/assets/landingHome.svg @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/logoCuentaUnica.png b/public/assets/logoCuentaUnica.png index 727b12af..8183a0a5 100644 Binary files a/public/assets/logoCuentaUnica.png and b/public/assets/logoCuentaUnica.png differ diff --git a/public/assets/logoDedo.png b/public/assets/logoDedo.png index 00a1dd0e..be6a13dc 100644 Binary files a/public/assets/logoDedo.png and b/public/assets/logoDedo.png differ diff --git a/public/assets/logoGOB.png b/public/assets/logoGOB.png index a33c1a51..78679fa3 100644 Binary files a/public/assets/logoGOB.png and b/public/assets/logoGOB.png differ diff --git a/public/assets/logoOGTIC.png b/public/assets/logoOGTIC.png index fc0f91bf..d9ffe15c 100644 Binary files a/public/assets/logoOGTIC.png and b/public/assets/logoOGTIC.png differ diff --git a/public/assets/smile.png b/public/assets/smile.png index f7c99024..e99ad82a 100644 Binary files a/public/assets/smile.png and b/public/assets/smile.png differ diff --git a/public/assets/sun.png b/public/assets/sun.png index 8090d6b7..27a185d7 100644 Binary files a/public/assets/sun.png and b/public/assets/sun.png differ diff --git a/src/components/biometric/displayText.ts b/src/components/biometric/displayText.ts index 2d7cce2c..2f507e98 100644 --- a/src/components/biometric/displayText.ts +++ b/src/components/biometric/displayText.ts @@ -1,125 +1,128 @@ export type HintDisplayText = { - hintMoveFaceFrontOfCameraText?: string; - hintTooManyFacesText?: string; - hintFaceDetectedText?: string; - hintCanNotIdentifyText?: string; - hintTooCloseText?: string; - hintTooFarText?: string; - hintHoldFacePositionCountdownText?: string; - hintConnectingText?: string; - hintVerifyingText?: string; - hintIlluminationTooBrightText?: string; - hintIlluminationTooDarkText?: string; - hintIlluminationNormalText?: string; - hintHoldFaceForFreshnessText?: string; - }; - - export type CameraDisplayText = { - cameraMinSpecificationsHeadingText?: string; - cameraMinSpecificationsMessageText?: string; - cameraNotFoundHeadingText?: string; - cameraNotFoundMessageText?: string; - retryCameraPermissionsText?: string; - }; - - export type InstructionDisplayText = { - instructionsHeaderHeadingText?: string; - instructionsHeaderBodyText?: string; - instructionsBeginCheckText?: string; - photosensitivyWarningHeadingText?: string; - photosensitivyWarningBodyText?: string; - photosensitivyWarningInfoText?: string; - instructionListHeadingText?: string; - goodFitCaptionText?: string; - goodFitAltText?: string; - tooFarCaptionText?: string; - tooFarAltText?: string; - instructionListStepOneText?: string; - instructionListStepTwoText?: string; - instructionListStepThreeText?: string; - instructionListStepFourText?: string; - }; - - export type StreamDisplayText = { - recordingIndicatorText?: string; - cancelLivenessCheckText?: string; - }; - - export const defaultErrorDisplayText = { - timeoutHeaderText: 'Se acabó el tiempo', - timeoutMessageText: - "La cara no llenó el óvalo dentro del límite de tiempo. Vuelva a intentarlo y llene completamente el óvalo con la cara en 7 segundos.", - faceDistanceHeaderText: 'Comprobación fallida durante la cuenta atrás', - faceDistanceMessageText: - 'Evite acercarse durante la cuenta regresiva y asegúrese de que solo una cara esté frente a la cámara.', - clientHeaderText: 'Error del cliente', - clientMessageText: 'Verificación fallida debido a un problema con el cliente', - serverHeaderText: 'Problema del servidor', - serverMessageText: 'No se puede completar la verificación debido a un problema con el servidor', - landscapeHeaderText: 'Orientación horizontal no compatible', - landscapeMessageText: - 'Gire su dispositivo a la orientación vertical (retrato).', - portraitMessageText: - 'Asegúrese de que su dispositivo permanezca en orientación vertical (retrato) durante la verificación.', - tryAgainText: 'Intentar otra vez', - }; - - export type ErrorDisplayTextFoo = typeof defaultErrorDisplayText; - export type ErrorDisplayText = Partial; - - export const defaultLivenessDisplayText: Required = { - instructionsHeaderHeadingText: 'Liveness check', - instructionsHeaderBodyText: - 'You will go through a face verification process to prove that you are a real person.', - instructionsBeginCheckText: 'Begin check', - photosensitivyWarningHeadingText: 'Photosensitivity warning', - photosensitivyWarningBodyText: - 'This check displays colored lights. Use caution if you are photosensitive.', - photosensitivyWarningInfoText: - 'A small percentage of individuals may experience epileptic seizures when exposed to colored lights. Use caution if you, or anyone in your family, have an epileptic condition.', - instructionListHeadingText: 'Follow the instructions to complete the check:', - goodFitCaptionText: 'Good fit', - goodFitAltText: - "Ilustration of a person's face, perfectly fitting inside of an oval.", - tooFarCaptionText: 'Too far', - tooFarAltText: - "Illustration of a person's face inside of an oval; there is a gap between the perimeter of the face and the boundaries of the oval.", - instructionListStepOneText: - 'When an oval appears, fill the oval with your face within 7 seconds.', - instructionListStepTwoText: "Maximize your screen's brightness.", - instructionListStepThreeText: - 'Make sure your face is not covered with sunglasses or a mask.', - instructionListStepFourText: - 'Move to a well-lit place that is not in direct sunlight.', - cameraMinSpecificationsHeadingText: - 'Camera does not meet minimum specifications', - cameraMinSpecificationsMessageText: - 'Camera must support at least 320*240 resolution and 15 frames per second.', - cameraNotFoundHeadingText: 'Camera not accessible.', - cameraNotFoundMessageText: - 'Verifique que la cámara esté conectada y que los permisos de la cámara estén habilitados en la configuración antes de volver a intentarlo.', - retryCameraPermissionsText: 'Procesar de nuevo', - cancelLivenessCheckText: 'Cancelar comprobación de vitalidad', - recordingIndicatorText: 'Grabación', - hintMoveFaceFrontOfCameraText: 'Mover la cara frente a la cámara', - hintTooManyFacesText: 'Asegúrese de que solo una cara esté frente a la cámara', - hintFaceDetectedText: 'Cara detectada', - hintCanNotIdentifyText: 'Mover la cara frente a la cámara', - hintTooCloseText: 'Muévete mas atrás', - hintTooFarText: 'Muévete mas cerca', - hintHoldFacePositionCountdownText: 'Mantener la posición de la cara durante la cuenta regresiva', - hintConnectingText: 'Conectando...', - hintVerifyingText: 'Verificando...', - hintIlluminationTooBrightText: 'Mover al área de atenuación', - hintIlluminationTooDarkText: 'Mover a un área más brillante', - hintIlluminationNormalText: 'Condiciones de iluminación normales', - hintHoldFaceForFreshnessText: 'Quédate quieto', - ...defaultErrorDisplayText, - }; - - export interface LivenessDisplayText - extends HintDisplayText, - CameraDisplayText, - InstructionDisplayText, - ErrorDisplayText, - StreamDisplayText {} \ No newline at end of file + hintMoveFaceFrontOfCameraText?: string; + hintTooManyFacesText?: string; + hintFaceDetectedText?: string; + hintCanNotIdentifyText?: string; + hintTooCloseText?: string; + hintTooFarText?: string; + hintHoldFacePositionCountdownText?: string; + hintConnectingText?: string; + hintVerifyingText?: string; + hintIlluminationTooBrightText?: string; + hintIlluminationTooDarkText?: string; + hintIlluminationNormalText?: string; + hintHoldFaceForFreshnessText?: string; +}; + +export type CameraDisplayText = { + cameraMinSpecificationsHeadingText?: string; + cameraMinSpecificationsMessageText?: string; + cameraNotFoundHeadingText?: string; + cameraNotFoundMessageText?: string; + retryCameraPermissionsText?: string; +}; + +export type InstructionDisplayText = { + instructionsHeaderHeadingText?: string; + instructionsHeaderBodyText?: string; + instructionsBeginCheckText?: string; + photosensitivyWarningHeadingText?: string; + photosensitivyWarningBodyText?: string; + photosensitivyWarningInfoText?: string; + instructionListHeadingText?: string; + goodFitCaptionText?: string; + goodFitAltText?: string; + tooFarCaptionText?: string; + tooFarAltText?: string; + instructionListStepOneText?: string; + instructionListStepTwoText?: string; + instructionListStepThreeText?: string; + instructionListStepFourText?: string; +}; + +export type StreamDisplayText = { + recordingIndicatorText?: string; + cancelLivenessCheckText?: string; +}; + +export const defaultErrorDisplayText = { + timeoutHeaderText: 'Se acabó el tiempo', + timeoutMessageText: + 'La cara no llenó el óvalo dentro del límite de tiempo. Vuelva a intentarlo y llene completamente el óvalo con la cara en 7 segundos.', + faceDistanceHeaderText: 'Comprobación fallida durante la cuenta atrás', + faceDistanceMessageText: + 'Evite acercarse durante la cuenta regresiva y asegúrese de que solo una cara esté frente a la cámara.', + clientHeaderText: 'Error del cliente', + clientMessageText: 'Verificación fallida debido a un problema con el cliente', + serverHeaderText: 'Problema del servidor', + serverMessageText: + 'No se puede completar la verificación debido a un problema con el servidor', + landscapeHeaderText: 'Orientación horizontal no compatible', + landscapeMessageText: + 'Gire su dispositivo a la orientación vertical (retrato).', + portraitMessageText: + 'Asegúrese de que su dispositivo permanezca en orientación vertical (retrato) durante la verificación.', + tryAgainText: 'Intentar otra vez', +}; + +export type ErrorDisplayTextFoo = typeof defaultErrorDisplayText; +export type ErrorDisplayText = Partial; + +export const defaultLivenessDisplayText: Required = { + instructionsHeaderHeadingText: 'Liveness check', + instructionsHeaderBodyText: + 'You will go through a face verification process to prove that you are a real person.', + instructionsBeginCheckText: 'Begin check', + photosensitivyWarningHeadingText: 'Photosensitivity warning', + photosensitivyWarningBodyText: + 'This check displays colored lights. Use caution if you are photosensitive.', + photosensitivyWarningInfoText: + 'A small percentage of individuals may experience epileptic seizures when exposed to colored lights. Use caution if you, or anyone in your family, have an epileptic condition.', + instructionListHeadingText: 'Follow the instructions to complete the check:', + goodFitCaptionText: 'Good fit', + goodFitAltText: + "Ilustration of a person's face, perfectly fitting inside of an oval.", + tooFarCaptionText: 'Too far', + tooFarAltText: + "Illustration of a person's face inside of an oval; there is a gap between the perimeter of the face and the boundaries of the oval.", + instructionListStepOneText: + 'When an oval appears, fill the oval with your face within 7 seconds.', + instructionListStepTwoText: "Maximize your screen's brightness.", + instructionListStepThreeText: + 'Make sure your face is not covered with sunglasses or a mask.', + instructionListStepFourText: + 'Move to a well-lit place that is not in direct sunlight.', + cameraMinSpecificationsHeadingText: + 'Camera does not meet minimum specifications', + cameraMinSpecificationsMessageText: + 'Camera must support at least 320*240 resolution and 15 frames per second.', + cameraNotFoundHeadingText: 'Camera not accessible.', + cameraNotFoundMessageText: + 'Verifique que la cámara esté conectada y que los permisos de la cámara estén habilitados en la configuración antes de volver a intentarlo.', + retryCameraPermissionsText: 'Procesar de nuevo', + cancelLivenessCheckText: 'Cancelar comprobación de vitalidad', + recordingIndicatorText: 'Grabación', + hintMoveFaceFrontOfCameraText: 'Mover la cara frente a la cámara', + hintTooManyFacesText: + 'Asegúrese de que solo una cara esté frente a la cámara', + hintFaceDetectedText: 'Cara detectada', + hintCanNotIdentifyText: 'Mover la cara frente a la cámara', + hintTooCloseText: 'Muévete mas atrás', + hintTooFarText: 'Muévete mas cerca', + hintHoldFacePositionCountdownText: + 'Mantener la posición de la cara durante la cuenta regresiva', + hintConnectingText: 'Conectando...', + hintVerifyingText: 'Verificando...', + hintIlluminationTooBrightText: 'Mover al área de atenuación', + hintIlluminationTooDarkText: 'Mover a un área más brillante', + hintIlluminationNormalText: 'Condiciones de iluminación normales', + hintHoldFaceForFreshnessText: 'Quédate quieto', + ...defaultErrorDisplayText, +}; + +export interface LivenessDisplayText + extends HintDisplayText, + CameraDisplayText, + InstructionDisplayText, + ErrorDisplayText, + StreamDisplayText {} diff --git a/src/components/biometric/face-liveness-detector.tsx b/src/components/biometric/face-liveness-detector.tsx index 34ca948d..d4a1ef5c 100644 --- a/src/components/biometric/face-liveness-detector.tsx +++ b/src/components/biometric/face-liveness-detector.tsx @@ -1,21 +1,18 @@ -import { FaceLivenessDetector } from "@aws-amplify/ui-react-liveness"; -import { ThemeProvider } from "@aws-amplify/ui-react"; -import React from "react"; -import { LoadingProgress } from "../elements/loading"; -import { AlertErrorMessage } from "../elements/alert"; -import { View, Heading, Alert, Card, Text } from '@aws-amplify/ui-react'; -import { defaultLivenessDisplayText } from './displayText' +import { FaceLivenessDetector } from '@aws-amplify/ui-react-liveness'; +import { Loader, ThemeProvider } from '@aws-amplify/ui-react'; +import { useState, useEffect } from 'react'; +import { defaultLivenessDisplayText } from './displayText'; export function LivenessQuickStartReact({ handleNextForm, cedula }: any) { const next = handleNextForm; const id = cedula; - const [loading, setLoading] = React.useState(true); - const [error, setError] = React.useState(false); - const [sessionId, setSessionId] = React.useState(""); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(false); + const [sessionId, setSessionId] = useState(''); - React.useEffect(() => { + useEffect(() => { const fetchCreateLiveness = async () => { - const response = await fetch(`/api/biometric`, { method: "POST" }); + const response = await fetch(`/api/biometric`, { method: 'POST' }); const { sessionId } = await response.json(); setSessionId(sessionId); @@ -25,132 +22,38 @@ export function LivenessQuickStartReact({ handleNextForm, cedula }: any) { fetchCreateLiveness(); }, []); + const onUserCancel = () => { + setSessionId(''); + setError(false); + }; + const handleAnalysisComplete = async () => { const response = await fetch( `/api/biometric?sessionId=${sessionId}&cedula=${id}` ); const data = await response.json(); - if (data.match) { + if (data.match === true) { next(); } else { - setError(true); + setError(error); } }; - // const dictionary = { - // // use default strings for english - // en: null, - // es: { - // instructionsHeaderHeadingText: 'Verificación de vida', - // instructionsHeaderBodyText: - // 'Pasará por un proceso de verificación facial para demostrar que es una persona real.', - // instructionListStepOneText: - // 'Cuando aparezca un óvalo, rellena el óvalo con tu cara en 7 segundos.', - // instructionListStepTwoText: 'Maximiza el brillo de tu pantalla.', - // instructionListStepThreeText: - // 'Asegúrese de que su cara no esté cubierta con gafas de sol o una máscara.', - // instructionListStepFourText: - // 'Muévase a un lugar bien iluminado que no esté expuesto a la luz solar directa.', - // photosensitivyWarningHeadingText: 'Advertencia de fotosensibilidad', - // photosensitivyWarningBodyText: - // 'Esta verificación muestra luces de colores. Tenga cuidado si es fotosensible.', - // instructionListHeadingText: - // 'Siga las instrucciones para completar la verificación:', - // goodFitCaptionText: 'Buen ajuste', - // tooFarCaptionText: 'Demasiado lejos', - // }, - // }; - return ( - <> - {error && - + {loading ? ( + + ) : ( + - } -
- - {loading ? ( - - ) : ( - { - // return ( - // <> - // asd - // - // // - // // asd - // // - // // Yasdasd - // // - // // - // ); - // }, - // PhotosensitiveWarning: (): JSX.Element => { - // return ( - // <> - // asd - // - // // - // // asdasd - // // - // ); - // }, - // Instructions: (): JSX.Element => { - // return ( - // <> - // asd - // - // // - // // asdasd - // //
    - // //
  1. - // // asdasdasdmask. - // //
  2. - // //
  3. - // // Moasdasdas - // //
  4. - // //
  5. - // // Fill oasdasdasdasdasdold for colored lights. - // //
  6. - // //
- // //
- // ); - // }, - // ErrorView: ({ children } : any) => { - // return ( - // <> - //
- // - // {/* - // adasdsd - // {children} - // asdsd - // */} - // - // ); - // }, - // }} - /> - )} -
- + )} + ); } diff --git a/src/components/elements/alert/index.tsx b/src/components/elements/alert/index.tsx index 58fbcefb..b7b8c9aa 100644 --- a/src/components/elements/alert/index.tsx +++ b/src/components/elements/alert/index.tsx @@ -1,41 +1,39 @@ -import Swal from "sweetalert2"; +import Swal from 'sweetalert2'; import Alert from '@mui/material/Alert'; interface IPropsAlertErrorMessage { message: string; - type: "error" | "warning" | "info" | "success" -} - interface IProps { - text?: string; + type: 'error' | 'warning' | 'info' | 'success'; } -export const AlertErrorMessage = ({message, type}: IPropsAlertErrorMessage) => ( - {message} -) +export const AlertErrorMessage = ({ + message, + type, +}: IPropsAlertErrorMessage) => {message}; - export const AlertError = (text?: string) => { +export const AlertError = (text?: string) => { return Swal.fire({ - icon: "error", - title: "Error", - text: text ? text : "Ocurrió un error al procesar la solicitud", - confirmButtonColor: "#003670", + icon: 'error', + title: 'Error', + text: text ? text : 'Ocurrió un error al procesar la solicitud', + confirmButtonColor: '#003670', }); }; export const AlertWarning = (text: string) => { return Swal.fire({ - icon: "warning", - title: "Aviso", + icon: 'warning', + title: 'Aviso', text: text, - confirmButtonColor: "#003670", + confirmButtonColor: '#003670', }); }; export const AlertSuccess = (text?: string) => { return Swal.fire({ - icon: "success", - title: "Correcto", - text: text ? text : "Proceso realizado correctamente", - confirmButtonColor: "#003670", + icon: 'success', + title: 'Correcto', + text: text ? text : 'Proceso realizado correctamente', + confirmButtonColor: '#003670', }); }; diff --git a/src/components/elements/boxContentCenter/index.tsx b/src/components/elements/boxContentCenter/index.tsx index 5fbde208..0c757934 100644 --- a/src/components/elements/boxContentCenter/index.tsx +++ b/src/components/elements/boxContentCenter/index.tsx @@ -11,7 +11,9 @@ export default function BoxContentCenter({ children }: any) { alignItems: "center", }} > - {children} + + {children} + ); } diff --git a/src/components/elements/cardAuth/index.tsx b/src/components/elements/cardAuth/index.tsx index 6d2da7b1..4683fe0b 100644 --- a/src/components/elements/cardAuth/index.tsx +++ b/src/components/elements/cardAuth/index.tsx @@ -10,22 +10,22 @@ export const CardAuth = ({ subTitle, subTitle2, children, - lading, - ladingWidth, - ladingHeight, + landing, + landingWidth, + landingHeight, icon, }: any) => { return (
- {lading && ( + {landing && (
Lading
)} diff --git a/src/components/elements/loading/index.tsx b/src/components/elements/loading/index.tsx index 15e0c12d..74205b58 100644 --- a/src/components/elements/loading/index.tsx +++ b/src/components/elements/loading/index.tsx @@ -1,10 +1,10 @@ -import CircularProgress from '@mui/material/CircularProgress'; -import Box from '@mui/material/Box'; +import CircularProgress from "@mui/material/CircularProgress"; +import Box from "@mui/material/Box"; export const LoadingProgress = () => { return ( - - + + ); -} \ No newline at end of file +}; diff --git a/src/components/elements/loadingBackdrop/index.tsx b/src/components/elements/loadingBackdrop/index.tsx index b487efa4..db3bbe9a 100644 --- a/src/components/elements/loadingBackdrop/index.tsx +++ b/src/components/elements/loadingBackdrop/index.tsx @@ -1,21 +1,21 @@ -import * as React from "react"; -import Backdrop from "@mui/material/Backdrop"; -import CircularProgress from "@mui/material/CircularProgress"; -import { Typography } from "@mui/material"; +import * as React from 'react'; +import Backdrop from '@mui/material/Backdrop'; +import CircularProgress from '@mui/material/CircularProgress'; +import { Typography } from '@mui/material'; interface IProps { text?: string; } export default function LoadingBackdrop({ text }: IProps) { - const [open, setOpen] = React.useState(true); + const [open] = React.useState(true); return ( theme.zIndex.modal + 1 }} + sx={{ color: '#fff', zIndex: (theme) => theme.zIndex.modal + 1 }} open={open} > -
+
{text && {text}}
diff --git a/src/components/form/input/index.tsx b/src/components/form/input/index.tsx index 436a81ec..128f8e65 100644 --- a/src/components/form/input/index.tsx +++ b/src/components/form/input/index.tsx @@ -1,11 +1,11 @@ -import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined'; +import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined"; import Tooltip, { TooltipProps, tooltipClasses } from "@mui/material/Tooltip"; import { FormControl, InputLabel, Typography } from "@mui/material"; import { styled } from "@mui/material/styles"; import { IconButton } from "@mui/material"; interface IProps { - label?: String; + label?: string; icon?: any; msg?: string; required?: boolean; @@ -39,7 +39,18 @@ export const FormControlApp = (props: IProps) => { error={props.msg ? true : false} shrink={true} > - {props.label} {props.required && "*"} {props.icon} + {props.label}{" "} + + {props.required && "*"} + {" "} + {props.icon} {props.tooltip && ( { } > - + diff --git a/src/components/layout/footer.tsx b/src/components/layout/footer.tsx index 89f03f9d..930c7767 100644 --- a/src/components/layout/footer.tsx +++ b/src/components/layout/footer.tsx @@ -14,7 +14,14 @@ export default function Index() { return ( <>
-
+
@@ -78,7 +85,14 @@ export default function Index() {
-
+
diff --git a/src/components/layout/navBar.tsx b/src/components/layout/navBar.tsx index 3e602cf7..9e8076ed 100644 --- a/src/components/layout/navBar.tsx +++ b/src/components/layout/navBar.tsx @@ -1,13 +1,12 @@ -import AppsIcon from "@mui/icons-material/Apps"; -import AppBar from "@mui/material/AppBar"; -import Toolbar from "@mui/material/Toolbar"; -import Box from "@mui/material/Box"; -import Script from "next/script"; -import Image from "next/image"; -import Link from "next/link"; +import AppsIcon from '@mui/icons-material/Apps'; +import AppBar from '@mui/material/AppBar'; +import Toolbar from '@mui/material/Toolbar'; +import Box from '@mui/material/Box'; +import Script from 'next/script'; +import Image from 'next/image'; +import Link from 'next/link'; -import Logo from "../../../public/assets/logo.png"; -import { routes } from "@/constants/routes"; +import Logo from '../../../public/assets/logo.png'; export default function Index() { return ( @@ -19,16 +18,20 @@ export default function Index() { -
- -
- +
+ +
+ logo
-
-
+ +
diff --git a/src/constants/labels.ts b/src/constants/labels.ts index a64e29a7..5c58b0f9 100644 --- a/src/constants/labels.ts +++ b/src/constants/labels.ts @@ -1,12 +1,12 @@ export const labels = { form: { - requiredField: "Campo requerido", - requiredEmail: "El Correo Electrónico es obligatorio", - invalidEmail: "El Correo Electrónico no es válido", + requiredField: 'Campo requerido', + requiredEmail: 'El Correo Electrónico es obligatorio', + invalidEmail: 'El Correo Electrónico no es válido', }, select: { - select: "Sin Seleccionar", - selectFilters: "Todos(as)", - inputRequired: "Campo requerido", + select: 'Sin Seleccionar', + selectFilters: 'Todos(as)', + inputRequired: 'Campo requerido', }, }; diff --git a/src/constants/routes.ts b/src/constants/routes.ts index 59bf2f26..512c07c4 100644 --- a/src/constants/routes.ts +++ b/src/constants/routes.ts @@ -1,12 +1,12 @@ export const routes = { auth: { - home: "/", - password: "auth/password", - method: "method", + home: '/', + password: 'auth/password', + method: 'method', }, register: { - home: "register", - confirmation: "register/confirmation", - registered: "register/registered", + home: 'register', + confirmation: 'register/confirmation', + registered: 'register/registered', }, }; diff --git a/src/helpers/index.ts b/src/helpers/index.ts index 9de9c997..c95fe023 100644 --- a/src/helpers/index.ts +++ b/src/helpers/index.ts @@ -1,2 +1 @@ -export { validateSameSiteRequest } from "./same-site-validator"; -export { getRekognitionClient } from "./rekognition"; +export { getRekognitionClient } from './rekognition'; diff --git a/src/helpers/rekognition.ts b/src/helpers/rekognition.ts index 6c246630..596f2a41 100644 --- a/src/helpers/rekognition.ts +++ b/src/helpers/rekognition.ts @@ -1,21 +1,19 @@ -import { Rekognition } from "@aws-sdk/client-rekognition"; -import { Amplify, withSSRContext } from "aws-amplify"; -import { NextApiRequest } from "next/types"; +import { RekognitionClient } from '@aws-sdk/client-rekognition'; +import { Amplify, withSSRContext } from 'aws-amplify'; +import { NextApiRequest } from 'next/types'; -import awsExports from "../aws-exports"; +import awsExports from '../aws-exports'; Amplify.configure({ ...awsExports, ssr: true }); export async function getRekognitionClient( req: NextApiRequest -): Promise { - const { Credentials } = withSSRContext({ req }); - const credentials = await Credentials.get(); - const endpoint = "https://rekognition.us-east-1.amazonaws.com"; +): Promise { + const SSR = withSSRContext({ req }); + const credentials = await SSR.Credentials.get(); - return new Rekognition({ - region: "us-east-1", + return new RekognitionClient({ + region: awsExports.aws_project_region, credentials, - endpoint, }); } diff --git a/src/helpers/same-site-validator.ts b/src/helpers/same-site-validator.ts deleted file mode 100644 index d987f57d..00000000 --- a/src/helpers/same-site-validator.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IncomingHttpHeaders } from "node:http"; - -export function validateSameSiteRequest(headers: IncomingHttpHeaders) { - const fetchHeaderKey = "sec-fetch-site"; - const fetchHeaderValue = "same-origin"; - - return ( - headers[fetchHeaderKey] && headers[fetchHeaderKey] === fetchHeaderValue - ); -} diff --git a/src/models/challenge-response.ts b/src/models/challenge-response.ts index 0fcbdda1..c3617c96 100644 --- a/src/models/challenge-response.ts +++ b/src/models/challenge-response.ts @@ -16,8 +16,8 @@ export class Challenge { !this.sign?.PINKY ) { return { - text: "Muestra tu mano cerrada", - image: "fist", + text: 'Muestra tu mano cerrada', + image: 'fist', }; } @@ -29,8 +29,8 @@ export class Challenge { !this.sign?.PINKY ) { return { - text: "Muestra tu pulgar", - image: "thumb", + text: 'Muestra tu pulgar', + image: 'thumb', }; } @@ -42,8 +42,8 @@ export class Challenge { !this.sign?.PINKY ) { return { - text: "Muestra dos dedos", - image: "two-fingers", + text: 'Muestra dos dedos', + image: 'two-fingers', }; } @@ -55,8 +55,8 @@ export class Challenge { !this.sign?.PINKY ) { return { - text: "Muestra tres dedos", - image: "three-fingers", + text: 'Muestra tres dedos', + image: 'three-fingers', }; } @@ -68,8 +68,8 @@ export class Challenge { this.sign?.PINKY ) { return { - text: "Muestra tu mano abierta", - image: "open-hand", + text: 'Muestra tu mano abierta', + image: 'open-hand', }; } diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 72f85496..8069c35c 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,15 +1,15 @@ -import CssBaseline from "@mui/material/CssBaseline"; -import { ThemeProvider } from "@mui/material/styles"; -import type { AppProps } from "next/app"; -import { Amplify } from "aws-amplify"; -import Head from "next/head"; +import CssBaseline from '@mui/material/CssBaseline'; +import { ThemeProvider } from '@mui/material/styles'; +import type { AppProps } from 'next/app'; +import { Amplify } from 'aws-amplify'; +import Head from 'next/head'; -import Layout from "../components/layout"; -import awsExports from "../aws-exports"; -import { theme } from "../themes"; +import Layout from '../components/layout'; +import awsExports from '../aws-exports'; +import { theme } from '../themes'; -import "@aws-amplify/ui-react/styles.css"; -import "@/styles/globals.css"; +import '@aws-amplify/ui-react/styles.css'; +import '@/styles/globals.css'; Amplify.configure(awsExports); diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index e82cb215..367fe2be 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -1,4 +1,4 @@ -import { Html, Head, Main, NextScript } from "next/document"; +import { Html, Head, Main, NextScript } from 'next/document'; export default function Document() { return ( diff --git a/src/pages/api/auth/index.ts b/src/pages/api/auth/index.ts index 0b7b7c2f..c8f2788a 100644 --- a/src/pages/api/auth/index.ts +++ b/src/pages/api/auth/index.ts @@ -1,18 +1,18 @@ -import { NextApiRequest, NextApiResponse } from "next/types"; -import cookie from "cookie"; +import { NextApiRequest, NextApiResponse } from 'next/types'; +import cookie from 'cookie'; export default async function handler( req: NextApiRequest, res: NextApiResponse ): Promise { res.setHeader( - "Set-cookie", - cookie.serialize("token", process.env.NEXT_PUBLIC_COOKIE_KEY as string, { + 'Set-cookie', + cookie.serialize('token', process.env.NEXT_PUBLIC_COOKIE_KEY as string, { httpOnly: true, secure: true, maxAge: 60 * 60 * 10, - sameSite: "strict", - path: "/", + sameSite: 'strict', + path: '/', }) ); diff --git a/src/pages/api/biometric/index.ts b/src/pages/api/biometric/index.ts index d3f28b08..126044aa 100644 --- a/src/pages/api/biometric/index.ts +++ b/src/pages/api/biometric/index.ts @@ -1,7 +1,12 @@ -import { NextApiRequest, NextApiResponse } from "next/types"; -import axios from "axios"; +import { NextApiRequest, NextApiResponse } from 'next/types'; +import axios from 'axios'; -import { getRekognitionClient } from "@/helpers"; +import { getRekognitionClient } from '@/helpers'; +import { + GetFaceLivenessSessionResultsCommand, + CompareFacesCommand, + CreateFaceLivenessSessionCommand, +} from '@aws-sdk/client-rekognition'; export default async function handler( req: NextApiRequest, @@ -17,65 +22,73 @@ export default async function handler( baseURL: process.env.NEXT_PUBLIC_PHOTO_API, }); - const rekognition = await getRekognitionClient(req); + const client = await getRekognitionClient(req); - if (req.method === "GET") { + if (req.method === 'GET') { const { sessionId, cedula } = req.query; const SessionId = sessionId as string; - const response = await rekognition.getFaceLivenessSessionResults({ + const command = new GetFaceLivenessSessionResultsCommand({ SessionId, }); + const response = await client.send(command); - let isLive: any; - let base64Image: string = ""; - let result: any; + let isLive; if (response.Confidence) { isLive = response.Confidence > 90; } - if (response.ReferenceImage && response.ReferenceImage.Bytes) { - base64Image = response.ReferenceImage.Bytes.toString(); - + if (isLive && response.ReferenceImage && response.ReferenceImage.Bytes) { const { data } = await http.get(`/${cedula}/photo`, { params: { - "api-key": process.env.NEXT_PUBLIC_PHOTO_API_KEY, + 'api-key': process.env.NEXT_PUBLIC_PHOTO_API_KEY, }, - responseType: "arraybuffer", + responseType: 'arraybuffer', }); + const buffer1 = Buffer.from(response.ReferenceImage.Bytes); + const buffer2 = Buffer.from(data, 'base64'); + const params = { + SourceImage: { + Bytes: buffer1, + }, + TargetImage: { + Bytes: buffer2, + }, + SimilarityThreshold: 90, + }; + + const command = new CompareFacesCommand(params); + let similarPercent = 0; + try { - result = await rekognition.compareFaces({ - SimilarityThreshold: 80, - TargetImage: { - Bytes: data, - }, - SourceImage: { - Bytes: response.ReferenceImage.Bytes, - }, - }); - } catch (ex) { + const compare = await client.send(command); + if (compare.FaceMatches && compare.FaceMatches.length) { + compare.FaceMatches.forEach((data) => { + similarPercent = data.Similarity as number; + }); + + if (similarPercent > 90) { + console.log( + `Biometry validation successfully for citizen ${cedula}` + ); + res.status(200).end(JSON.stringify({ match: true })); + } else { + console.log(`Biometry validation failed for citizen ${cedula}`); + res.status(200).end(JSON.stringify({ match: false })); + } + } + } catch (error) { console.log(`Biometry validation failed for citizen ${cedula}`); - - return res.status(500).json({ - success: false, - }); + res.status(500).end(); } } - - const { FaceMatches } = result; - const isFaceMatched = - FaceMatches && FaceMatches.length && FaceMatches[0].Similarity > 90; - - console.log(`Biometry validation successfully for citizen ${cedula}`); - - return res.status(200).json({ - match: isFaceMatched, + } else if (req.method === 'POST') { + const command = new CreateFaceLivenessSessionCommand({ + ClientRequestToken: req.cookies.token, }); - } else if (req.method === "POST") { - const { SessionId: sessionId } = - await rekognition.createFaceLivenessSession({}); + const { SessionId: sessionId } = await client.send(command); return res.status(201).json({ sessionId }); } diff --git a/src/pages/api/citizens/[cedula].ts b/src/pages/api/citizens/[cedula].ts index ce4b6541..e770ad4e 100644 --- a/src/pages/api/citizens/[cedula].ts +++ b/src/pages/api/citizens/[cedula].ts @@ -1,7 +1,7 @@ -import { NextApiRequest, NextApiResponse } from "next/types"; -import axios from "axios"; +import { NextApiRequest, NextApiResponse } from 'next/types'; +import axios from 'axios'; -import { CitizensBasicInformationResponse } from "../types"; +import { CitizensBasicInformationResponse } from '../types'; export default async function handler( req: NextApiRequest, @@ -23,8 +23,8 @@ export default async function handler( `/${cedula}/info/basic?api-key=${process.env.NEXT_PUBLIC_CEDULA_API_KEY}` ); - let { names, id } = citizen.payload; - const name = names.split(" ")[0]; + const { names, id } = citizen.payload; + const name = names.split(' ')[0]; res.status(200).json({ name, id }); } diff --git a/src/pages/api/iam/index.ts b/src/pages/api/iam/index.ts index d015856b..66ff8175 100644 --- a/src/pages/api/iam/index.ts +++ b/src/pages/api/iam/index.ts @@ -1,10 +1,10 @@ -import { NextApiRequest, NextApiResponse } from "next/types"; -import axios, { AxiosError } from "axios"; +import { NextApiRequest, NextApiResponse } from 'next/types'; +import axios, { AxiosError } from 'axios'; import { CitizensBasicInformationResponse, VerifyIamUserResponse, -} from "../types"; +} from '../types'; export default async function handler( req: NextApiRequest, @@ -20,19 +20,19 @@ export default async function handler( baseURL: process.env.NEXT_PUBLIC_IAM_API, }); - if (req.method === "GET") { + if (req.method === 'GET') { const { cedula } = req.query; const { data } = await http.get( `/auth/validations/users/existence?username=${cedula}` ); return res.status(200).json(data); - } else if (req.method === "POST") { + } else if (req.method === 'POST') { const { body } = req; const { username, email, password } = body; - let success: boolean = true; - let statusCode: number = 201; + let success = true; + let statusCode = 201; const { data: citizen } = await axios.get( `${process.env.NEXT_PUBLIC_CEDULA_API}/${username}/info/basic?api-key=${process.env.NEXT_PUBLIC_CEDULA_API_KEY}` diff --git a/src/pages/api/types/index.ts b/src/pages/api/types/index.ts index bc5484ec..0dbe29e3 100644 --- a/src/pages/api/types/index.ts +++ b/src/pages/api/types/index.ts @@ -3,7 +3,7 @@ export type CitizenBasicInformation = { names: string; firstSurname: string; secondSurname: string; - gender: "M" | "F"; + gender: 'M' | 'F'; }; export type CitizensBasicInformationResponse = { diff --git a/src/pages/auth/code/index.tsx b/src/pages/auth/code/index.tsx deleted file mode 100644 index 45ebbc21..00000000 --- a/src/pages/auth/code/index.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { useState } from "react"; -import { useRouter } from "next/router"; -import { yupResolver } from "@hookform/resolvers/yup"; -import { useForm } from "react-hook-form"; -import * as yup from "yup"; - -import LadingChica from "../../../../public/assets/ladingChica.png"; - -import { CardAuth, CardAuthFooter } from "@/components/elements/cardAuth"; -import { GridContainer, GridItem } from "@/components/elements/grid"; -import { - TextBodyTiny, - TextSubTitle, - TextSubTitleBody, - TextTitle, -} from "@/components/elements/typography"; - -import { FormControlApp } from "@/components/form/input"; -import { InputApp } from "@/themes/form/input"; -import { ButtonApp } from "@/components/elements/button"; -import { routes } from "@/constants/routes"; -import BoxContentCenter from "@/components/elements/boxContentCenter"; -import { labels } from "@/constants/labels"; - -interface IFormInputs { - code: string; -} - -const schema = yup.object({ - code: yup.string().trim().required(labels.form.requiredField), -}); - -export default function Index() { - const router = useRouter(); - - const [dataItem, setDataItem] = useState({}); - - const { - register, - handleSubmit, - formState: { errors }, - control, - setValue, - } = useForm({ - reValidateMode: "onSubmit", - shouldFocusError: false, - resolver: yupResolver(schema), - }); - - const onSubmit = (data: IFormInputs) => {}; - - return ( -
- - - - - - - - - - - INICIAR SESIÓN - - - - router.push(routes.auth.method)} - > - Cambiar Método de Inicio de Sesión - - - - - -
- ); -} diff --git a/src/pages/auth/index.tsx b/src/pages/auth/index.tsx deleted file mode 100644 index 366303d2..00000000 --- a/src/pages/auth/index.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import { useState } from "react"; -import { useRouter } from "next/router"; -import { yupResolver } from "@hookform/resolvers/yup"; -import { useForm } from "react-hook-form"; -import Image from "next/image"; -import * as yup from "yup"; - -import { - TextBodyTiny, - TextSubTitle, - TextSubTitleBody, - TextTitle, -} from "@/components/elements/typography"; -import { CardAuth, CardAuthFooter } from "@/components/elements/cardAuth"; -import { GridContainer, GridItem } from "@/components/elements/grid"; -import LadingHome from "../../../public/assets/ladingHome.svg"; -import { ButtonApp } from "@/components/elements/button"; -import { FormControlApp } from "@/components/form/input"; -import { InputApp } from "@/themes/form/input"; -import { routes } from "@/constants/routes"; -import { labels } from "@/constants/labels"; - -interface IFormInputs { - cedulaOrEmail: string; -} - -const schema = yup.object({ - cedulaOrEmail: yup.string().trim().required(labels.form.requiredField), -}); - -export default function Index() { - const router = useRouter(); - - const [dataItem, setDataItem] = useState({}); - - const { - register, - handleSubmit, - formState: { errors }, - control, - setValue, - } = useForm({ - reValidateMode: "onSubmit", - shouldFocusError: false, - resolver: yupResolver(schema), - }); - - const onSubmit = (data: IFormInputs) => { - router.push(routes.auth.password); - }; - - return ( -
- - - - ¡Bienvenido al Sistema de Autenticación Gubernamental{" "} - Ciudadana! - - - Accede o regístrate con un único usuario y contraseña, para - solicitar o consultar todos tus servicios y trámites - gubernamentales. - -
- - Una manera fácil y cómoda de identificarte, para realizar trámites - desde tu computadora o celular sin necesidad de trasladarte a los - organismos gubernamentales. - -
- Lading Home -
- - - - - - - - - - - - INICIAR SESIÓN - - - - - - - ¿No tienes cuenta? - {" "} - Registrate, accede a trámites y servicios del estado dominicano - con un único usuario y contraseña, de forma segura y confiable. - -
- router.push(routes.register.home)} - > - CREAR TU CUENTA UNICA CIUDADANA - -
-
-
-
- ); -} diff --git a/src/pages/auth/method/index.tsx b/src/pages/auth/method/index.tsx deleted file mode 100644 index 4d13055c..00000000 --- a/src/pages/auth/method/index.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { useState } from 'react'; -import { useRouter } from 'next/router' -import { yupResolver } from '@hookform/resolvers/yup'; -import { useForm } from 'react-hook-form'; -import * as yup from "yup"; - -import LockIcon from '@mui/icons-material/Lock'; -import PermContactCalendarIcon from '@mui/icons-material/PermContactCalendar'; - -import LadingChica from "../../../../public/assets/ladingChica.png" - -import { CardAuth, CardAuthFooter } from "@/components/elements/cardAuth" -import { GridContainer, GridItem } from "@/components/elements/grid" -import { TextBodyTiny, TextSubTitle, TextSubTitleBody, TextTitle } from "@/components/elements/typography" - -import { FormControlApp } from '@/components/form/input'; -import { InputApp } from '@/themes/form/input'; -import { ButtonApp } from '@/components/elements/button'; -import { routes } from '@/constants/routes'; -import BoxContentCenter from '@/components/elements/boxContentCenter'; -import { labels } from '@/constants/labels'; -import { Typography } from '@mui/material'; - -export default function Index() { - - const router = useRouter() - - return ( - - - - -
router.push("password")} style={{border: "1px solid #E5E5E5", cursor: "pointer", borderRadius: "6px", padding: "14px 12px", marginBottom: "10px", display: "flex", alignItems: "center", flexDirection: "row"}}> - -
- Contraseña - Iniciar sesión ingresando contraseña. -
-
-
- - -
router.push("code")} style={{border: "1px solid #E5E5E5", cursor: "pointer", borderRadius: "6px", padding: "14px 12px", marginBottom: "10px", display: "flex", alignItems: "center", flexDirection: "row"}}> - -
- Código Autenticador - Ingrese un código de verificación de la aplicación de autenticación activa. -
-
-
-
-
-
- ) -} \ No newline at end of file diff --git a/src/pages/auth/password/index.tsx b/src/pages/auth/password/index.tsx deleted file mode 100644 index 9390c2ef..00000000 --- a/src/pages/auth/password/index.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import { useState } from "react"; -import { useRouter } from "next/router"; -import { yupResolver } from "@hookform/resolvers/yup"; -import { useForm } from "react-hook-form"; -import * as yup from "yup"; - -import LadingChica from "../../../../public/assets/ladingChica.png"; - -import { CardAuth, CardAuthFooter } from "@/components/elements/cardAuth"; -import { GridContainer, GridItem } from "@/components/elements/grid"; -import { - TextBodyTiny, - TextSubTitle, - TextSubTitleBody, - TextTitle, -} from "@/components/elements/typography"; - -import { FormControlApp } from "@/components/form/input"; -import { InputApp } from "@/themes/form/input"; -import { ButtonApp } from "@/components/elements/button"; -import { routes } from "@/constants/routes"; -import BoxContentCenter from "@/components/elements/boxContentCenter"; -import { labels } from "@/constants/labels"; - -interface IFormInputs { - password: string; -} - -const schema = yup.object({ - password: yup.string().trim().required(labels.form.requiredField), -}); - -export default function Index() { - const router = useRouter(); - - const [dataItem, setDataItem] = useState({}); - - const { - register, - handleSubmit, - formState: { errors }, - control, - setValue, - } = useForm({ - reValidateMode: "onSubmit", - shouldFocusError: false, - resolver: yupResolver(schema), - }); - - const onSubmit = (data: IFormInputs) => {}; - - return ( -
- - - - - - - - - - - - - ¿Olvidaste tu contraseña? - - - - - - INICIAR SESIÓN - - - {/* - router.push(routes.auth.method)} - > - Cambiar Método de Inicio de Sesión - - */} - - - - - - ¿No tienes cuenta?{" "} - Registrate aquí. - - - - - -
- ); -} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 94137ed2..c0426b8f 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,4 +1,4 @@ -import Register from "./register"; +import Register from './register'; export default function Home() { return ; diff --git a/src/pages/register/confirmation/index.tsx b/src/pages/register/confirmation/index.tsx index 7b8d0a36..510a6877 100644 --- a/src/pages/register/confirmation/index.tsx +++ b/src/pages/register/confirmation/index.tsx @@ -7,7 +7,7 @@ import * as yup from "yup"; import MarkEmailReadOutlinedIcon from "@mui/icons-material/MarkEmailReadOutlined"; import { GridContainer, GridItem } from "@/components/elements/grid"; import BoxContentCenter from "@/components/elements/boxContentCenter"; -import LadingChico from "../../../../public/assets/ladingChico.png"; +import LandingChico from "../../../../public/assets/landingChico.png"; import { CardAuth } from "@/components/elements/cardAuth"; import { ButtonApp } from "@/components/elements/button"; import { FormControlApp } from "@/components/form/input"; @@ -30,21 +30,19 @@ const schema = yup.object({ export default function Index() { const router = useRouter(); - const [dataItem, setDataItem] = useState({}); + const [dataItem] = useState({}); const { register, handleSubmit, formState: { errors }, - control, - setValue, } = useForm({ reValidateMode: "onSubmit", shouldFocusError: false, resolver: yupResolver(schema), }); - const onSubmit = (data: IFormInputs) => { + const onSubmit = () => { router.push(routes.register.registered); }; @@ -54,8 +52,8 @@ export default function Index() { } diff --git a/src/pages/register/index.tsx b/src/pages/register/index.tsx index ca4377f0..a29365f7 100644 --- a/src/pages/register/index.tsx +++ b/src/pages/register/index.tsx @@ -1,51 +1,19 @@ -import { - TextSubTitle, - TextSubTitleBody, - TextTitle, -} from "@/components/elements/typography"; -import LadingChica2 from "../../../public/assets/ladingChica2.png"; -import { GridContainer, GridItem } from "@/components/elements/grid"; -import { CardAuth } from "@/components/elements/cardAuth"; -import StepperRegister from "./stepper"; -import Image from "next/image"; -import BoxContentCenter from "@/components/elements/boxContentCenter"; -import LadingChica from "../../../public/assets/ladingChica.png"; +import LandingChica2 from '../../../public/assets/landingChica.png'; +import { CardAuth } from '@/components/elements/cardAuth'; +import StepperRegister from './stepper'; +import BoxContentCenter from '@/components/elements/boxContentCenter'; export default function Index() { return ( - // - // - // - // ¡Bienvenido a la Plataforma Única de Autenticación{" "} - // Ciudadana! - // - // - // Accede o regístrate con un único usuario y contraseña, para solicitar - // o consultar todos tus servicios y trámites gubernamentales. - // - //
- // - // Una manera fácil y cómoda de identificarte, para realizar trámites - // desde tu computadora o celular sin necesidad de trasladarte a los - // organismos gubernamentales. - // - //
- // Lading Home - //
- - // - - - - - - - // - //
+ + + + + ); } diff --git a/src/pages/register/registered/index.tsx b/src/pages/register/registered/index.tsx index 1b170b81..15738f78 100644 --- a/src/pages/register/registered/index.tsx +++ b/src/pages/register/registered/index.tsx @@ -1,15 +1,15 @@ -import { yupResolver } from "@hookform/resolvers/yup"; -import { useForm } from "react-hook-form"; -import * as yup from "yup"; +import { yupResolver } from '@hookform/resolvers/yup'; +import { useForm } from 'react-hook-form'; +import * as yup from 'yup'; -import CheckCircleOutlineOutlinedIcon from "@mui/icons-material/CheckCircleOutlineOutlined"; -import BoxContentCenter from "@/components/elements/boxContentCenter"; -import { GridContainer, GridItem } from "@/components/elements/grid"; -import LadingChico from "../../../../public/assets/ladingChico.png"; -import { TextBody } from "@/components/elements/typography"; -import { CardAuth } from "@/components/elements/cardAuth"; -import { ButtonApp } from "@/components/elements/button"; -import { labels } from "@/constants/labels"; +import CheckCircleOutlineOutlinedIcon from '@mui/icons-material/CheckCircleOutlineOutlined'; +import BoxContentCenter from '@/components/elements/boxContentCenter'; +import { GridContainer, GridItem } from '@/components/elements/grid'; +import LandingChico from '../../../../public/assets/landingChico.png'; +import { TextBody } from '@/components/elements/typography'; +import { CardAuth } from '@/components/elements/cardAuth'; +import { ButtonApp } from '@/components/elements/button'; +import { labels } from '@/constants/labels'; interface IFormInputs { email: string; @@ -25,9 +25,9 @@ const schema = yup.object({ export default function Index() { const { - formState: { errors }, + formState: { }, } = useForm({ - reValidateMode: "onSubmit", + reValidateMode: 'onSubmit', shouldFocusError: false, resolver: yupResolver(schema), }); @@ -36,11 +36,11 @@ export default function Index() { } > @@ -63,7 +63,7 @@ export default function Index() { window.open( - "https://beta.auth.digital.gob.do/realms/master/account/" + 'https://beta.auth.digital.gob.do/realms/master/account/' ) } > diff --git a/src/pages/register/stepper/index.tsx b/src/pages/register/stepper/index.tsx index e453ca14..6624376e 100644 --- a/src/pages/register/stepper/index.tsx +++ b/src/pages/register/stepper/index.tsx @@ -1,21 +1,21 @@ -import Typography from "@mui/material/Typography"; -import StepLabel from "@mui/material/StepLabel"; -import Stepper from "@mui/material/Stepper"; -import Button from "@mui/material/Button"; -import Step from "@mui/material/Step"; -import Box from "@mui/material/Box"; -import * as React from "react"; -import axios from "axios"; - -import { routes } from "@/constants/routes"; -import { useRouter } from "next/router"; -import Step1 from "./step1"; -import Step2 from "./step2"; -import Step3 from "./step3"; - -const steps = ["PASO 1", "PASO 2", "PASO 3"]; - -export async function getServerSideProps(ctx: any) { +import Typography from '@mui/material/Typography'; +import StepLabel from '@mui/material/StepLabel'; +import Stepper from '@mui/material/Stepper'; +import Button from '@mui/material/Button'; +import Step from '@mui/material/Step'; +import Box from '@mui/material/Box'; +import * as React from 'react'; +import axios from 'axios'; + +import { routes } from '@/constants/routes'; +import { useRouter } from 'next/router'; +import Step1 from './step1'; +import Step2 from './step2'; +import Step3 from './step3'; + +const steps = ['PASO 1', 'PASO 2', 'PASO 3']; + +export async function getServerSideProps() { await axios.get(`/api/auth`); return { @@ -39,10 +39,6 @@ export default function StepperRegister() { const [infoCedula, setInfoCedula] = React.useState({}); - const isStepOptional = (step: number) => { - return step === 1; - }; - const isStepSkipped = (step: number) => { return skipped.has(step); }; @@ -63,33 +59,14 @@ export default function StepperRegister() { setSkipped(newSkipped); }; - const handleBack = () => { - setActiveStep((prevActiveStep) => prevActiveStep - 1); - }; - - const handleSkip = () => { - if (!isStepOptional(activeStep)) { - // You probably want to guard against something like this, - // it should never occur unless someone's actively trying to break something. - throw new Error("You can't skip a step that isn't optional."); - } - - setActiveStep((prevActiveStep) => prevActiveStep + 1); - setSkipped((prevSkipped) => { - const newSkipped = new Set(prevSkipped.values()); - newSkipped.add(activeStep); - return newSkipped; - }); - }; - const handleReset = () => { setActiveStep(0); }; return ( - + {steps.map((label, index) => { @@ -116,11 +93,11 @@ export default function StepperRegister() { - {label} + {label} ); @@ -131,13 +108,13 @@ export default function StepperRegister() { All steps completed - you're finished - - + + ) : ( -
+
{activeStep === 0 && ( )} diff --git a/src/pages/register/stepper/step1.tsx b/src/pages/register/stepper/step1.tsx index fb246519..50acef90 100644 --- a/src/pages/register/stepper/step1.tsx +++ b/src/pages/register/stepper/step1.tsx @@ -1,19 +1,19 @@ -import { yupResolver } from "@hookform/resolvers/yup"; -import ReCAPTCHA from "react-google-recaptcha"; -import { useForm } from "react-hook-form"; -import { useRef, useState } from "react"; -import getConfig from "next/config"; -import * as yup from "yup"; - -import { GridContainer, GridItem } from "@/components/elements/grid"; -import { CitizensBasicInformationResponse } from "@/pages/api/types"; -import LoadingBackdrop from "@/components/elements/loadingBackdrop"; -import { TextBody } from "@/components/elements/typography"; -import { AlertWarning } from "@/components/elements/alert"; -import { ButtonApp } from "@/components/elements/button"; -import { FormControlApp } from "@/components/form/input"; -import { InputApp } from "@/themes/form/input"; -import { labels } from "@/constants/labels"; +import { yupResolver } from '@hookform/resolvers/yup'; +import ReCAPTCHA from 'react-google-recaptcha'; +import { useForm } from 'react-hook-form'; +import { useRef, useState } from 'react'; +import getConfig from 'next/config'; +import * as yup from 'yup'; + +import { GridContainer, GridItem } from '@/components/elements/grid'; +import { CitizensBasicInformationResponse } from '@/pages/api/types'; +import LoadingBackdrop from '@/components/elements/loadingBackdrop'; +import { TextBody } from '@/components/elements/typography'; +import { AlertWarning } from '@/components/elements/alert'; +import { ButtonApp } from '@/components/elements/button'; +import { FormControlApp } from '@/components/form/input'; +import { InputApp } from '@/themes/form/input'; +import { labels } from '@/constants/labels'; const { publicRuntimeConfig } = getConfig(); @@ -26,7 +26,7 @@ const schema = yup.object({ .string() .trim() .required(labels.form.requiredField) - .min(11, "Debe contener 11 dígitos"), + .min(11, 'Debe contener 11 dígitos'), }); export default function Step1({ setInfoCedula, handleNext }: any) { @@ -42,15 +42,15 @@ export default function Step1({ setInfoCedula, handleNext }: any) { const handleChange = (e: any) => { const cedulaValue = e.target.value - .replace(/\D/g, "") + .replace(/\D/g, '') .match(/(\d{0,3})(\d{0,7})(\d{0,1})/); e.target.value = !cedulaValue[2] ? cedulaValue[1] : `${cedulaValue[1]}-${cedulaValue[2]}${`${ - cedulaValue[3] ? `-${cedulaValue[3]}` : "" - }`}${`${cedulaValue[4] ? `-${cedulaValue[4]}` : ""}`}`; - const numbers = e.target.value.replace(/(\D)/g, ""); - setValue("cedula", numbers); + cedulaValue[3] ? `-${cedulaValue[3]}` : '' + }`}${`${cedulaValue[4] ? `-${cedulaValue[4]}` : ''}`}`; + const numbers = e.target.value.replace(/(\D)/g, ''); + setValue('cedula', numbers); }; const { @@ -58,7 +58,7 @@ export default function Step1({ setInfoCedula, handleNext }: any) { formState: { errors }, setValue, } = useForm({ - reValidateMode: "onSubmit", + reValidateMode: 'onSubmit', shouldFocusError: false, resolver: yupResolver(schema), }); @@ -68,7 +68,7 @@ export default function Step1({ setInfoCedula, handleNext }: any) { if (!tokenCaptcha) { return AlertWarning( - "Necesitamos verificar que no eres un robot. Por favor complete el control de seguridad" + 'Necesitamos verificar que no eres un robot. Por favor complete el control de seguridad' ); } @@ -90,7 +90,7 @@ export default function Step1({ setInfoCedula, handleNext }: any) { handleNext(); }) .catch(() => { - AlertWarning("Parece que ha introducido una cédula inválida."); + AlertWarning('Parece que ha introducido una cédula inválida.'); }) .finally(() => setLoading(false)); }; @@ -133,19 +133,19 @@ export default function Step1({ setInfoCedula, handleNext }: any) {

diff --git a/src/pages/register/stepper/step2.tsx b/src/pages/register/stepper/step2.tsx index 9a7bf3fb..77d77c87 100644 --- a/src/pages/register/stepper/step2.tsx +++ b/src/pages/register/stepper/step2.tsx @@ -1,20 +1,20 @@ -import SentimentSatisfiedOutlinedIcon from "@mui/icons-material/SentimentSatisfiedOutlined"; -import CameraAltOutlinedIcon from "@mui/icons-material/CameraAltOutlined"; -import { yupResolver } from "@hookform/resolvers/yup"; -import { useForm } from "react-hook-form"; -import { useState } from "react"; -import * as yup from "yup"; +import SentimentSatisfiedOutlinedIcon from '@mui/icons-material/SentimentSatisfiedOutlined'; +import CameraAltOutlinedIcon from '@mui/icons-material/CameraAltOutlined'; +import { yupResolver } from '@hookform/resolvers/yup'; +import { useForm } from 'react-hook-form'; +import { useState } from 'react'; +import * as yup from 'yup'; -import { GridContainer, GridItem } from "@/components/elements/grid"; -import FormControlLabel from "@mui/material/FormControlLabel"; -import { TextBody } from "@/components/elements/typography"; -import { AlertWarning } from "@/components/elements/alert"; -import { ButtonApp } from "@/components/elements/button"; -import FormGroup from "@mui/material/FormGroup"; -import Checkbox from "@mui/material/Checkbox"; -import { labels } from "@/constants/labels"; -import { Typography } from "@mui/material"; -import Step2Modal from "./step2Modal"; +import { GridContainer, GridItem } from '@/components/elements/grid'; +import FormControlLabel from '@mui/material/FormControlLabel'; +import { TextBody } from '@/components/elements/typography'; +import { AlertWarning } from '@/components/elements/alert'; +import { ButtonApp } from '@/components/elements/button'; +import FormGroup from '@mui/material/FormGroup'; +import Checkbox from '@mui/material/Checkbox'; +import { labels } from '@/constants/labels'; +import { Typography } from '@mui/material'; +import Step2Modal from './step2Modal'; interface IFormInputs { acceptTermAndConditions: boolean; @@ -33,13 +33,11 @@ export default function Step2({ infoCedula, handleNext }: any) { const handleClick = () => setOpen(!open); const { - register, handleSubmit, - formState: { errors }, - control, + formState: { }, setValue, } = useForm({ - reValidateMode: "onSubmit", + reValidateMode: 'onSubmit', shouldFocusError: false, resolver: yupResolver(schema), }); @@ -47,7 +45,7 @@ export default function Step2({ infoCedula, handleNext }: any) { const onSubmit = (data: IFormInputs) => { if (!data.acceptTermAndConditions) { return AlertWarning( - "Para continuar debe aceptar Términos y Políticas de Privacidad" + 'Para continuar debe aceptar Términos y Políticas de Privacidad' ); } handleClick(); @@ -57,8 +55,8 @@ export default function Step2({ infoCedula, handleNext }: any) { <>
- ¡Hola {infoCedula?.name}!{" "} - + ¡Hola {infoCedula?.name}!{' '} + Ahora vamos a verificar tu identidad mediante autenticación biométrica y continuar con el proceso de tú registro, asegúrate de disponer de los siguientes elementos: @@ -71,21 +69,21 @@ export default function Step2({ infoCedula, handleNext }: any) {
- Tener disponible un teléfono móvil o computadora con{" "} - cámara integrada. + Tener disponible un teléfono móvil o computadora con{' '} + cámara integrada.
@@ -93,21 +91,21 @@ export default function Step2({ infoCedula, handleNext }: any) {
- Permitir capturas de{" "} - + Permitir capturas de{' '} + fotografías de tu rostro. @@ -117,7 +115,7 @@ export default function Step2({ infoCedula, handleNext }: any) { Verificación con pasaporte disponible próximamente @@ -125,15 +123,15 @@ export default function Step2({ infoCedula, handleNext }: any) {

- + { - setValue("acceptTermAndConditions", e.target.checked); + setValue('acceptTermAndConditions', e.target.checked); }} control={} label={ - Aceptar Términos y Políticas de Privacidad{" "} + Aceptar Términos y Políticas de Privacidad{' '} * } diff --git a/src/pages/register/stepper/step2Modal.tsx b/src/pages/register/stepper/step2Modal.tsx index c3d8255f..a3b2cdb8 100644 --- a/src/pages/register/stepper/step2Modal.tsx +++ b/src/pages/register/stepper/step2Modal.tsx @@ -1,19 +1,17 @@ -import { TransitionProps } from "@mui/material/transitions"; -import { ThemeProvider } from "@aws-amplify/ui-react"; -import LogoutIcon from "@mui/icons-material/Logout"; -import Toolbar from "@mui/material/Toolbar"; -import AppBar from "@mui/material/AppBar"; -import Dialog from "@mui/material/Dialog"; -import Slide from "@mui/material/Slide"; -import { Box } from "@mui/material"; -import { forwardRef } from "react"; -import Image from "next/image"; +import { TransitionProps } from '@mui/material/transitions'; +import { ThemeProvider } from '@aws-amplify/ui-react'; +import LogoutIcon from '@mui/icons-material/Logout'; +import Toolbar from '@mui/material/Toolbar'; +import AppBar from '@mui/material/AppBar'; +import Dialog from '@mui/material/Dialog'; +import Slide from '@mui/material/Slide'; +import { Box } from '@mui/material'; +import { forwardRef } from 'react'; +import Image from 'next/image'; -import { LivenessQuickStartReact } from "@/components/biometric/face-liveness-detector"; -import { ContainerApp } from "@/components/elements/container"; -import { ButtonApp } from "@/components/elements/button"; -import Logo from "../../../../public/assets/logo.png"; -import { GridContainer, GridItem } from "@/components/elements/grid"; +import { LivenessQuickStartReact } from '@/components/biometric/face-liveness-detector'; +import { ButtonApp } from '@/components/elements/button'; +import Logo from '../../../../public/assets/logo.png'; const Transition = forwardRef(function Transition( props: TransitionProps & { @@ -25,7 +23,6 @@ const Transition = forwardRef(function Transition( }); export default function Step2Modal({ - open, handleClick, handleNextForm, identity, @@ -38,8 +35,8 @@ export default function Step2Modal({ onClose={handleClick} TransitionComponent={Transition} > - -
+ +
logo @@ -58,14 +55,14 @@ export default function Step2Modal({
diff --git a/src/pages/register/stepper/step3.tsx b/src/pages/register/stepper/step3.tsx index ef4947da..2e7db38f 100644 --- a/src/pages/register/stepper/step3.tsx +++ b/src/pages/register/stepper/step3.tsx @@ -1,17 +1,17 @@ -import { yupResolver } from "@hookform/resolvers/yup"; -import { useForm } from "react-hook-form"; -import { useState } from "react"; -import * as yup from "yup"; -import axios from "axios"; +import { yupResolver } from '@hookform/resolvers/yup'; +import { useForm } from 'react-hook-form'; +import { useState } from 'react'; +import * as yup from 'yup'; +import axios from 'axios'; -import { AlertError, AlertWarning } from "@/components/elements/alert"; -import { GridContainer, GridItem } from "@/components/elements/grid"; -import LoadingBackdrop from "@/components/elements/loadingBackdrop"; -import { TextBody } from "@/components/elements/typography"; -import { FormControlApp } from "@/components/form/input"; -import { ButtonApp } from "@/components/elements/button"; -import { InputApp } from "@/themes/form/input"; -import { labels } from "@/constants/labels"; +import { AlertError, AlertWarning } from '@/components/elements/alert'; +import { GridContainer, GridItem } from '@/components/elements/grid'; +import LoadingBackdrop from '@/components/elements/loadingBackdrop'; +import { TextBody } from '@/components/elements/typography'; +import { FormControlApp } from '@/components/form/input'; +import { ButtonApp } from '@/components/elements/button'; +import { InputApp } from '@/themes/form/input'; +import { labels } from '@/constants/labels'; interface IFormInputs { email: string; @@ -30,24 +30,24 @@ const schema = yup.object({ .string() .trim() .required(labels.form.requiredField) - .oneOf([yup.ref("email")], "Los correos no coinciden"), + .oneOf([yup.ref('email')], 'Los correos no coinciden'), password: yup .string() - .min(8, "Debe contener al menos 8 caracteres") + .min(8, 'Debe contener al menos 8 caracteres') .required(labels.form.requiredField) .trim() .matches( /^.*(?=.{8,})((?=.*[!@#$%^&*()\-_=+{};:,<.>]){1})(?=.*\d)((?=.*[a-z]){1})((?=.*[A-Z]){1}).*$/, - "La contraseña debe contener una mayúscula, un número y un carácter especial" + 'La contraseña debe contener una mayúscula, un número y un carácter especial' ), passwordConfirm: yup .string() .required(labels.form.requiredField) - .oneOf([yup.ref("password")], "Las contraseñas no coinciden"), + .oneOf([yup.ref('password')], 'Las contraseñas no coinciden'), }); export default function Step3({ handleNext, infoCedula }: any) { - const [dataItem, setDataItem] = useState({}); + const [dataItem] = useState({}); const [loading, setLoading] = useState(false); @@ -56,10 +56,8 @@ export default function Step3({ handleNext, infoCedula }: any) { handleSubmit, formState: { errors }, getValues, - control, - setValue, } = useForm({ - mode: "onChange", + mode: 'onChange', resolver: yupResolver(schema), }); @@ -67,7 +65,7 @@ export default function Step3({ handleNext, infoCedula }: any) { setLoading(true); axios - .post("/api/iam", { + .post('/api/iam', { email: data.email, username: infoCedula.id, password: data.password, @@ -77,7 +75,7 @@ export default function Step3({ handleNext, infoCedula }: any) { }) .catch((err) => { if (err?.response?.status === 409) { - AlertWarning("El correo electrónico ya está registrado."); + AlertWarning('El correo electrónico ya está registrado.'); } else { AlertError(); } @@ -115,7 +113,7 @@ export default function Step3({ handleNext, infoCedula }: any) { return false; }} autoComplete="off" - {...register("email")} + {...register('email')} /> @@ -138,7 +136,7 @@ export default function Step3({ handleNext, infoCedula }: any) { return false; }} autoComplete="off" - {...register("emailConfirm")} + {...register('emailConfirm')} /> @@ -176,7 +174,7 @@ export default function Step3({ handleNext, infoCedula }: any) { return false; }} autoComplete="off" - {...register("password")} + {...register('password')} /> @@ -200,7 +198,7 @@ export default function Step3({ handleNext, infoCedula }: any) { return false; }} autoComplete="off" - {...register("passwordConfirm")} + {...register('passwordConfirm')} /> @@ -211,7 +209,7 @@ export default function Step3({ handleNext, infoCedula }: any) { disabled={ Object.values(getValues()).every( (value: any) => - value !== null && value !== undefined && value !== "" + value !== null && value !== undefined && value !== '' ) === false ? true : false diff --git a/src/styles/globals.css b/src/styles/globals.css index f62090b0..f5dfaf0e 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -1,4 +1,4 @@ -@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600&display=swap'); +@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600&display=swap"); body { font-family: Poppins, sans-serif; @@ -19,62 +19,121 @@ body { .text-primary { color: #003670; } + .text-success { - color: #2ECC71; + color: #2ecc71; } + .text-secondary { - color: #0087FF; + color: #0087ff; } + .text-error { - color: #EE2A24; + color: #ee2a24; } + .text-info { - color: #23C3DF; + color: #23c3df; } .bg-primary { background: #003670; } + .bg-success { - background: #2ECC71; + background: #2ecc71; } + .bg-secondary { - background: #0087FF; + background: #0087ff; } + .bg-error { - background: #EE2A24; + background: #ee2a24; } + .bg-info { - background: #23C3DF; + background: #23c3df; +} + +.p-1 { + padding: 5px; +} + +.py-1 { + padding-top: 5px; + padding-bottom: 5px; +} + +.px-1 { + padding-left: 5px; + padding-right: 5px; +} + +.p-2 { + padding: 10px; +} + +.py-2 { + padding-top: 10px; + padding-bottom: 10px; } -.p-1 { padding: 5px; } -.py-1 { padding-top: 5px; padding-bottom: 5px; } -.px-1 { padding-left: 5px; padding-right: 5px; } +.px-2 { + padding-left: 10px; + padding-right: 10px; +} -.p-2 { padding: 10px; } -.py-2 { padding-top: 10px; padding-bottom: 10px; } -.px-2 { padding-left: 10px; padding-right: 10px; } +.p-3 { + padding: 15px; +} -.p-3 { padding: 15px; } -.py-3 { padding-top: 15px; padding-bottom: 15px; } -.px-3 { padding-left: 15px; padding-right: 15px; } +.py-3 { + padding-top: 15px; + padding-bottom: 15px; +} -.p-4 { padding: 20px; } -.py-4 { padding-top: 20px; padding-bottom: 20px; } -.px-4 { padding-left: 20px; padding-right: 20px; } +.px-3 { + padding-left: 15px; + padding-right: 15px; +} -.p-5 { padding: 25px; } -.py-5 { padding-top: 25px; padding-bottom: 25px; } -.px-5 { padding-left: 25px; padding-right: 25px; } +.p-4 { + padding: 20px; +} + +.py-4 { + padding-top: 20px; + padding-bottom: 20px; +} + +.px-4 { + padding-left: 20px; + padding-right: 20px; +} + +.p-5 { + padding: 25px; +} + +.py-5 { + padding-top: 25px; + padding-bottom: 25px; +} + +.px-5 { + padding-left: 25px; + padding-right: 25px; +} /* MUI global */ -.MuiStepLabel-iconContainer, .MuiStepConnector-horizontal { +.muisteplabel-iconcontainer, +.muistepconnector-horizontal { display: none !important; } -.MuiStepLabel-label { +.muisteplabel-label { color: #03397775; } @@ -82,4 +141,4 @@ body { background: red; z-index: 500 !important; padding: 450px; -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index 61c19abd..325ad8f7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -14,10 +18,31 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, + "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": [ + "src/*" + ], + "@components/*": [ + "components/*" + ], + "@utils/*": [ + "utils/*" + ], + "@lib/*": [ + "lib/*" + ], + "@services/*": [ + "services/*" + ] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] -} + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 4ea752c5..fb297b2b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4776,7 +4776,19 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz#d0fce5d07b0620caa282b5131c297bb60f9d87e6" integrity sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww== -"@eslint/eslintrc@^2.0.0": +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.4.0": + version "4.5.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.1.tgz#cdd35dce4fa1a89a4fd42b1599eb35b3af408884" + integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== + +"@eslint/eslintrc@^2.0.3": version "2.0.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.3.tgz#4910db5505f4d503f27774bf356e3704818a0331" integrity sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ== @@ -4791,10 +4803,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.35.0.tgz#b7569632b0b788a0ca0e438235154e45d42813a7" - integrity sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw== +"@eslint/js@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.40.0.tgz#3ba73359e11f5a7bd3e407f70b3528abfae69cec" + integrity sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA== "@floating-ui/core@^0.7.3": version "0.7.3" @@ -6027,13 +6039,6 @@ "@turf/line-intersect" "^6.5.0" "@turf/meta" "^6.5.0" -"@types/axios@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@types/axios/-/axios-0.14.0.tgz#ec2300fbe7d7dddd7eb9d3abf87999964cafce46" - integrity sha512-KqQnQbdYE54D7oa/UmYVMZKq7CO4l8DEENzOKc4aBRwxCXSlJXGz83flFx5L7AWrOQnmuN3kVsRdt+GZPPjiVQ== - dependencies: - axios "*" - "@types/cookie@^0.3.3": version "0.3.3" resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.3.3.tgz#85bc74ba782fb7aa3a514d11767832b0e3bc6803" @@ -6078,6 +6083,11 @@ dependencies: "@types/istanbul-lib-report" "*" +"@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" @@ -6200,6 +6210,11 @@ resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.27.tgz#9db563937dd86915f69092bc43259d2f48578e41" integrity sha512-YvMLqFak/7rt//lPBtEHv3M4sRNA+HGxrhFZ+DQs9K2IkYJbNwVIb8avtJfhDiuaUBX/AW0jnjv48FV8h3u9bQ== +"@types/semver@^7.3.12": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" + integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== + "@types/stack-utils@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" @@ -6236,7 +6251,23 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/parser@^5.42.0": +"@typescript-eslint/eslint-plugin@^5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.5.tgz#f156827610a3f8cefc56baeaa93cd4a5f32966b4" + integrity sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg== + dependencies: + "@eslint-community/regexpp" "^4.4.0" + "@typescript-eslint/scope-manager" "5.59.5" + "@typescript-eslint/type-utils" "5.59.5" + "@typescript-eslint/utils" "5.59.5" + debug "^4.3.4" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + natural-compare-lite "^1.4.0" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/parser@^5.42.0", "@typescript-eslint/parser@^5.59.5": version "5.59.5" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.5.tgz#63064f5eafbdbfb5f9dfbf5c4503cdf949852981" integrity sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw== @@ -6254,6 +6285,16 @@ "@typescript-eslint/types" "5.59.5" "@typescript-eslint/visitor-keys" "5.59.5" +"@typescript-eslint/type-utils@5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.5.tgz#485b0e2c5b923460bc2ea6b338c595343f06fc9b" + integrity sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg== + dependencies: + "@typescript-eslint/typescript-estree" "5.59.5" + "@typescript-eslint/utils" "5.59.5" + debug "^4.3.4" + tsutils "^3.21.0" + "@typescript-eslint/types@5.59.5": version "5.59.5" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.5.tgz#e63c5952532306d97c6ea432cee0981f6d2258c7" @@ -6272,6 +6313,20 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/utils@5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.5.tgz#15b3eb619bb223302e60413adb0accd29c32bcae" + integrity sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.59.5" + "@typescript-eslint/types" "5.59.5" + "@typescript-eslint/typescript-estree" "5.59.5" + eslint-scope "^5.1.1" + semver "^7.3.7" + "@typescript-eslint/visitor-keys@5.59.5": version "5.59.5" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz#ba5b8d6791a13cf9fea6716af1e7626434b29b9b" @@ -6580,7 +6635,14 @@ axe-core@^4.6.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.0.tgz#34ba5a48a8b564f67e103f0aa5768d76e15bbbbf" integrity sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ== -axios@*, axios@^1.4.0: +axios@0.26.0: + version "0.26.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.0.tgz#9a318f1c69ec108f8cd5f3c3d390366635e13928" + integrity sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og== + dependencies: + follow-redirects "^1.14.8" + +axios@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f" integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA== @@ -6589,13 +6651,6 @@ axios@*, axios@^1.4.0: form-data "^4.0.0" proxy-from-env "^1.1.0" -axios@0.26.0: - version "0.26.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.0.tgz#9a318f1c69ec108f8cd5f3c3d390366635e13928" - integrity sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og== - dependencies: - follow-redirects "^1.14.8" - axobject-query@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.1.1.tgz#3b6e5c6d4e43ca7ba51c5babf99d22a9c68485e1" @@ -7684,6 +7739,11 @@ eslint-config-next@13.2.3: eslint-plugin-react "^7.31.7" eslint-plugin-react-hooks "^4.5.0" +eslint-config-prettier@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" + integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== + eslint-import-resolver-node@^0.3.6, eslint-import-resolver-node@^0.3.7: version "0.3.7" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7" @@ -7693,7 +7753,7 @@ eslint-import-resolver-node@^0.3.6, eslint-import-resolver-node@^0.3.7: is-core-module "^2.11.0" resolve "^1.22.1" -eslint-import-resolver-typescript@^3.5.2: +eslint-import-resolver-typescript@^3.5.2, eslint-import-resolver-typescript@^3.5.5: version "3.5.5" resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.5.5.tgz#0a9034ae7ed94b254a360fbea89187b60ea7456d" integrity sha512-TdJqPHs2lW5J9Zpe17DZNQuDnox4xo2o+0tE7Pggain9Rbc19ik8kFtXdxZ250FVx2kF4vlt2RSf4qlUpG7bhw== @@ -7757,6 +7817,13 @@ eslint-plugin-jsx-a11y@^6.5.1: object.fromentries "^2.0.6" semver "^6.3.0" +eslint-plugin-prettier@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" + integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== + dependencies: + prettier-linter-helpers "^1.0.0" + eslint-plugin-react-hooks@^4.5.0: version "4.6.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" @@ -7783,7 +7850,15 @@ eslint-plugin-react@^7.31.7: semver "^6.3.0" string.prototype.matchall "^4.0.8" -eslint-scope@^7.1.1: +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-scope@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b" integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== @@ -7791,30 +7866,20 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== -eslint@8.35.0: - version "8.35.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.35.0.tgz#fffad7c7e326bae606f0e8f436a6158566d42323" - integrity sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw== +eslint@^8.40.0: + version "8.40.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.40.0.tgz#a564cd0099f38542c4e9a2f630fa45bf33bc42a4" + integrity sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ== dependencies: - "@eslint/eslintrc" "^2.0.0" - "@eslint/js" "8.35.0" + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.4.0" + "@eslint/eslintrc" "^2.0.3" + "@eslint/js" "8.40.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -7824,10 +7889,9 @@ eslint@8.35.0: debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.1.1" - eslint-utils "^3.0.0" - eslint-visitor-keys "^3.3.0" - espree "^9.4.0" + eslint-scope "^7.2.0" + eslint-visitor-keys "^3.4.1" + espree "^9.5.2" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -7849,12 +7913,11 @@ eslint@8.35.0: minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.1" - regexpp "^3.2.0" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.4.0, espree@^9.5.2: +espree@^9.5.2: version "9.5.2" resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.2.tgz#e994e7dc33a082a7a82dceaf12883a829353215b" integrity sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw== @@ -7882,6 +7945,11 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" @@ -8007,6 +8075,11 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + fast-glob@^3.2.11, fast-glob@^3.2.12, fast-glob@^3.2.9: version "3.2.12" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" @@ -9996,6 +10069,11 @@ napi-build-utils@^1.0.1: resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -10542,6 +10620,18 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@>=2.0.0: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + pretty-format@^26.5.2, pretty-format@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" @@ -10951,11 +11041,6 @@ regexp.prototype.flags@^1.4.3, regexp.prototype.flags@^1.5.0: define-properties "^1.2.0" functions-have-names "^1.2.3" -regexpp@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - regexpu-core@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b"