@ha_tecno/live-id-sdk 1.0.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/android/build.gradle +4 -0
- package/lib/commonjs/components/{WaitingForResult → CameraConfigInfo}/index.js +9 -11
- package/lib/commonjs/components/CameraConfigInfo/index.js.map +1 -0
- package/lib/commonjs/components/CameraConfigInfo/styles.js +20 -0
- package/lib/commonjs/components/CameraConfigInfo/styles.js.map +1 -0
- package/lib/commonjs/components/CaptureButton/index.js +88 -0
- package/lib/commonjs/components/CaptureButton/index.js.map +1 -0
- package/lib/commonjs/components/CaptureButton/styles.js +22 -0
- package/lib/commonjs/components/CaptureButton/styles.js.map +1 -0
- package/lib/commonjs/components/Gabarito/index.js +2 -2
- package/lib/commonjs/components/Gabarito/index.js.map +1 -1
- package/lib/commonjs/components/Gabarito/styles.js +10 -11
- package/lib/commonjs/components/Gabarito/styles.js.map +1 -1
- package/lib/commonjs/components/HelpRegister/index.js +51 -0
- package/lib/commonjs/components/HelpRegister/index.js.map +1 -0
- package/lib/commonjs/{screens/CadastroFinger/components/AjudaCadastro → components/HelpRegister}/styles.js +17 -20
- package/lib/commonjs/components/HelpRegister/styles.js.map +1 -0
- package/lib/commonjs/components/Toast/Toast.js +12 -12
- package/lib/commonjs/components/Toast/Toast.js.map +1 -1
- package/lib/commonjs/components/deviceNotFound/deviceNotFound.js +27 -0
- package/lib/commonjs/components/deviceNotFound/deviceNotFound.js.map +1 -0
- package/lib/commonjs/components/deviceNotFound/styles.js +36 -0
- package/lib/commonjs/components/deviceNotFound/styles.js.map +1 -0
- package/lib/commonjs/components/icon/icon.js +22 -0
- package/lib/commonjs/components/icon/icon.js.map +1 -0
- package/lib/commonjs/components/index.js +56 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/components/modalMessage/modalMessage.js +63 -0
- package/lib/commonjs/components/modalMessage/modalMessage.js.map +1 -0
- package/lib/commonjs/components/modalMessage/styles.js +51 -0
- package/lib/commonjs/components/modalMessage/styles.js.map +1 -0
- package/lib/commonjs/components/recordButton/recordButton.js +83 -0
- package/lib/commonjs/components/recordButton/recordButton.js.map +1 -0
- package/lib/commonjs/components/recordButton/styles.js +21 -0
- package/lib/commonjs/components/recordButton/styles.js.map +1 -0
- package/lib/commonjs/index.js +9 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js +29 -29
- package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js.map +1 -1
- package/lib/commonjs/screens/FingerAuth/FingerAuth.js +128 -0
- package/lib/commonjs/screens/FingerAuth/FingerAuth.js.map +1 -0
- package/lib/commonjs/screens/FingerAuth/styles.js +35 -0
- package/lib/commonjs/screens/FingerAuth/styles.js.map +1 -0
- package/lib/commonjs/screens/FingerRegister/index.js +138 -0
- package/lib/commonjs/screens/FingerRegister/index.js.map +1 -0
- package/lib/commonjs/screens/FingerRegister/styles.js +35 -0
- package/lib/commonjs/screens/FingerRegister/styles.js.map +1 -0
- package/lib/commonjs/screens/LifeCertificate/index.js +145 -0
- package/lib/commonjs/screens/LifeCertificate/index.js.map +1 -0
- package/lib/commonjs/screens/LifeCertificate/styles.js +27 -0
- package/lib/commonjs/screens/LifeCertificate/styles.js.map +1 -0
- package/lib/commonjs/screens/index.js +28 -0
- package/lib/commonjs/screens/index.js.map +1 -0
- package/lib/commonjs/services/index.js +35 -101
- package/lib/commonjs/services/index.js.map +1 -1
- package/lib/commonjs/services/services.js +134 -0
- package/lib/commonjs/services/services.js.map +1 -0
- package/lib/commonjs/services/types.js +2 -0
- package/lib/commonjs/{types/screen.js.map → services/types.js.map} +1 -1
- package/lib/commonjs/store/createSelectors.js +16 -0
- package/lib/commonjs/store/createSelectors.js.map +1 -0
- package/lib/commonjs/store/modules/fingerAuth/index.js +19 -0
- package/lib/commonjs/store/modules/fingerAuth/index.js.map +1 -0
- package/lib/commonjs/store/modules/fingerAuth/selectors.js +13 -0
- package/lib/commonjs/store/modules/fingerAuth/selectors.js.map +1 -0
- package/lib/commonjs/store/modules/fingerAuth/slice.js +92 -0
- package/lib/commonjs/store/modules/fingerAuth/slice.js.map +1 -0
- package/lib/commonjs/store/modules/fingerAuth/type.js +2 -0
- package/lib/commonjs/store/modules/fingerAuth/type.js.map +1 -0
- package/lib/commonjs/store/modules/fingerRegister/index.js +19 -0
- package/lib/commonjs/store/modules/fingerRegister/index.js.map +1 -0
- package/lib/commonjs/store/modules/fingerRegister/selectors.js +13 -0
- package/lib/commonjs/store/modules/fingerRegister/selectors.js.map +1 -0
- package/lib/commonjs/store/modules/fingerRegister/slice.js +101 -0
- package/lib/commonjs/store/modules/fingerRegister/slice.js.map +1 -0
- package/lib/commonjs/store/modules/fingerRegister/types.js +2 -0
- package/lib/commonjs/store/modules/fingerRegister/types.js.map +1 -0
- package/lib/commonjs/store/modules/lifeCertificate/index.js +19 -0
- package/lib/commonjs/store/modules/lifeCertificate/index.js.map +1 -0
- package/lib/commonjs/store/modules/lifeCertificate/selectors.js +13 -0
- package/lib/commonjs/store/modules/lifeCertificate/selectors.js.map +1 -0
- package/lib/commonjs/store/modules/lifeCertificate/slice.js +101 -0
- package/lib/commonjs/store/modules/lifeCertificate/slice.js.map +1 -0
- package/lib/commonjs/store/modules/lifeCertificate/types.js +6 -0
- package/lib/commonjs/store/modules/lifeCertificate/types.js.map +1 -0
- package/lib/commonjs/utils/file.js +2 -2
- package/lib/commonjs/utils/getConfigCamera.js +1 -1
- package/lib/commonjs/utils/getConfigCamera.js.map +1 -1
- package/lib/module/components/CameraConfigInfo/index.js +15 -0
- package/lib/module/components/CameraConfigInfo/index.js.map +1 -0
- package/lib/module/components/CameraConfigInfo/styles.js +14 -0
- package/lib/module/components/CameraConfigInfo/styles.js.map +1 -0
- package/lib/module/components/CaptureButton/index.js +79 -0
- package/lib/module/components/CaptureButton/index.js.map +1 -0
- package/lib/module/components/CaptureButton/styles.js +16 -0
- package/lib/module/components/CaptureButton/styles.js.map +1 -0
- package/lib/module/components/Gabarito/index.js +5 -4
- package/lib/module/components/Gabarito/index.js.map +1 -1
- package/lib/module/components/Gabarito/styles.js +11 -12
- package/lib/module/components/Gabarito/styles.js.map +1 -1
- package/lib/module/{screens/CadastroFinger/components/AjudaCadastro → components/HelpRegister}/index.js +17 -15
- package/lib/module/components/HelpRegister/index.js.map +1 -0
- package/lib/module/components/HelpRegister/styles.js +53 -0
- package/lib/module/components/HelpRegister/styles.js.map +1 -0
- package/lib/module/components/Toast/Toast.js +14 -14
- package/lib/module/components/Toast/Toast.js.map +1 -1
- package/lib/module/components/deviceNotFound/deviceNotFound.js +20 -0
- package/lib/module/components/deviceNotFound/deviceNotFound.js.map +1 -0
- package/lib/module/components/deviceNotFound/styles.js +30 -0
- package/lib/module/components/deviceNotFound/styles.js.map +1 -0
- package/lib/module/components/icon/icon.js +15 -0
- package/lib/module/components/icon/icon.js.map +1 -0
- package/lib/module/components/index.js +9 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/components/modalMessage/modalMessage.js +54 -0
- package/lib/module/components/modalMessage/modalMessage.js.map +1 -0
- package/lib/module/components/modalMessage/styles.js +45 -0
- package/lib/module/components/modalMessage/styles.js.map +1 -0
- package/lib/module/components/recordButton/recordButton.js +74 -0
- package/lib/module/components/recordButton/recordButton.js.map +1 -0
- package/lib/module/components/recordButton/styles.js +15 -0
- package/lib/module/components/recordButton/styles.js.map +1 -0
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/CadastroScreen/CadastroScreen.js +33 -33
- package/lib/module/screens/CadastroScreen/CadastroScreen.js.map +1 -1
- package/lib/module/screens/FingerAuth/FingerAuth.js +119 -0
- package/lib/module/screens/FingerAuth/FingerAuth.js.map +1 -0
- package/lib/module/screens/FingerAuth/styles.js +29 -0
- package/lib/module/screens/FingerAuth/styles.js.map +1 -0
- package/lib/module/screens/FingerRegister/index.js +129 -0
- package/lib/module/screens/FingerRegister/index.js.map +1 -0
- package/lib/module/screens/FingerRegister/styles.js +29 -0
- package/lib/module/screens/FingerRegister/styles.js.map +1 -0
- package/lib/module/screens/LifeCertificate/index.js +136 -0
- package/lib/module/screens/LifeCertificate/index.js.map +1 -0
- package/lib/module/screens/LifeCertificate/styles.js +21 -0
- package/lib/module/screens/LifeCertificate/styles.js.map +1 -0
- package/lib/module/screens/index.js +5 -0
- package/lib/module/screens/index.js.map +1 -0
- package/lib/module/services/index.js +9 -95
- package/lib/module/services/index.js.map +1 -1
- package/lib/module/services/services.js +123 -0
- package/lib/module/services/services.js.map +1 -0
- package/lib/module/services/types.js +2 -0
- package/lib/module/{types/screen.js.map → services/types.js.map} +1 -1
- package/lib/module/store/createSelectors.js +10 -0
- package/lib/module/store/createSelectors.js.map +1 -0
- package/lib/module/store/modules/fingerAuth/index.js +3 -0
- package/lib/module/store/modules/fingerAuth/index.js.map +1 -0
- package/lib/module/store/modules/fingerAuth/selectors.js +6 -0
- package/lib/module/store/modules/fingerAuth/selectors.js.map +1 -0
- package/lib/module/store/modules/fingerAuth/slice.js +86 -0
- package/lib/module/store/modules/fingerAuth/slice.js.map +1 -0
- package/lib/module/store/modules/fingerAuth/type.js +2 -0
- package/lib/module/store/modules/fingerAuth/type.js.map +1 -0
- package/lib/module/store/modules/fingerRegister/index.js +3 -0
- package/lib/module/store/modules/fingerRegister/index.js.map +1 -0
- package/lib/module/store/modules/fingerRegister/selectors.js +6 -0
- package/lib/module/store/modules/fingerRegister/selectors.js.map +1 -0
- package/lib/module/store/modules/fingerRegister/slice.js +95 -0
- package/lib/module/store/modules/fingerRegister/slice.js.map +1 -0
- package/lib/module/store/modules/fingerRegister/types.js +2 -0
- package/lib/module/store/modules/fingerRegister/types.js.map +1 -0
- package/lib/module/store/modules/lifeCertificate/index.js +3 -0
- package/lib/module/store/modules/lifeCertificate/index.js.map +1 -0
- package/lib/module/store/modules/lifeCertificate/selectors.js +6 -0
- package/lib/module/store/modules/lifeCertificate/selectors.js.map +1 -0
- package/lib/module/store/modules/lifeCertificate/slice.js +95 -0
- package/lib/module/store/modules/lifeCertificate/slice.js.map +1 -0
- package/lib/module/store/modules/lifeCertificate/types.js +2 -0
- package/lib/module/store/modules/lifeCertificate/types.js.map +1 -0
- package/lib/module/utils/file.js +3 -3
- package/lib/module/utils/getConfigCamera.js +4 -4
- package/lib/module/utils/getConfigCamera.js.map +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/typescript/src/components/CameraConfigInfo/index.d.ts +8 -0
- package/lib/typescript/src/components/CameraConfigInfo/index.d.ts.map +1 -0
- package/lib/typescript/src/components/CameraConfigInfo/styles.d.ts +13 -0
- package/lib/typescript/src/components/CameraConfigInfo/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/CaptureButton/index.d.ts +10 -0
- package/lib/typescript/src/components/CaptureButton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/CaptureButton/styles.d.ts +15 -0
- package/lib/typescript/src/components/CaptureButton/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Gabarito/index.d.ts +2 -1
- package/lib/typescript/src/components/Gabarito/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Gabarito/styles.d.ts +1 -2
- package/lib/typescript/src/components/Gabarito/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/HelpRegister/index.d.ts +4 -0
- package/lib/typescript/src/components/HelpRegister/index.d.ts.map +1 -0
- package/lib/typescript/src/{screens/CadastroFinger/components/AjudaCadastro → components/HelpRegister}/styles.d.ts +2 -5
- package/lib/typescript/src/components/HelpRegister/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Toast/Toast.d.ts +1 -1
- package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -1
- package/lib/typescript/src/components/deviceNotFound/deviceNotFound.d.ts +8 -0
- package/lib/typescript/src/components/deviceNotFound/deviceNotFound.d.ts.map +1 -0
- package/lib/typescript/src/components/deviceNotFound/styles.d.ts +29 -0
- package/lib/typescript/src/components/deviceNotFound/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/icon/icon.d.ts +9 -0
- package/lib/typescript/src/components/icon/icon.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +9 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/components/modalMessage/modalMessage.d.ts +11 -0
- package/lib/typescript/src/components/modalMessage/modalMessage.d.ts.map +1 -0
- package/lib/typescript/src/components/modalMessage/styles.d.ts +44 -0
- package/lib/typescript/src/components/modalMessage/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/recordButton/recordButton.d.ts +10 -0
- package/lib/typescript/src/components/recordButton/recordButton.d.ts.map +1 -0
- package/lib/typescript/src/components/recordButton/styles.d.ts +14 -0
- package/lib/typescript/src/components/recordButton/styles.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts +2 -4
- package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts +9 -0
- package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts.map +1 -0
- package/lib/typescript/src/screens/FingerAuth/styles.d.ts +25 -0
- package/lib/typescript/src/screens/FingerAuth/styles.d.ts.map +1 -0
- package/lib/typescript/src/screens/FingerRegister/index.d.ts +9 -0
- package/lib/typescript/src/screens/FingerRegister/index.d.ts.map +1 -0
- package/lib/typescript/src/screens/FingerRegister/styles.d.ts +25 -0
- package/lib/typescript/src/screens/FingerRegister/styles.d.ts.map +1 -0
- package/lib/typescript/src/screens/LifeCertificate/index.d.ts +7 -0
- package/lib/typescript/src/screens/LifeCertificate/index.d.ts.map +1 -0
- package/lib/typescript/src/{components/WaitingForResult → screens/LifeCertificate}/styles.d.ts +7 -11
- package/lib/typescript/src/screens/LifeCertificate/styles.d.ts.map +1 -0
- package/lib/typescript/src/screens/index.d.ts +5 -0
- package/lib/typescript/src/screens/index.d.ts.map +1 -0
- package/lib/typescript/src/services/index.d.ts +2 -17
- package/lib/typescript/src/services/index.d.ts.map +1 -1
- package/lib/typescript/src/services/services.d.ts +6 -0
- package/lib/typescript/src/services/services.d.ts.map +1 -0
- package/lib/typescript/src/services/types.d.ts +37 -0
- package/lib/typescript/src/services/types.d.ts.map +1 -0
- package/lib/typescript/src/store/createSelectors.d.ts +11 -0
- package/lib/typescript/src/store/createSelectors.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerAuth/index.d.ts +3 -0
- package/lib/typescript/src/store/modules/fingerAuth/index.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerAuth/selectors.d.ts +20 -0
- package/lib/typescript/src/store/modules/fingerAuth/selectors.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerAuth/slice.d.ts +4 -0
- package/lib/typescript/src/store/modules/fingerAuth/slice.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerAuth/type.d.ts +28 -0
- package/lib/typescript/src/store/modules/fingerAuth/type.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerRegister/index.d.ts +3 -0
- package/lib/typescript/src/store/modules/fingerRegister/index.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts +22 -0
- package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerRegister/slice.d.ts +4 -0
- package/lib/typescript/src/store/modules/fingerRegister/slice.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/fingerRegister/types.d.ts +30 -0
- package/lib/typescript/src/store/modules/fingerRegister/types.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/lifeCertificate/index.d.ts +3 -0
- package/lib/typescript/src/store/modules/lifeCertificate/index.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/lifeCertificate/selectors.d.ts +23 -0
- package/lib/typescript/src/store/modules/lifeCertificate/selectors.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/lifeCertificate/slice.d.ts +4 -0
- package/lib/typescript/src/store/modules/lifeCertificate/slice.d.ts.map +1 -0
- package/lib/typescript/src/store/modules/lifeCertificate/types.d.ts +37 -0
- package/lib/typescript/src/store/modules/lifeCertificate/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/getConfigCamera.d.ts +1 -1
- package/lib/typescript/src/utils/getConfigCamera.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +1 -1
- package/package.json +24 -42
- package/src/components/CameraConfigInfo/index.tsx +20 -0
- package/src/components/CameraConfigInfo/styles.ts +14 -0
- package/src/components/CaptureButton/index.tsx +74 -0
- package/src/components/CaptureButton/styles.ts +16 -0
- package/src/components/Gabarito/index.tsx +6 -4
- package/src/components/Gabarito/styles.ts +13 -14
- package/src/components/HelpRegister/index.tsx +40 -0
- package/src/components/HelpRegister/styles.ts +54 -0
- package/src/components/Toast/Toast.tsx +18 -22
- package/src/components/deviceNotFound/deviceNotFound.tsx +23 -0
- package/src/components/deviceNotFound/styles.ts +30 -0
- package/src/components/icon/icon.tsx +14 -0
- package/src/components/index.ts +9 -0
- package/src/components/modalMessage/modalMessage.tsx +73 -0
- package/src/components/modalMessage/styles.ts +45 -0
- package/src/components/recordButton/recordButton.tsx +75 -0
- package/src/components/recordButton/styles.ts +15 -0
- package/src/index.tsx +5 -4
- package/src/screens/CadastroScreen/CadastroScreen.tsx +35 -52
- package/src/screens/FingerAuth/FingerAuth.tsx +121 -0
- package/src/screens/FingerAuth/styles.ts +28 -0
- package/src/screens/FingerRegister/index.tsx +141 -0
- package/src/screens/FingerRegister/styles.ts +28 -0
- package/src/screens/LifeCertificate/index.tsx +152 -0
- package/src/screens/LifeCertificate/styles.ts +21 -0
- package/src/screens/index.ts +5 -0
- package/src/services/index.ts +12 -113
- package/src/services/services.ts +129 -0
- package/src/services/types.ts +42 -0
- package/src/store/createSelectors.ts +15 -0
- package/src/store/modules/fingerAuth/index.ts +3 -0
- package/src/store/modules/fingerAuth/selectors.ts +7 -0
- package/src/store/modules/fingerAuth/slice.ts +91 -0
- package/src/store/modules/fingerAuth/type.ts +29 -0
- package/src/store/modules/fingerRegister/index.ts +3 -0
- package/src/store/modules/fingerRegister/selectors.ts +7 -0
- package/src/store/modules/fingerRegister/slice.ts +101 -0
- package/src/store/modules/fingerRegister/types.ts +30 -0
- package/src/store/modules/lifeCertificate/index.ts +3 -0
- package/src/store/modules/lifeCertificate/selectors.ts +7 -0
- package/src/store/modules/lifeCertificate/slice.ts +100 -0
- package/src/store/modules/lifeCertificate/types.ts +40 -0
- package/src/utils/file.ts +3 -3
- package/src/utils/getConfigCamera.ts +7 -12
- package/src/utils/index.ts +1 -1
- package/lib/commonjs/components/CameraConfigInfos/index.js +0 -21
- package/lib/commonjs/components/CameraConfigInfos/index.js.map +0 -1
- package/lib/commonjs/components/CameraConfigInfos/styles.js +0 -19
- package/lib/commonjs/components/CameraConfigInfos/styles.js.map +0 -1
- package/lib/commonjs/components/DeviceNullDisplay/index.js +0 -59
- package/lib/commonjs/components/DeviceNullDisplay/index.js.map +0 -1
- package/lib/commonjs/components/ErrorDisplay/index.js +0 -59
- package/lib/commonjs/components/ErrorDisplay/index.js.map +0 -1
- package/lib/commonjs/components/WaitingForResult/index.js.map +0 -1
- package/lib/commonjs/components/WaitingForResult/styles.js +0 -32
- package/lib/commonjs/components/WaitingForResult/styles.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js +0 -49
- package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js +0 -298
- package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js +0 -54
- package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js +0 -44
- package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +0 -65
- package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +0 -1
- package/lib/commonjs/screens/CadastroFinger/index.js +0 -50
- package/lib/commonjs/screens/CadastroFinger/index.js.map +0 -1
- package/lib/commonjs/screens/ProvaVidas/index.js +0 -246
- package/lib/commonjs/screens/ProvaVidas/index.js.map +0 -1
- package/lib/commonjs/screens/ProvaVidas/styles.js +0 -93
- package/lib/commonjs/screens/ProvaVidas/styles.js.map +0 -1
- package/lib/commonjs/screens/ValidadeFinger/index.js +0 -216
- package/lib/commonjs/screens/ValidadeFinger/index.js.map +0 -1
- package/lib/commonjs/screens/ValidadeFinger/styles.js +0 -54
- package/lib/commonjs/screens/ValidadeFinger/styles.js.map +0 -1
- package/lib/commonjs/types/screen.js +0 -2
- package/lib/module/components/CameraConfigInfos/index.js +0 -13
- package/lib/module/components/CameraConfigInfos/index.js.map +0 -1
- package/lib/module/components/CameraConfigInfos/styles.js +0 -13
- package/lib/module/components/CameraConfigInfos/styles.js.map +0 -1
- package/lib/module/components/DeviceNullDisplay/index.js +0 -51
- package/lib/module/components/DeviceNullDisplay/index.js.map +0 -1
- package/lib/module/components/ErrorDisplay/index.js +0 -51
- package/lib/module/components/ErrorDisplay/index.js.map +0 -1
- package/lib/module/components/WaitingForResult/index.js +0 -17
- package/lib/module/components/WaitingForResult/index.js.map +0 -1
- package/lib/module/components/WaitingForResult/styles.js +0 -26
- package/lib/module/components/WaitingForResult/styles.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/AjudaCadastro/index.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js +0 -56
- package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js +0 -288
- package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js +0 -48
- package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js +0 -36
- package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +0 -1
- package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +0 -59
- package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +0 -1
- package/lib/module/screens/CadastroFinger/index.js +0 -42
- package/lib/module/screens/CadastroFinger/index.js.map +0 -1
- package/lib/module/screens/ProvaVidas/index.js +0 -239
- package/lib/module/screens/ProvaVidas/index.js.map +0 -1
- package/lib/module/screens/ProvaVidas/styles.js +0 -87
- package/lib/module/screens/ProvaVidas/styles.js.map +0 -1
- package/lib/module/screens/ValidadeFinger/index.js +0 -206
- package/lib/module/screens/ValidadeFinger/index.js.map +0 -1
- package/lib/module/screens/ValidadeFinger/styles.js +0 -48
- package/lib/module/screens/ValidadeFinger/styles.js.map +0 -1
- package/lib/module/types/screen.js +0 -2
- package/lib/typescript/src/components/CameraConfigInfos/index.d.ts +0 -9
- package/lib/typescript/src/components/CameraConfigInfos/index.d.ts.map +0 -1
- package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts +0 -11
- package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts.map +0 -1
- package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts +0 -11
- package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts.map +0 -1
- package/lib/typescript/src/components/ErrorDisplay/index.d.ts +0 -11
- package/lib/typescript/src/components/ErrorDisplay/index.d.ts.map +0 -1
- package/lib/typescript/src/components/WaitingForResult/index.d.ts +0 -7
- package/lib/typescript/src/components/WaitingForResult/index.d.ts.map +0 -1
- package/lib/typescript/src/components/WaitingForResult/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts +0 -7
- package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts +0 -16
- package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts +0 -44
- package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts +0 -12
- package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts +0 -54
- package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/CadastroFinger/index.d.ts +0 -16
- package/lib/typescript/src/screens/CadastroFinger/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/ProvaVidas/index.d.ts +0 -14
- package/lib/typescript/src/screens/ProvaVidas/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/ProvaVidas/styles.d.ts +0 -85
- package/lib/typescript/src/screens/ProvaVidas/styles.d.ts.map +0 -1
- package/lib/typescript/src/screens/ValidadeFinger/index.d.ts +0 -14
- package/lib/typescript/src/screens/ValidadeFinger/index.d.ts.map +0 -1
- package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts +0 -44
- package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts.map +0 -1
- package/lib/typescript/src/types/screen.d.ts +0 -6
- package/lib/typescript/src/types/screen.d.ts.map +0 -1
- package/live-id-sdk.podspec +0 -41
- package/src/components/CameraConfigInfos/index.tsx +0 -25
- package/src/components/CameraConfigInfos/styles.ts +0 -13
- package/src/components/DeviceNullDisplay/index.tsx +0 -59
- package/src/components/ErrorDisplay/index.tsx +0 -60
- package/src/components/WaitingForResult/index.tsx +0 -22
- package/src/components/WaitingForResult/styles.ts +0 -27
- package/src/screens/CadastroFinger/components/AjudaCadastro/index.tsx +0 -49
- package/src/screens/CadastroFinger/components/AjudaCadastro/styles.ts +0 -56
- package/src/screens/CadastroFinger/components/CameraCadastro/index.tsx +0 -356
- package/src/screens/CadastroFinger/components/CameraCadastro/styles.ts +0 -47
- package/src/screens/CadastroFinger/components/ImageDisplayScreen/index.tsx +0 -45
- package/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.ts +0 -55
- package/src/screens/CadastroFinger/index.tsx +0 -56
- package/src/screens/ProvaVidas/index.tsx +0 -308
- package/src/screens/ProvaVidas/styles.ts +0 -99
- package/src/screens/ValidadeFinger/index.tsx +0 -263
- package/src/screens/ValidadeFinger/styles.ts +0 -47
- package/src/types/screen.ts +0 -5
@@ -1,308 +0,0 @@
|
|
1
|
-
/* eslint-disable react-native/no-inline-styles */
|
2
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
3
|
-
import { Text, View, TouchableOpacity, Button } from 'react-native';
|
4
|
-
import {
|
5
|
-
Camera,
|
6
|
-
useCameraDevice,
|
7
|
-
useCameraFormat,
|
8
|
-
type VideoFile,
|
9
|
-
} from 'react-native-vision-camera';
|
10
|
-
import Modal, { type ModalProps } from 'react-native-modal';
|
11
|
-
import { Toast } from '../../components/Toast/Toast';
|
12
|
-
import { provaVida } from '../../services';
|
13
|
-
import { getConfigCamera } from '../../utils';
|
14
|
-
import { Alert } from 'react-native';
|
15
|
-
import type { ScreenProps } from '../../types/screen';
|
16
|
-
import { Platform } from 'react-native';
|
17
|
-
import Orientation from 'react-native-orientation-locker';
|
18
|
-
import { WaitingForResult } from '../../components/WaitingForResult';
|
19
|
-
import { ErrorDisplay } from '../../components/ErrorDisplay';
|
20
|
-
import { DeviceNullDisplay } from '../../components/DeviceNullDisplay';
|
21
|
-
import { styles } from './styles';
|
22
|
-
import { CameraConfigInfos } from '../../components/CameraConfigInfos';
|
23
|
-
|
24
|
-
const IS_IOS = Platform.OS === 'ios';
|
25
|
-
|
26
|
-
interface CameraProvaVidasProps {
|
27
|
-
isVisible: boolean;
|
28
|
-
onCloseModal?: () => void;
|
29
|
-
onError?: (response?: any) => void;
|
30
|
-
onSuccess?: (response?: any) => void;
|
31
|
-
ModalParams?: ModalProps;
|
32
|
-
screenProps?: ScreenProps;
|
33
|
-
}
|
34
|
-
|
35
|
-
type GetConfigApi = {
|
36
|
-
id: number;
|
37
|
-
deviceModels: string[];
|
38
|
-
deviceType: string;
|
39
|
-
fps: number;
|
40
|
-
exposure: number;
|
41
|
-
zoom: number;
|
42
|
-
serviceType: string;
|
43
|
-
showButtonInfo: boolean;
|
44
|
-
};
|
45
|
-
|
46
|
-
export const CameraProvaVidas: React.FC<CameraProvaVidasProps> = ({
|
47
|
-
isVisible = false,
|
48
|
-
onCloseModal,
|
49
|
-
onError,
|
50
|
-
onSuccess,
|
51
|
-
ModalParams,
|
52
|
-
screenProps,
|
53
|
-
}) => {
|
54
|
-
const id = screenProps?.id;
|
55
|
-
const camera = useRef<Camera>(null);
|
56
|
-
|
57
|
-
const [showOverlay, setShowOverlay] = useState(false);
|
58
|
-
const [intervalState, setIntervalState] = useState<NodeJS.Timeout | null>(
|
59
|
-
null
|
60
|
-
);
|
61
|
-
|
62
|
-
const [timer, setTimer] = useState(0);
|
63
|
-
const [load, setLoad] = useState(false);
|
64
|
-
const [stateToastBpm, setStateToastBpm] = useState({
|
65
|
-
message: '',
|
66
|
-
visible: false,
|
67
|
-
});
|
68
|
-
const [isRecording, setIsRecording] = useState(false);
|
69
|
-
const [cameraConfigs, setCameraConfigs] = useState<GetConfigApi>();
|
70
|
-
|
71
|
-
// mantem a tela em modo portrait
|
72
|
-
useEffect(() => {
|
73
|
-
Orientation.lockToPortrait();
|
74
|
-
return () => {
|
75
|
-
Orientation.unlockAllOrientations();
|
76
|
-
};
|
77
|
-
}, []);
|
78
|
-
|
79
|
-
// Pega a permissão da camera do dispositivo
|
80
|
-
const requestCameraPermission = useCallback(async () => {
|
81
|
-
try {
|
82
|
-
await Camera.requestCameraPermission();
|
83
|
-
} catch (error) {}
|
84
|
-
}, []);
|
85
|
-
|
86
|
-
// pra garantir que a permissão da camera seja solicitada
|
87
|
-
useEffect(() => {
|
88
|
-
requestCameraPermission();
|
89
|
-
}, [requestCameraPermission]);
|
90
|
-
|
91
|
-
useEffect(() => {
|
92
|
-
getConfigCamera('liveness')
|
93
|
-
.then((config) => {
|
94
|
-
setCameraConfigs(config);
|
95
|
-
})
|
96
|
-
.catch((error) => {
|
97
|
-
console.error(error);
|
98
|
-
});
|
99
|
-
}, []);
|
100
|
-
|
101
|
-
const device = useCameraDevice('back', {
|
102
|
-
physicalDevices: ['wide-angle-camera'],
|
103
|
-
});
|
104
|
-
|
105
|
-
const cameraFormat = useCameraFormat(device, [
|
106
|
-
{
|
107
|
-
videoResolution: {
|
108
|
-
height: 1280,
|
109
|
-
width: 720,
|
110
|
-
},
|
111
|
-
},
|
112
|
-
]);
|
113
|
-
|
114
|
-
// Envia o arquivo para a api
|
115
|
-
const sendFile = useCallback(
|
116
|
-
async (file: VideoFile) => {
|
117
|
-
setLoad(true);
|
118
|
-
|
119
|
-
if (!id)
|
120
|
-
return Alert.alert(
|
121
|
-
'Erro ao enviar o arquivo ( id error ), tente novamente mais tarde'
|
122
|
-
);
|
123
|
-
|
124
|
-
let req = await provaVida(file, id, cameraConfigs?.exposure);
|
125
|
-
|
126
|
-
if (req.code === 0 && req.bpm >= 0) {
|
127
|
-
setShowOverlay(false);
|
128
|
-
|
129
|
-
const optionsToast = {
|
130
|
-
message: `Seu batimento esta em: ${req.bpm}.\n Prova de vida concluida !`,
|
131
|
-
visible: true,
|
132
|
-
};
|
133
|
-
setStateToastBpm(optionsToast);
|
134
|
-
onSuccess && onSuccess(req);
|
135
|
-
} else {
|
136
|
-
Alert.alert(req.message);
|
137
|
-
onError && onError(req);
|
138
|
-
}
|
139
|
-
setLoad(false);
|
140
|
-
setShowOverlay(false);
|
141
|
-
return;
|
142
|
-
},
|
143
|
-
[cameraConfigs?.exposure, id, onError, onSuccess]
|
144
|
-
);
|
145
|
-
|
146
|
-
// Limpa tudo
|
147
|
-
useEffect(() => {
|
148
|
-
return () => {
|
149
|
-
// limpa tudo
|
150
|
-
setTimer(0);
|
151
|
-
setIsRecording(false);
|
152
|
-
setLoad(false);
|
153
|
-
setStateToastBpm({ message: '', visible: false });
|
154
|
-
};
|
155
|
-
}, []);
|
156
|
-
|
157
|
-
// Limpa o intervalo do timer
|
158
|
-
useEffect(() => {
|
159
|
-
if (timer < 0) {
|
160
|
-
if (!intervalState) return;
|
161
|
-
clearInterval(intervalState);
|
162
|
-
stopRecodingVideo();
|
163
|
-
}
|
164
|
-
}, [timer, intervalState]);
|
165
|
-
|
166
|
-
// Função para iniciar a gravação do video na referencia da camera
|
167
|
-
const startVideoRecording = useCallback(() => {
|
168
|
-
setIsRecording(true);
|
169
|
-
|
170
|
-
camera.current?.startRecording({
|
171
|
-
fileType: 'mp4',
|
172
|
-
onRecordingFinished: (video) => sendFile(video),
|
173
|
-
onRecordingError: (error) => console.error(error),
|
174
|
-
});
|
175
|
-
}, [sendFile]);
|
176
|
-
|
177
|
-
// Inicia a gravação do video
|
178
|
-
const recordingVideo = useCallback(async () => {
|
179
|
-
startVideoRecording();
|
180
|
-
setTimer(10);
|
181
|
-
setLoad(true);
|
182
|
-
|
183
|
-
setIntervalState(
|
184
|
-
setInterval(() => {
|
185
|
-
setTimer((prevTimer) => prevTimer - 1); // Update the timer state
|
186
|
-
}, 1000)
|
187
|
-
);
|
188
|
-
}, [startVideoRecording]);
|
189
|
-
|
190
|
-
// Para a gravação do video
|
191
|
-
const stopRecodingVideo = async () => {
|
192
|
-
setIsRecording(false);
|
193
|
-
await camera.current?.stopRecording();
|
194
|
-
setShowOverlay(true);
|
195
|
-
return;
|
196
|
-
};
|
197
|
-
|
198
|
-
// Fecha o modal
|
199
|
-
const onCloseModalHandler = () => {
|
200
|
-
resetScreenStatesAndCamera();
|
201
|
-
onCloseModal && onCloseModal();
|
202
|
-
};
|
203
|
-
|
204
|
-
// Limpa os estados da tela e a camera
|
205
|
-
const resetScreenStatesAndCamera = () => {
|
206
|
-
setTimer(0);
|
207
|
-
setIsRecording(false);
|
208
|
-
setShowOverlay(false);
|
209
|
-
setLoad(false);
|
210
|
-
setStateToastBpm({ message: '', visible: false });
|
211
|
-
};
|
212
|
-
|
213
|
-
if (!screenProps && isVisible) {
|
214
|
-
return (
|
215
|
-
<ErrorDisplay
|
216
|
-
isVisible={isVisible}
|
217
|
-
modalParams={ModalParams}
|
218
|
-
onCloseModalHandler={onCloseModalHandler}
|
219
|
-
requestCameraPermission={requestCameraPermission}
|
220
|
-
/>
|
221
|
-
);
|
222
|
-
}
|
223
|
-
|
224
|
-
if (device == null) {
|
225
|
-
return (
|
226
|
-
<DeviceNullDisplay
|
227
|
-
isVisible={isVisible}
|
228
|
-
modalParams={ModalParams}
|
229
|
-
onCloseModalHandler={onCloseModalHandler}
|
230
|
-
requestCameraPermission={requestCameraPermission}
|
231
|
-
/>
|
232
|
-
);
|
233
|
-
}
|
234
|
-
|
235
|
-
return (
|
236
|
-
<Modal
|
237
|
-
style={{ margin: 0 }}
|
238
|
-
isVisible={isVisible}
|
239
|
-
swipeDirection="down"
|
240
|
-
propagateSwipe={true}
|
241
|
-
onSwipeComplete={onCloseModalHandler}
|
242
|
-
{...ModalParams}
|
243
|
-
>
|
244
|
-
<View style={styles.container}>
|
245
|
-
{showOverlay && (
|
246
|
-
<WaitingForResult
|
247
|
-
onPress={() => {
|
248
|
-
setShowOverlay(false);
|
249
|
-
}}
|
250
|
-
/>
|
251
|
-
)}
|
252
|
-
|
253
|
-
<Toast
|
254
|
-
message={stateToastBpm.message}
|
255
|
-
isVisible={stateToastBpm.visible}
|
256
|
-
onClose={onCloseModalHandler}
|
257
|
-
/>
|
258
|
-
|
259
|
-
<View style={styles.containerCamera}>
|
260
|
-
<Camera
|
261
|
-
ref={camera}
|
262
|
-
style={styles.subContainer}
|
263
|
-
isActive={true}
|
264
|
-
device={device}
|
265
|
-
video={true}
|
266
|
-
torch={'on'}
|
267
|
-
format={cameraFormat}
|
268
|
-
exposure={cameraConfigs?.exposure}
|
269
|
-
zoom={cameraConfigs?.zoom}
|
270
|
-
/>
|
271
|
-
<View style={styles.cameraView} />
|
272
|
-
<View style={styles.containerTouch}>
|
273
|
-
<TouchableOpacity
|
274
|
-
onPress={() => recordingVideo()}
|
275
|
-
disabled={isRecording || load}
|
276
|
-
>
|
277
|
-
<View style={styles.containerText}>
|
278
|
-
<Text style={styles.textRecording}>
|
279
|
-
{isRecording
|
280
|
-
? `Aguarde ${timer} segundos`
|
281
|
-
: load
|
282
|
-
? 'Processando...'
|
283
|
-
: 'Medir Batimentos'}
|
284
|
-
</Text>
|
285
|
-
</View>
|
286
|
-
</TouchableOpacity>
|
287
|
-
</View>
|
288
|
-
<View
|
289
|
-
style={{
|
290
|
-
marginBottom: IS_IOS ? 48 : 0,
|
291
|
-
}}
|
292
|
-
>
|
293
|
-
<CameraConfigInfos
|
294
|
-
exposure={cameraConfigs?.exposure}
|
295
|
-
zoom={cameraConfigs?.zoom}
|
296
|
-
showButtonInfo={cameraConfigs?.showButtonInfo}
|
297
|
-
/>
|
298
|
-
<Button
|
299
|
-
disabled={load}
|
300
|
-
title="Fechar Camera"
|
301
|
-
onPress={onCloseModalHandler}
|
302
|
-
/>
|
303
|
-
</View>
|
304
|
-
</View>
|
305
|
-
</View>
|
306
|
-
</Modal>
|
307
|
-
);
|
308
|
-
};
|
@@ -1,99 +0,0 @@
|
|
1
|
-
import { StyleSheet } from 'react-native';
|
2
|
-
import { RFValue } from 'react-native-responsive-fontsize';
|
3
|
-
|
4
|
-
export const styles = StyleSheet.create({
|
5
|
-
container: {
|
6
|
-
flex: 1,
|
7
|
-
},
|
8
|
-
|
9
|
-
subContainer: {
|
10
|
-
flex: 1,
|
11
|
-
},
|
12
|
-
|
13
|
-
image: {
|
14
|
-
width: RFValue(200),
|
15
|
-
height: RFValue(200),
|
16
|
-
},
|
17
|
-
|
18
|
-
modalImage: {
|
19
|
-
width: '100%',
|
20
|
-
height: '100%',
|
21
|
-
resizeMode: 'contain',
|
22
|
-
},
|
23
|
-
|
24
|
-
overlay: {
|
25
|
-
zIndex: 2,
|
26
|
-
flex: 1,
|
27
|
-
height: '100%',
|
28
|
-
width: '100%',
|
29
|
-
backgroundColor: `rgba(44, 45, 46, 0.5)`,
|
30
|
-
alignItems: `center`,
|
31
|
-
justifyContent: `center`,
|
32
|
-
position: `absolute`,
|
33
|
-
},
|
34
|
-
|
35
|
-
textOverlay: {
|
36
|
-
fontSize: RFValue(18),
|
37
|
-
fontWeight: `500`,
|
38
|
-
color: `#fff`,
|
39
|
-
textAlign: `center`,
|
40
|
-
width: RFValue(300),
|
41
|
-
marginBottom: RFValue(20),
|
42
|
-
},
|
43
|
-
|
44
|
-
closeButton: {
|
45
|
-
position: 'absolute',
|
46
|
-
top: 20,
|
47
|
-
right: 20,
|
48
|
-
},
|
49
|
-
|
50
|
-
closeIcon: {
|
51
|
-
width: 20,
|
52
|
-
height: 20,
|
53
|
-
},
|
54
|
-
|
55
|
-
containerCamera: {
|
56
|
-
flex: 1,
|
57
|
-
},
|
58
|
-
|
59
|
-
cameraView: {
|
60
|
-
width: '100%',
|
61
|
-
height: RFValue(250),
|
62
|
-
backgroundColor: `rgba(173, 216, 230, 0)`,
|
63
|
-
position: `absolute`,
|
64
|
-
alignSelf: 'center',
|
65
|
-
marginTop: RFValue(50),
|
66
|
-
alignItems: `center`,
|
67
|
-
justifyContent: `center`,
|
68
|
-
},
|
69
|
-
|
70
|
-
containerTouch: {
|
71
|
-
height: RFValue(180),
|
72
|
-
alignItems: 'center',
|
73
|
-
},
|
74
|
-
|
75
|
-
containerText: {
|
76
|
-
width: RFValue(280),
|
77
|
-
height: RFValue(120),
|
78
|
-
borderRadius: 150,
|
79
|
-
backgroundColor: `blue`,
|
80
|
-
alignItems: `center`,
|
81
|
-
justifyContent: `center`,
|
82
|
-
marginTop: 10,
|
83
|
-
},
|
84
|
-
|
85
|
-
textRecording: {
|
86
|
-
fontSize: RFValue(18),
|
87
|
-
fontWeight: `500`,
|
88
|
-
color: `#fff`,
|
89
|
-
},
|
90
|
-
containerTextExposureAndZoom: {},
|
91
|
-
textExposureAndZoom: {
|
92
|
-
fontSize: 18,
|
93
|
-
fontWeight: `500`,
|
94
|
-
color: `#fff`,
|
95
|
-
textAlign: `center`,
|
96
|
-
width: RFValue(300),
|
97
|
-
marginBottom: RFValue(20),
|
98
|
-
},
|
99
|
-
});
|
@@ -1,263 +0,0 @@
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
2
|
-
import { Button, Text, View, Alert, TouchableOpacity } from 'react-native';
|
3
|
-
import {
|
4
|
-
Camera,
|
5
|
-
useCameraFormat,
|
6
|
-
type Point,
|
7
|
-
useCameraDevice,
|
8
|
-
} from 'react-native-vision-camera';
|
9
|
-
import Modal, { type ModalProps } from 'react-native-modal';
|
10
|
-
import Orientation from 'react-native-orientation-locker';
|
11
|
-
import {
|
12
|
-
Gesture,
|
13
|
-
GestureDetector,
|
14
|
-
GestureHandlerRootView,
|
15
|
-
} from 'react-native-gesture-handler';
|
16
|
-
import { runOnJS } from 'react-native-reanimated';
|
17
|
-
|
18
|
-
import { verifyDigital } from '../../services';
|
19
|
-
import { encodeImageToBase64 } from '../../utils/file';
|
20
|
-
import type { ScreenProps } from '../../types/screen';
|
21
|
-
import { DeviceNullDisplay } from '../../components/DeviceNullDisplay';
|
22
|
-
import { ErrorDisplay } from '../../components/ErrorDisplay';
|
23
|
-
import { Gabarito } from '../../components/Gabarito';
|
24
|
-
import { WaitingForResult } from '../../components/WaitingForResult';
|
25
|
-
import { styles } from './styles';
|
26
|
-
import { CameraConfigInfos } from '../../components/CameraConfigInfos';
|
27
|
-
import { getConfigCamera } from '../../utils';
|
28
|
-
|
29
|
-
interface ValidaFingerProps {
|
30
|
-
isVisible: boolean;
|
31
|
-
ModalParams?: ModalProps;
|
32
|
-
screenProps?: ScreenProps;
|
33
|
-
onCloseModal?: () => void;
|
34
|
-
onError?: (response?: any) => void;
|
35
|
-
onSuccess?: (response?: any) => void;
|
36
|
-
}
|
37
|
-
|
38
|
-
type GetConfigApi = {
|
39
|
-
id: number;
|
40
|
-
deviceModels: string[];
|
41
|
-
deviceType: string;
|
42
|
-
fps: number;
|
43
|
-
exposure: number;
|
44
|
-
zoom: number;
|
45
|
-
serviceType: string;
|
46
|
-
showButtonInfo: boolean;
|
47
|
-
};
|
48
|
-
|
49
|
-
export const ValidaFinger: React.FC<ValidaFingerProps> = ({
|
50
|
-
isVisible = false,
|
51
|
-
onCloseModal,
|
52
|
-
onError,
|
53
|
-
onSuccess,
|
54
|
-
ModalParams,
|
55
|
-
screenProps,
|
56
|
-
}) => {
|
57
|
-
const id = screenProps?.id;
|
58
|
-
|
59
|
-
const camera = useRef<Camera>(null);
|
60
|
-
const [showOverlay, setShowOverlay] = useState(false);
|
61
|
-
const [load, setLoad] = useState(false);
|
62
|
-
const [cameraConfigs, setCameraConfigs] = useState<GetConfigApi>();
|
63
|
-
|
64
|
-
// mantem a tela em modo portrait
|
65
|
-
useEffect(() => {
|
66
|
-
Orientation.lockToPortrait();
|
67
|
-
return () => {
|
68
|
-
Orientation.unlockAllOrientations();
|
69
|
-
};
|
70
|
-
}, []);
|
71
|
-
|
72
|
-
// Pega a permissão da camera do dispositivo
|
73
|
-
const requestCameraPermission = useCallback(async () => {
|
74
|
-
try {
|
75
|
-
await Camera.requestCameraPermission();
|
76
|
-
} catch (error) {}
|
77
|
-
}, []);
|
78
|
-
|
79
|
-
// pra garantir que a permissão da camera seja solicitada
|
80
|
-
useEffect(() => {
|
81
|
-
requestCameraPermission();
|
82
|
-
}, [requestCameraPermission]);
|
83
|
-
|
84
|
-
useEffect(() => {
|
85
|
-
getConfigCamera('finger')
|
86
|
-
.then((config) => {
|
87
|
-
setCameraConfigs(config);
|
88
|
-
})
|
89
|
-
.catch((error) => {
|
90
|
-
console.error(error);
|
91
|
-
});
|
92
|
-
}, []);
|
93
|
-
|
94
|
-
const device = useCameraDevice('back', {
|
95
|
-
physicalDevices: ['wide-angle-camera'],
|
96
|
-
});
|
97
|
-
|
98
|
-
const cameraFormat = useCameraFormat(device, [
|
99
|
-
{
|
100
|
-
photoResolution: {
|
101
|
-
height: 1280,
|
102
|
-
width: 720,
|
103
|
-
},
|
104
|
-
},
|
105
|
-
]);
|
106
|
-
|
107
|
-
const capturedPhoto = async () => {
|
108
|
-
const snapshot = await camera.current?.takePhoto({
|
109
|
-
qualityPrioritization: 'speed',
|
110
|
-
flash: 'on',
|
111
|
-
});
|
112
|
-
if (snapshot == null) {
|
113
|
-
Alert.alert('Erro ao capturar imagem');
|
114
|
-
return false;
|
115
|
-
}
|
116
|
-
let base64 = await encodeImageToBase64(snapshot.path);
|
117
|
-
|
118
|
-
setLoad(true);
|
119
|
-
setShowOverlay(true);
|
120
|
-
sendFile(base64);
|
121
|
-
return true;
|
122
|
-
};
|
123
|
-
|
124
|
-
// Fecha o modal
|
125
|
-
const onCloseModalHandler = useCallback(() => {
|
126
|
-
onCloseModal && onCloseModal();
|
127
|
-
}, [onCloseModal]);
|
128
|
-
|
129
|
-
// Envia a imagem para a validação da digital
|
130
|
-
const sendFile = useCallback(
|
131
|
-
async (image) => {
|
132
|
-
try {
|
133
|
-
let UID = id;
|
134
|
-
let finger = 'DI';
|
135
|
-
let req = await verifyDigital(UID, finger, image);
|
136
|
-
if (req.code === 0) {
|
137
|
-
Alert.alert('Sucesso identificado !');
|
138
|
-
onSuccess && onSuccess(req);
|
139
|
-
} else if (req.code === 1) {
|
140
|
-
Alert.alert('Não Identificado !');
|
141
|
-
onError && onError(req);
|
142
|
-
setLoad(false);
|
143
|
-
} else {
|
144
|
-
Alert.alert('Erro ao tentar validar');
|
145
|
-
onError && onError(req);
|
146
|
-
setLoad(false);
|
147
|
-
}
|
148
|
-
setLoad(false);
|
149
|
-
onCloseModalHandler();
|
150
|
-
setShowOverlay(false);
|
151
|
-
} catch (error) {
|
152
|
-
onError && onError(error);
|
153
|
-
setShowOverlay(false);
|
154
|
-
}
|
155
|
-
},
|
156
|
-
[id, onError, onSuccess, onCloseModalHandler]
|
157
|
-
);
|
158
|
-
|
159
|
-
// Foca a camera na posição do toque
|
160
|
-
const focus = useCallback((point: Point) => {
|
161
|
-
const c = camera.current;
|
162
|
-
if (c == null) return;
|
163
|
-
c.focus(point);
|
164
|
-
}, []);
|
165
|
-
|
166
|
-
// Gestos para focar a camera
|
167
|
-
const gesture = Gesture.Tap().onBegin(({ x, y }) => {
|
168
|
-
runOnJS(focus)({ x, y });
|
169
|
-
});
|
170
|
-
|
171
|
-
if (!screenProps && isVisible) {
|
172
|
-
return (
|
173
|
-
<ErrorDisplay
|
174
|
-
isVisible={isVisible}
|
175
|
-
modalParams={ModalParams}
|
176
|
-
onCloseModalHandler={onCloseModalHandler}
|
177
|
-
requestCameraPermission={requestCameraPermission}
|
178
|
-
/>
|
179
|
-
);
|
180
|
-
}
|
181
|
-
|
182
|
-
if (device == null) {
|
183
|
-
return (
|
184
|
-
<DeviceNullDisplay
|
185
|
-
isVisible={isVisible}
|
186
|
-
modalParams={ModalParams}
|
187
|
-
onCloseModalHandler={onCloseModalHandler}
|
188
|
-
requestCameraPermission={requestCameraPermission}
|
189
|
-
/>
|
190
|
-
);
|
191
|
-
}
|
192
|
-
|
193
|
-
if (screenProps) {
|
194
|
-
return (
|
195
|
-
<Modal
|
196
|
-
style={styles.modal}
|
197
|
-
isVisible={isVisible}
|
198
|
-
swipeDirection="down"
|
199
|
-
propagateSwipe={true}
|
200
|
-
onSwipeComplete={onCloseModalHandler}
|
201
|
-
{...ModalParams}
|
202
|
-
>
|
203
|
-
<GestureHandlerRootView style={styles.root}>
|
204
|
-
<View style={styles.container}>
|
205
|
-
{showOverlay && (
|
206
|
-
<WaitingForResult
|
207
|
-
onPress={() => {
|
208
|
-
setShowOverlay(false);
|
209
|
-
}}
|
210
|
-
/>
|
211
|
-
)}
|
212
|
-
<GestureDetector gesture={gesture}>
|
213
|
-
<View style={styles.cameraContainer}>
|
214
|
-
<Camera
|
215
|
-
ref={camera}
|
216
|
-
format={cameraFormat}
|
217
|
-
isActive={true}
|
218
|
-
device={device}
|
219
|
-
torch={'on'}
|
220
|
-
exposure={cameraConfigs?.exposure}
|
221
|
-
zoom={cameraConfigs?.zoom}
|
222
|
-
photo={true}
|
223
|
-
enableHighQualityPhotos={true}
|
224
|
-
style={styles.camera}
|
225
|
-
/>
|
226
|
-
{!showOverlay && <Gabarito />}
|
227
|
-
</View>
|
228
|
-
</GestureDetector>
|
229
|
-
<View style={styles.containerCapture}>
|
230
|
-
<TouchableOpacity disabled={load} onPress={() => capturedPhoto()}>
|
231
|
-
<View style={styles.containerButton}>
|
232
|
-
{load ? (
|
233
|
-
<Text style={styles.textButton}>
|
234
|
-
Verificando Digital...
|
235
|
-
</Text>
|
236
|
-
) : (
|
237
|
-
<Text style={styles.textButton}>Tirar Foto</Text>
|
238
|
-
)}
|
239
|
-
</View>
|
240
|
-
</TouchableOpacity>
|
241
|
-
</View>
|
242
|
-
<View style={styles.containerButtonClose}>
|
243
|
-
<Button
|
244
|
-
disabled={load}
|
245
|
-
title="Fechar Camera"
|
246
|
-
onPress={onCloseModalHandler}
|
247
|
-
/>
|
248
|
-
<View style={styles.cameraConfigs}>
|
249
|
-
<CameraConfigInfos
|
250
|
-
exposure={cameraConfigs?.exposure}
|
251
|
-
zoom={cameraConfigs?.zoom}
|
252
|
-
showButtonInfo={cameraConfigs?.showButtonInfo}
|
253
|
-
/>
|
254
|
-
</View>
|
255
|
-
</View>
|
256
|
-
</View>
|
257
|
-
</GestureHandlerRootView>
|
258
|
-
</Modal>
|
259
|
-
);
|
260
|
-
}
|
261
|
-
|
262
|
-
return null;
|
263
|
-
};
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import { StyleSheet, Dimensions, Platform } from 'react-native';
|
2
|
-
|
3
|
-
const { height } = Dimensions.get('window');
|
4
|
-
|
5
|
-
export const styles = StyleSheet.create({
|
6
|
-
container: {
|
7
|
-
flex: 1,
|
8
|
-
},
|
9
|
-
root: {
|
10
|
-
flex: 1,
|
11
|
-
},
|
12
|
-
cameraContainer: {
|
13
|
-
flex: 1,
|
14
|
-
},
|
15
|
-
camera: {
|
16
|
-
flex: 1,
|
17
|
-
justifyContent: 'flex-end',
|
18
|
-
paddingBottom: height * 0.2,
|
19
|
-
},
|
20
|
-
containerCapture: {
|
21
|
-
height: height * 0.2,
|
22
|
-
alignItems: 'center',
|
23
|
-
justifyContent: 'center',
|
24
|
-
},
|
25
|
-
containerButton: {
|
26
|
-
width: 350,
|
27
|
-
height: 100,
|
28
|
-
borderRadius: 80,
|
29
|
-
backgroundColor: 'blue',
|
30
|
-
alignItems: 'center',
|
31
|
-
justifyContent: 'center',
|
32
|
-
},
|
33
|
-
textButton: {
|
34
|
-
fontSize: 18,
|
35
|
-
fontWeight: '500',
|
36
|
-
color: '#fff',
|
37
|
-
},
|
38
|
-
modal: {
|
39
|
-
margin: 0,
|
40
|
-
},
|
41
|
-
containerButtonClose: {
|
42
|
-
marginBottom: Platform.OS === 'ios' ? 48 : 0,
|
43
|
-
},
|
44
|
-
cameraConfigs: {
|
45
|
-
alignItems: 'center',
|
46
|
-
},
|
47
|
-
});
|