@ha_tecno/live-id-sdk 1.0.0 → 2.1.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 +136 -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 +127 -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 +8 -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 +139 -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
@@ -0,0 +1,152 @@
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
2
|
+
import { StatusBar, View } from "react-native";
|
3
|
+
import Orientation from "react-native-orientation-locker";
|
4
|
+
import { Camera, VideoFile, useCameraDevice, useCameraFormat, useCameraPermission } from "react-native-vision-camera";
|
5
|
+
import { useDispatch, useSelector } from "../../store/modules/lifeCertificate";
|
6
|
+
import { DeviceNotFound, ModalMessage, RecordButton, CameraConfigInfo } from "../../components";
|
7
|
+
import { styles } from "./styles";
|
8
|
+
|
9
|
+
type Props = {
|
10
|
+
UID: string;
|
11
|
+
};
|
12
|
+
|
13
|
+
const LifeCertificate = ({ UID }: Props) => {
|
14
|
+
const camera = useRef<Camera>(null);
|
15
|
+
const state = useSelector();
|
16
|
+
const dispatch = useDispatch();
|
17
|
+
const { hasPermission, requestPermission } = useCameraPermission();
|
18
|
+
const [intervalState, setIntervalState] = useState<NodeJS.Timeout | null>(null);
|
19
|
+
const [timer, setTimer] = useState(10);
|
20
|
+
const device = useCameraDevice("back");
|
21
|
+
|
22
|
+
const format = useCameraFormat(device, [
|
23
|
+
{
|
24
|
+
videoResolution: {
|
25
|
+
height: 1280,
|
26
|
+
width: 720
|
27
|
+
}
|
28
|
+
}
|
29
|
+
]);
|
30
|
+
|
31
|
+
const cameraPermission = useCallback(async () => {
|
32
|
+
if (!hasPermission) {
|
33
|
+
await requestPermission();
|
34
|
+
}
|
35
|
+
}, [hasPermission, requestPermission]);
|
36
|
+
|
37
|
+
useEffect(() => {
|
38
|
+
cameraPermission();
|
39
|
+
dispatch.getConfig("liveness");
|
40
|
+
}, [cameraPermission, dispatch.getConfig]);
|
41
|
+
|
42
|
+
const containerRecordStyled = useMemo(
|
43
|
+
() => [styles.containerRecord, { bottom: state.showButtonInfo ? 75 : 20 }],
|
44
|
+
[state.showButtonInfo]
|
45
|
+
);
|
46
|
+
|
47
|
+
useEffect(() => {
|
48
|
+
Orientation.lockToPortrait();
|
49
|
+
}, []);
|
50
|
+
|
51
|
+
useEffect(() => {
|
52
|
+
if (state.code === 0) {
|
53
|
+
dispatch.setModal("Sucesso!", `Seu batimento está em: ${state.bpm}.\nProva de vida concluída!`);
|
54
|
+
dispatch.handleLoading();
|
55
|
+
}
|
56
|
+
if (state.code !== 0 && state.code !== null) {
|
57
|
+
dispatch.setModal("Ocorreu um erro!", `Erro: ${state.message}`);
|
58
|
+
dispatch.handleLoading();
|
59
|
+
}
|
60
|
+
setTimer(10);
|
61
|
+
dispatch.resetState();
|
62
|
+
}, [state.bpm, state.code, state.message, dispatch.handleLoading, dispatch.resetState, dispatch.setModal]);
|
63
|
+
|
64
|
+
const sendFile = useCallback(
|
65
|
+
async (file: VideoFile) => {
|
66
|
+
if (!UID) {
|
67
|
+
dispatch.setModal("Ocorreu um erro!", "Erro ao enviar o arquivo (id error)");
|
68
|
+
}
|
69
|
+
dispatch.sendLifeCertificate({
|
70
|
+
videoFile: file,
|
71
|
+
UID: UID,
|
72
|
+
exposure: state.exposure
|
73
|
+
});
|
74
|
+
},
|
75
|
+
[state.exposure, dispatch.sendLifeCertificate, dispatch.setModal, UID]
|
76
|
+
);
|
77
|
+
|
78
|
+
useEffect(() => {
|
79
|
+
return () => {
|
80
|
+
setTimer(0);
|
81
|
+
};
|
82
|
+
}, []);
|
83
|
+
|
84
|
+
useEffect(() => {
|
85
|
+
if (timer < 0 && intervalState != null) {
|
86
|
+
clearInterval(intervalState);
|
87
|
+
stopRecodingVideo();
|
88
|
+
}
|
89
|
+
}, [timer, intervalState]);
|
90
|
+
|
91
|
+
const startVideoRecording = useCallback(() => {
|
92
|
+
dispatch.setIsRecording(true);
|
93
|
+
camera.current?.startRecording({
|
94
|
+
flash: "off",
|
95
|
+
fileType: "mp4",
|
96
|
+
onRecordingFinished: (video) => sendFile(video),
|
97
|
+
onRecordingError: (error) => console.error(error)
|
98
|
+
});
|
99
|
+
}, [sendFile, dispatch.setIsRecording]);
|
100
|
+
|
101
|
+
const recordingVideo = useCallback(async () => {
|
102
|
+
startVideoRecording();
|
103
|
+
setIntervalState(
|
104
|
+
setInterval(() => {
|
105
|
+
setTimer((prevTimer) => prevTimer - 1);
|
106
|
+
}, 1000)
|
107
|
+
);
|
108
|
+
}, [startVideoRecording]);
|
109
|
+
|
110
|
+
const stopRecodingVideo = async () => {
|
111
|
+
dispatch.setIsRecording(false);
|
112
|
+
await camera.current?.stopRecording();
|
113
|
+
dispatch.handleLoading();
|
114
|
+
};
|
115
|
+
|
116
|
+
if (device == null || hasPermission === false)
|
117
|
+
return <DeviceNotFound hasPermission={hasPermission} cameraPermission={cameraPermission} />;
|
118
|
+
|
119
|
+
return (
|
120
|
+
<View style={styles.containerCamera}>
|
121
|
+
<StatusBar barStyle="light-content" />
|
122
|
+
<Camera
|
123
|
+
ref={camera}
|
124
|
+
style={styles.camera}
|
125
|
+
isActive={true}
|
126
|
+
device={device}
|
127
|
+
video={true}
|
128
|
+
torch={"on"}
|
129
|
+
format={format}
|
130
|
+
exposure={state.exposure}
|
131
|
+
zoom={state.zoom}
|
132
|
+
focusable={true}
|
133
|
+
photo={true}
|
134
|
+
enableHighQualityPhotos={true}
|
135
|
+
fps={30}
|
136
|
+
pixelFormat="native"
|
137
|
+
/>
|
138
|
+
<View style={containerRecordStyled}>
|
139
|
+
<RecordButton
|
140
|
+
onPress={recordingVideo}
|
141
|
+
disabled={state.isRecording || state.loading}
|
142
|
+
timer={timer}
|
143
|
+
isRecording={state.isRecording}
|
144
|
+
/>
|
145
|
+
</View>
|
146
|
+
{state.showButtonInfo && <CameraConfigInfo exposure={state.exposure} zoom={state.zoom} />}
|
147
|
+
<ModalMessage isLoading={state.loading} modal={state.modal} />
|
148
|
+
</View>
|
149
|
+
);
|
150
|
+
};
|
151
|
+
|
152
|
+
export default LifeCertificate;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { StyleSheet } from "react-native";
|
2
|
+
|
3
|
+
export const styles = StyleSheet.create({
|
4
|
+
containerCamera: {
|
5
|
+
flex: 1,
|
6
|
+
backgroundColor: "#0d0d0d"
|
7
|
+
},
|
8
|
+
camera: {
|
9
|
+
flex: 1
|
10
|
+
},
|
11
|
+
containerRecord: {
|
12
|
+
position: "absolute",
|
13
|
+
width: "100%",
|
14
|
+
alignItems: "center"
|
15
|
+
},
|
16
|
+
text: {
|
17
|
+
fontSize: 20,
|
18
|
+
fontWeight: "500",
|
19
|
+
color: "#000"
|
20
|
+
}
|
21
|
+
});
|
package/src/services/index.ts
CHANGED
@@ -1,24 +1,19 @@
|
|
1
|
-
import {
|
2
|
-
import axios from 'axios';
|
1
|
+
import { lifeCertificate, getConfigsApi, registerFingerImages, authFinger } from "./services";
|
3
2
|
|
4
|
-
const BASE_URL =
|
3
|
+
const BASE_URL = "https://api.liveid.app.br";
|
5
4
|
const TOKEN =
|
6
|
-
|
5
|
+
"eyJhbGciOiJIUzI1NiJ9.NmU5ZmQ0MzEtOTE0Yy00Njc1LWFkYjAtZjVjNjRlZDUxNDg0.9J8eydQk5fbkH5GKdXkmXpt6wdQWyw8bsbaP5POU6YA";
|
7
6
|
|
8
7
|
const BASE_HEADER = {
|
9
|
-
|
10
|
-
|
8
|
+
"Content-Type": "application/json",
|
9
|
+
Authorization: `Bearer ${TOKEN}`
|
11
10
|
};
|
12
11
|
|
13
|
-
const axiosInstance = axios.create({
|
14
|
-
baseURL: BASE_URL,
|
15
|
-
});
|
16
|
-
|
17
12
|
export const login = async (cpf: any, senha: any) => {
|
18
13
|
const response = await fetch(`${BASE_URL}/login`, {
|
19
|
-
method:
|
14
|
+
method: "POST",
|
20
15
|
headers: BASE_HEADER,
|
21
|
-
body: JSON.stringify({ cpf, senha })
|
16
|
+
body: JSON.stringify({ cpf, senha })
|
22
17
|
});
|
23
18
|
const data = await response.json();
|
24
19
|
return data;
|
@@ -26,118 +21,22 @@ export const login = async (cpf: any, senha: any) => {
|
|
26
21
|
|
27
22
|
export const cadastro = async (cpf: string, name: string, senha: string) => {
|
28
23
|
const response = await fetch(`${BASE_URL}/signup`, {
|
29
|
-
method:
|
30
|
-
headers: BASE_HEADER,
|
31
|
-
body: JSON.stringify({ cpf, name, senha }),
|
32
|
-
});
|
33
|
-
const data = await response.json();
|
34
|
-
return data;
|
35
|
-
};
|
36
|
-
|
37
|
-
export const sendImages = async (UID: any, finger: any, images: any) => {
|
38
|
-
const response = await fetch(`${BASE_URL}/enroll-images`, {
|
39
|
-
method: 'POST',
|
24
|
+
method: "POST",
|
40
25
|
headers: BASE_HEADER,
|
41
|
-
body: JSON.stringify({
|
26
|
+
body: JSON.stringify({ cpf, name, senha })
|
42
27
|
});
|
43
28
|
const data = await response.json();
|
44
29
|
return data;
|
45
30
|
};
|
46
31
|
|
47
|
-
export const verifyDigital = async (UID: any, finger: any, image: any) => {
|
48
|
-
const response = await fetch(`${BASE_URL}/verify`, {
|
49
|
-
method: 'POST',
|
50
|
-
headers: BASE_HEADER,
|
51
|
-
body: JSON.stringify({ UID, finger, image }),
|
52
|
-
});
|
53
|
-
const data = await response.json();
|
54
|
-
return data;
|
55
|
-
};
|
56
|
-
|
57
|
-
type GetConfigApi = {
|
58
|
-
id: number;
|
59
|
-
deviceModels: string[];
|
60
|
-
deviceType: string;
|
61
|
-
fps: number;
|
62
|
-
exposure: number;
|
63
|
-
zoom: number;
|
64
|
-
serviceType: string;
|
65
|
-
showButtonInfo: boolean;
|
66
|
-
}[];
|
67
|
-
|
68
|
-
export const getConfigsApi = async (): Promise<GetConfigApi> => {
|
69
|
-
const { data } = await axiosInstance.get('/configs', {
|
70
|
-
headers: {
|
71
|
-
'Content-Type': 'application/json',
|
72
|
-
'Authorization': `Bearer ${TOKEN}`,
|
73
|
-
},
|
74
|
-
});
|
75
|
-
return data.deviceParamsConfig;
|
76
|
-
};
|
77
|
-
|
78
32
|
export const verificaCPF = async (cpf: any) => {
|
79
33
|
const response = await fetch(`${BASE_URL}/validcpf`, {
|
80
|
-
method:
|
34
|
+
method: "POST",
|
81
35
|
headers: BASE_HEADER,
|
82
|
-
body: JSON.stringify({ cpf })
|
36
|
+
body: JSON.stringify({ cpf })
|
83
37
|
});
|
84
38
|
const data = await response.json();
|
85
39
|
return data;
|
86
40
|
};
|
87
41
|
|
88
|
-
export
|
89
|
-
video: { path: any },
|
90
|
-
UID: string,
|
91
|
-
vlexposure: any
|
92
|
-
) => {
|
93
|
-
const numeroAleatorio = gerarNumeroAleatorio();
|
94
|
-
|
95
|
-
const formData = new FormData();
|
96
|
-
formData.append('video', {
|
97
|
-
uri: Platform.select({
|
98
|
-
ios: video.path,
|
99
|
-
android: `file://${video.path}`,
|
100
|
-
}),
|
101
|
-
type: 'video/mp4',
|
102
|
-
name: `${UID}_${numeroAleatorio}.mp4`,
|
103
|
-
});
|
104
|
-
|
105
|
-
formData.append('video_key', numeroAleatorio);
|
106
|
-
formData.append('person_id', UID);
|
107
|
-
formData.append('exposure', vlexposure);
|
108
|
-
|
109
|
-
const response = await fetch(`${BASE_URL}/liveness`, {
|
110
|
-
method: 'POST',
|
111
|
-
headers: {
|
112
|
-
'Content-Type': 'multipart/form-data',
|
113
|
-
'Authorization': `Bearer ${TOKEN}`,
|
114
|
-
},
|
115
|
-
body: formData,
|
116
|
-
});
|
117
|
-
|
118
|
-
if (response.status === 200) {
|
119
|
-
const json = await response.json();
|
120
|
-
return json;
|
121
|
-
} else {
|
122
|
-
const errorJson = {
|
123
|
-
code: -1,
|
124
|
-
message: 'Erro, por favor, verifique e tente novamente!',
|
125
|
-
};
|
126
|
-
return errorJson;
|
127
|
-
}
|
128
|
-
};
|
129
|
-
|
130
|
-
const gerarNumeroAleatorio = () => {
|
131
|
-
const min = 10000000; // Menor número de 8 dígitos (10 milhões)
|
132
|
-
const max = 99999999; // Maior número de 8 dígitos (99 milhões 999 mil 999)
|
133
|
-
|
134
|
-
// Gera um número aleatório entre min e max
|
135
|
-
const numeroAleatorio = Math.floor(Math.random() * (max - min + 1)) + min;
|
136
|
-
|
137
|
-
// Converte o número para string
|
138
|
-
const numeroString = numeroAleatorio.toString();
|
139
|
-
|
140
|
-
return numeroString;
|
141
|
-
};
|
142
|
-
|
143
|
-
//https://api.liveid.app.br/change_configs
|
42
|
+
export { lifeCertificate, getConfigsApi, registerFingerImages, authFinger };
|
@@ -0,0 +1,129 @@
|
|
1
|
+
import axios from "axios";
|
2
|
+
import { Platform } from "react-native";
|
3
|
+
import uuid from "react-native-uuid";
|
4
|
+
import type {
|
5
|
+
GetConfigApiResponse,
|
6
|
+
LifeCertificateResponse,
|
7
|
+
LifeCertificateType,
|
8
|
+
RegisterFingerResponse,
|
9
|
+
RegisterFingerImagesType,
|
10
|
+
AuthFingerType,
|
11
|
+
AuthFingerResponse
|
12
|
+
} from "./types";
|
13
|
+
import DeviceInfo from "react-native-device-info";
|
14
|
+
|
15
|
+
const API_URL = "https://api.liveid.app.br";
|
16
|
+
const TOKEN =
|
17
|
+
"eyJhbGciOiJIUzI1NiJ9.NmU5ZmQ0MzEtOTE0Yy00Njc1LWFkYjAtZjVjNjRlZDUxNDg0.9J8eydQk5fbkH5GKdXkmXpt6wdQWyw8bsbaP5POU6YA";
|
18
|
+
|
19
|
+
const axiosInstance = axios.create({
|
20
|
+
baseURL: API_URL
|
21
|
+
});
|
22
|
+
|
23
|
+
export const getConfigsApi = async (): Promise<GetConfigApiResponse> => {
|
24
|
+
const { data } = await axiosInstance.get("/configs", {
|
25
|
+
headers: {
|
26
|
+
"Content-Type": "application/json",
|
27
|
+
Authorization: `Bearer ${TOKEN}`
|
28
|
+
}
|
29
|
+
});
|
30
|
+
return data.deviceParamsConfig;
|
31
|
+
};
|
32
|
+
|
33
|
+
export const registerFingerImages = async ({
|
34
|
+
UID,
|
35
|
+
images
|
36
|
+
}: RegisterFingerImagesType): Promise<RegisterFingerResponse> => {
|
37
|
+
try {
|
38
|
+
const finger = "DI";
|
39
|
+
const { data } = await axiosInstance.post(
|
40
|
+
"/enroll-images",
|
41
|
+
{ UID, finger, images },
|
42
|
+
{
|
43
|
+
headers: {
|
44
|
+
"Content-Type": "application/json",
|
45
|
+
Authorization: `Bearer ${TOKEN}`
|
46
|
+
}
|
47
|
+
}
|
48
|
+
);
|
49
|
+
return {
|
50
|
+
code: data.code,
|
51
|
+
message: data.message
|
52
|
+
};
|
53
|
+
} catch (error: any) {
|
54
|
+
console.error(error.response.data);
|
55
|
+
return {
|
56
|
+
code: error.response.data.code,
|
57
|
+
message: error.response.data.message
|
58
|
+
};
|
59
|
+
}
|
60
|
+
};
|
61
|
+
|
62
|
+
export const authFinger = async ({ UID, image }: AuthFingerType): Promise<AuthFingerResponse> => {
|
63
|
+
try {
|
64
|
+
const finger = "DI";
|
65
|
+
const { data } = await axiosInstance.post(
|
66
|
+
"/verify",
|
67
|
+
{ UID, finger, image },
|
68
|
+
{
|
69
|
+
headers: {
|
70
|
+
"Content-Type": "application/json",
|
71
|
+
Authorization: `Bearer ${TOKEN}`
|
72
|
+
}
|
73
|
+
}
|
74
|
+
);
|
75
|
+
console.log(data);
|
76
|
+
return {
|
77
|
+
code: data.code,
|
78
|
+
message: data.message
|
79
|
+
};
|
80
|
+
} catch (error: any) {
|
81
|
+
console.error(error.response.data);
|
82
|
+
return {
|
83
|
+
code: error.response.data.code,
|
84
|
+
message: error.response.data.message
|
85
|
+
};
|
86
|
+
}
|
87
|
+
};
|
88
|
+
|
89
|
+
export const lifeCertificate = async ({
|
90
|
+
videoPath,
|
91
|
+
exposure,
|
92
|
+
UID
|
93
|
+
}: LifeCertificateType): Promise<LifeCertificateResponse> => {
|
94
|
+
try {
|
95
|
+
const uuidv4 = uuid.v4();
|
96
|
+
const deviceModel = DeviceInfo.getModel();
|
97
|
+
const formData = new FormData();
|
98
|
+
formData.append("video", {
|
99
|
+
uri: Platform.select({
|
100
|
+
ios: videoPath,
|
101
|
+
android: `file://${videoPath}`
|
102
|
+
}),
|
103
|
+
type: "video/mp4",
|
104
|
+
name: `${UID}_${uuidv4}.mp4`
|
105
|
+
});
|
106
|
+
|
107
|
+
formData.append("video_key", uuidv4);
|
108
|
+
formData.append("person_id", UID);
|
109
|
+
formData.append("device_model", deviceModel);
|
110
|
+
formData.append("exposure", exposure);
|
111
|
+
|
112
|
+
const { data } = await axiosInstance.post("/liveness", formData, {
|
113
|
+
headers: {
|
114
|
+
"Content-Type": "multipart/form-data",
|
115
|
+
Authorization: `Bearer ${TOKEN}`
|
116
|
+
}
|
117
|
+
});
|
118
|
+
return {
|
119
|
+
code: data.code,
|
120
|
+
bpm: data.bpm
|
121
|
+
};
|
122
|
+
} catch (error: any) {
|
123
|
+
console.error(error.response.data.message);
|
124
|
+
return {
|
125
|
+
code: error.response.data.code,
|
126
|
+
message: error.response.data.message
|
127
|
+
};
|
128
|
+
}
|
129
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
export type GetConfigApiResponse = {
|
2
|
+
id: number;
|
3
|
+
deviceModels: string[];
|
4
|
+
deviceType: string;
|
5
|
+
fps: number;
|
6
|
+
exposure: number;
|
7
|
+
zoom: number;
|
8
|
+
serviceType: string;
|
9
|
+
showButtonInfo: boolean;
|
10
|
+
}[];
|
11
|
+
|
12
|
+
export type RegisterFingerImagesType = {
|
13
|
+
UID: string;
|
14
|
+
images: string[];
|
15
|
+
};
|
16
|
+
|
17
|
+
export type RegisterFingerResponse = {
|
18
|
+
code: number;
|
19
|
+
message?: string;
|
20
|
+
};
|
21
|
+
|
22
|
+
export type AuthFingerType = {
|
23
|
+
UID: string;
|
24
|
+
image: string;
|
25
|
+
};
|
26
|
+
|
27
|
+
export type AuthFingerResponse = {
|
28
|
+
code: number;
|
29
|
+
message?: string;
|
30
|
+
};
|
31
|
+
|
32
|
+
export type LifeCertificateType = {
|
33
|
+
videoPath: string;
|
34
|
+
UID: string;
|
35
|
+
exposure: number;
|
36
|
+
};
|
37
|
+
|
38
|
+
export type LifeCertificateResponse = {
|
39
|
+
code: number;
|
40
|
+
bpm?: number;
|
41
|
+
message?: string;
|
42
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { StoreApi, UseBoundStore } from "zustand";
|
2
|
+
|
3
|
+
type WithSelectors<S> = S extends { getState: () => infer T } ? S & { use: { [K in keyof T]: () => T[K] } } : never;
|
4
|
+
|
5
|
+
const createSelectors = <S extends UseBoundStore<StoreApi<object>>>(_store: S) => {
|
6
|
+
let store = _store as WithSelectors<typeof _store>;
|
7
|
+
store.use = {};
|
8
|
+
for (let k of Object.keys(store.getState())) {
|
9
|
+
(store.use as any)[k] = () => store((s) => s[k as keyof typeof s]);
|
10
|
+
}
|
11
|
+
|
12
|
+
return store;
|
13
|
+
};
|
14
|
+
|
15
|
+
export default createSelectors;
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { create } from "zustand";
|
2
|
+
import { getConfigCamera } from "../../../utils";
|
3
|
+
import { FingerAuthState, InitialState } from "./type";
|
4
|
+
import { readFile } from "react-native-fs";
|
5
|
+
import { authFinger } from "../../../services";
|
6
|
+
|
7
|
+
const initialState: InitialState = {
|
8
|
+
state: {
|
9
|
+
exposure: 0,
|
10
|
+
zoom: 0,
|
11
|
+
showButtonInfo: false,
|
12
|
+
loading: false,
|
13
|
+
code: null,
|
14
|
+
message: "",
|
15
|
+
modal: {
|
16
|
+
title: "",
|
17
|
+
message: ""
|
18
|
+
}
|
19
|
+
}
|
20
|
+
};
|
21
|
+
|
22
|
+
const getConfig = async (serviceType: "finger" | "liveness") => {
|
23
|
+
const config = await getConfigCamera(serviceType);
|
24
|
+
slice.setState((state) => ({
|
25
|
+
state: {
|
26
|
+
...state.state,
|
27
|
+
...config
|
28
|
+
}
|
29
|
+
}));
|
30
|
+
};
|
31
|
+
|
32
|
+
const setModal = (title: string, message: string) => {
|
33
|
+
slice.setState((state) => ({
|
34
|
+
state: {
|
35
|
+
...state.state,
|
36
|
+
modal: {
|
37
|
+
title,
|
38
|
+
message
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}));
|
42
|
+
};
|
43
|
+
|
44
|
+
const handleLoading = () => {
|
45
|
+
slice.setState((state) => ({
|
46
|
+
state: {
|
47
|
+
...state.state,
|
48
|
+
loading: !state.state.loading
|
49
|
+
}
|
50
|
+
}));
|
51
|
+
};
|
52
|
+
|
53
|
+
const sendImage = async (imagePath: string, UID: string) => {
|
54
|
+
try {
|
55
|
+
handleLoading();
|
56
|
+
const convertedImage = await readFile(imagePath, "base64");
|
57
|
+
const response = await authFinger({ UID, image: convertedImage });
|
58
|
+
slice.setState((state) => ({
|
59
|
+
state: {
|
60
|
+
...state.state,
|
61
|
+
message: response.message ?? "",
|
62
|
+
code: response.code
|
63
|
+
}
|
64
|
+
}));
|
65
|
+
} catch (error) {
|
66
|
+
console.error("error:", error);
|
67
|
+
}
|
68
|
+
};
|
69
|
+
|
70
|
+
const resetState = () => {
|
71
|
+
slice.setState((state) => ({
|
72
|
+
state: {
|
73
|
+
...state.state,
|
74
|
+
code: null,
|
75
|
+
message: ""
|
76
|
+
}
|
77
|
+
}));
|
78
|
+
};
|
79
|
+
|
80
|
+
const slice = create<FingerAuthState>(() => ({
|
81
|
+
...initialState,
|
82
|
+
dispatch: {
|
83
|
+
getConfig,
|
84
|
+
sendImage,
|
85
|
+
resetState,
|
86
|
+
handleLoading,
|
87
|
+
setModal
|
88
|
+
}
|
89
|
+
}));
|
90
|
+
|
91
|
+
export default slice;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
type State = {
|
2
|
+
exposure: number;
|
3
|
+
zoom: number;
|
4
|
+
showButtonInfo: boolean;
|
5
|
+
loading: boolean;
|
6
|
+
code: null | number;
|
7
|
+
message: string;
|
8
|
+
modal: {
|
9
|
+
title: string;
|
10
|
+
message: string;
|
11
|
+
};
|
12
|
+
};
|
13
|
+
|
14
|
+
type Dispatch = {
|
15
|
+
getConfig: (serviceType: "finger" | "liveness") => void;
|
16
|
+
handleLoading: () => void;
|
17
|
+
sendImage: (imagePath: string, UID: string) => void;
|
18
|
+
resetState: () => void;
|
19
|
+
setModal: (title: string, message: string) => void;
|
20
|
+
};
|
21
|
+
|
22
|
+
export type InitialState = {
|
23
|
+
state: State;
|
24
|
+
};
|
25
|
+
|
26
|
+
export type FingerAuthState = {
|
27
|
+
state: State;
|
28
|
+
dispatch: Dispatch;
|
29
|
+
};
|