@ha_tecno/live-id-sdk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +323 -0
  3. package/android/build.gradle +94 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +4 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/liveidsdk/LiveIdSdkModule.kt +25 -0
  8. package/android/src/main/java/com/liveidsdk/LiveIdSdkPackage.kt +17 -0
  9. package/ios/LiveIdSdk-Bridging-Header.h +2 -0
  10. package/ios/LiveIdSdk.mm +14 -0
  11. package/ios/LiveIdSdk.swift +8 -0
  12. package/lib/commonjs/assets/arrow.png +0 -0
  13. package/lib/commonjs/assets/exampleInstructionWithBorder.jpeg +0 -0
  14. package/lib/commonjs/assets/exampleInstructionWithoutFinger.jpeg +0 -0
  15. package/lib/commonjs/assets/ic_redness_capture_tip.png +0 -0
  16. package/lib/commonjs/assets/logo.png +0 -0
  17. package/lib/commonjs/components/CameraConfigInfos/index.js +21 -0
  18. package/lib/commonjs/components/CameraConfigInfos/index.js.map +1 -0
  19. package/lib/commonjs/components/CameraConfigInfos/styles.js +19 -0
  20. package/lib/commonjs/components/CameraConfigInfos/styles.js.map +1 -0
  21. package/lib/commonjs/components/DeviceNullDisplay/index.js +59 -0
  22. package/lib/commonjs/components/DeviceNullDisplay/index.js.map +1 -0
  23. package/lib/commonjs/components/ErrorDisplay/index.js +59 -0
  24. package/lib/commonjs/components/ErrorDisplay/index.js.map +1 -0
  25. package/lib/commonjs/components/Gabarito/index.js +19 -0
  26. package/lib/commonjs/components/Gabarito/index.js.map +1 -0
  27. package/lib/commonjs/components/Gabarito/styles.js +30 -0
  28. package/lib/commonjs/components/Gabarito/styles.js.map +1 -0
  29. package/lib/commonjs/components/Toast/Toast.js +66 -0
  30. package/lib/commonjs/components/Toast/Toast.js.map +1 -0
  31. package/lib/commonjs/components/WaitingForResult/index.js +24 -0
  32. package/lib/commonjs/components/WaitingForResult/index.js.map +1 -0
  33. package/lib/commonjs/components/WaitingForResult/styles.js +32 -0
  34. package/lib/commonjs/components/WaitingForResult/styles.js.map +1 -0
  35. package/lib/commonjs/index.js +34 -0
  36. package/lib/commonjs/index.js.map +1 -0
  37. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js +49 -0
  38. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js.map +1 -0
  39. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/styles.js +62 -0
  40. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +1 -0
  41. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js +298 -0
  42. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js.map +1 -0
  43. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js +54 -0
  44. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js.map +1 -0
  45. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js +44 -0
  46. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +1 -0
  47. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +65 -0
  48. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +1 -0
  49. package/lib/commonjs/screens/CadastroFinger/index.js +50 -0
  50. package/lib/commonjs/screens/CadastroFinger/index.js.map +1 -0
  51. package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js +186 -0
  52. package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js.map +1 -0
  53. package/lib/commonjs/screens/ProvaVidas/index.js +246 -0
  54. package/lib/commonjs/screens/ProvaVidas/index.js.map +1 -0
  55. package/lib/commonjs/screens/ProvaVidas/styles.js +93 -0
  56. package/lib/commonjs/screens/ProvaVidas/styles.js.map +1 -0
  57. package/lib/commonjs/screens/ValidadeFinger/index.js +216 -0
  58. package/lib/commonjs/screens/ValidadeFinger/index.js.map +1 -0
  59. package/lib/commonjs/screens/ValidadeFinger/styles.js +54 -0
  60. package/lib/commonjs/screens/ValidadeFinger/styles.js.map +1 -0
  61. package/lib/commonjs/services/index.js +145 -0
  62. package/lib/commonjs/services/index.js.map +1 -0
  63. package/lib/commonjs/types/screen.js +2 -0
  64. package/lib/commonjs/types/screen.js.map +1 -0
  65. package/lib/commonjs/utils/file.js +38 -0
  66. package/lib/commonjs/utils/file.js.map +1 -0
  67. package/lib/commonjs/utils/getConfigCamera.js +25 -0
  68. package/lib/commonjs/utils/getConfigCamera.js.map +1 -0
  69. package/lib/commonjs/utils/index.js +14 -0
  70. package/lib/commonjs/utils/index.js.map +1 -0
  71. package/lib/module/assets/arrow.png +0 -0
  72. package/lib/module/assets/exampleInstructionWithBorder.jpeg +0 -0
  73. package/lib/module/assets/exampleInstructionWithoutFinger.jpeg +0 -0
  74. package/lib/module/assets/ic_redness_capture_tip.png +0 -0
  75. package/lib/module/assets/logo.png +0 -0
  76. package/lib/module/components/CameraConfigInfos/index.js +13 -0
  77. package/lib/module/components/CameraConfigInfos/index.js.map +1 -0
  78. package/lib/module/components/CameraConfigInfos/styles.js +13 -0
  79. package/lib/module/components/CameraConfigInfos/styles.js.map +1 -0
  80. package/lib/module/components/DeviceNullDisplay/index.js +51 -0
  81. package/lib/module/components/DeviceNullDisplay/index.js.map +1 -0
  82. package/lib/module/components/ErrorDisplay/index.js +51 -0
  83. package/lib/module/components/ErrorDisplay/index.js.map +1 -0
  84. package/lib/module/components/Gabarito/index.js +11 -0
  85. package/lib/module/components/Gabarito/index.js.map +1 -0
  86. package/lib/module/components/Gabarito/styles.js +24 -0
  87. package/lib/module/components/Gabarito/styles.js.map +1 -0
  88. package/lib/module/components/Toast/Toast.js +58 -0
  89. package/lib/module/components/Toast/Toast.js.map +1 -0
  90. package/lib/module/components/WaitingForResult/index.js +17 -0
  91. package/lib/module/components/WaitingForResult/index.js.map +1 -0
  92. package/lib/module/components/WaitingForResult/styles.js +26 -0
  93. package/lib/module/components/WaitingForResult/styles.js.map +1 -0
  94. package/lib/module/index.js +7 -0
  95. package/lib/module/index.js.map +1 -0
  96. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/index.js +41 -0
  97. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/index.js.map +1 -0
  98. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js +56 -0
  99. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +1 -0
  100. package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js +288 -0
  101. package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js.map +1 -0
  102. package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js +48 -0
  103. package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js.map +1 -0
  104. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js +36 -0
  105. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +1 -0
  106. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +59 -0
  107. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +1 -0
  108. package/lib/module/screens/CadastroFinger/index.js +42 -0
  109. package/lib/module/screens/CadastroFinger/index.js.map +1 -0
  110. package/lib/module/screens/CadastroScreen/CadastroScreen.js +177 -0
  111. package/lib/module/screens/CadastroScreen/CadastroScreen.js.map +1 -0
  112. package/lib/module/screens/ProvaVidas/index.js +239 -0
  113. package/lib/module/screens/ProvaVidas/index.js.map +1 -0
  114. package/lib/module/screens/ProvaVidas/styles.js +87 -0
  115. package/lib/module/screens/ProvaVidas/styles.js.map +1 -0
  116. package/lib/module/screens/ValidadeFinger/index.js +206 -0
  117. package/lib/module/screens/ValidadeFinger/index.js.map +1 -0
  118. package/lib/module/screens/ValidadeFinger/styles.js +48 -0
  119. package/lib/module/screens/ValidadeFinger/styles.js.map +1 -0
  120. package/lib/module/services/index.js +131 -0
  121. package/lib/module/services/index.js.map +1 -0
  122. package/lib/module/types/screen.js +2 -0
  123. package/lib/module/types/screen.js.map +1 -0
  124. package/lib/module/utils/file.js +29 -0
  125. package/lib/module/utils/file.js.map +1 -0
  126. package/lib/module/utils/getConfigCamera.js +19 -0
  127. package/lib/module/utils/getConfigCamera.js.map +1 -0
  128. package/lib/module/utils/index.js +3 -0
  129. package/lib/module/utils/index.js.map +1 -0
  130. package/lib/typescript/src/components/CameraConfigInfos/index.d.ts +9 -0
  131. package/lib/typescript/src/components/CameraConfigInfos/index.d.ts.map +1 -0
  132. package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts +11 -0
  133. package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts.map +1 -0
  134. package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts +11 -0
  135. package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts.map +1 -0
  136. package/lib/typescript/src/components/ErrorDisplay/index.d.ts +11 -0
  137. package/lib/typescript/src/components/ErrorDisplay/index.d.ts.map +1 -0
  138. package/lib/typescript/src/components/Gabarito/index.d.ts +3 -0
  139. package/lib/typescript/src/components/Gabarito/index.d.ts.map +1 -0
  140. package/lib/typescript/src/components/Gabarito/styles.d.ts +21 -0
  141. package/lib/typescript/src/components/Gabarito/styles.d.ts.map +1 -0
  142. package/lib/typescript/src/components/Toast/Toast.d.ts +42 -0
  143. package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -0
  144. package/lib/typescript/src/components/WaitingForResult/index.d.ts +7 -0
  145. package/lib/typescript/src/components/WaitingForResult/index.d.ts.map +1 -0
  146. package/lib/typescript/src/components/WaitingForResult/styles.d.ts +24 -0
  147. package/lib/typescript/src/components/WaitingForResult/styles.d.ts.map +1 -0
  148. package/lib/typescript/src/index.d.ts +5 -0
  149. package/lib/typescript/src/index.d.ts.map +1 -0
  150. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts +7 -0
  151. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts.map +1 -0
  152. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/styles.d.ts +55 -0
  153. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/styles.d.ts.map +1 -0
  154. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts +16 -0
  155. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts.map +1 -0
  156. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts +44 -0
  157. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts.map +1 -0
  158. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts +12 -0
  159. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts.map +1 -0
  160. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts +54 -0
  161. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts.map +1 -0
  162. package/lib/typescript/src/screens/CadastroFinger/index.d.ts +16 -0
  163. package/lib/typescript/src/screens/CadastroFinger/index.d.ts.map +1 -0
  164. package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts +14 -0
  165. package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts.map +1 -0
  166. package/lib/typescript/src/screens/ProvaVidas/index.d.ts +14 -0
  167. package/lib/typescript/src/screens/ProvaVidas/index.d.ts.map +1 -0
  168. package/lib/typescript/src/screens/ProvaVidas/styles.d.ts +85 -0
  169. package/lib/typescript/src/screens/ProvaVidas/styles.d.ts.map +1 -0
  170. package/lib/typescript/src/screens/ValidadeFinger/index.d.ts +14 -0
  171. package/lib/typescript/src/screens/ValidadeFinger/index.d.ts.map +1 -0
  172. package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts +44 -0
  173. package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts.map +1 -0
  174. package/lib/typescript/src/services/index.d.ts +21 -0
  175. package/lib/typescript/src/services/index.d.ts.map +1 -0
  176. package/lib/typescript/src/types/screen.d.ts +6 -0
  177. package/lib/typescript/src/types/screen.d.ts.map +1 -0
  178. package/lib/typescript/src/utils/file.d.ts +3 -0
  179. package/lib/typescript/src/utils/file.d.ts.map +1 -0
  180. package/lib/typescript/src/utils/getConfigCamera.d.ts +14 -0
  181. package/lib/typescript/src/utils/getConfigCamera.d.ts.map +1 -0
  182. package/lib/typescript/src/utils/index.d.ts +3 -0
  183. package/lib/typescript/src/utils/index.d.ts.map +1 -0
  184. package/live-id-sdk.podspec +41 -0
  185. package/package.json +184 -0
  186. package/src/assets/arrow.png +0 -0
  187. package/src/assets/exampleInstructionWithBorder.jpeg +0 -0
  188. package/src/assets/exampleInstructionWithoutFinger.jpeg +0 -0
  189. package/src/assets/ic_redness_capture_tip.png +0 -0
  190. package/src/assets/logo.png +0 -0
  191. package/src/components/CameraConfigInfos/index.tsx +25 -0
  192. package/src/components/CameraConfigInfos/styles.ts +13 -0
  193. package/src/components/DeviceNullDisplay/index.tsx +59 -0
  194. package/src/components/ErrorDisplay/index.tsx +60 -0
  195. package/src/components/Gabarito/index.tsx +11 -0
  196. package/src/components/Gabarito/styles.ts +23 -0
  197. package/src/components/Toast/Toast.tsx +61 -0
  198. package/src/components/WaitingForResult/index.tsx +22 -0
  199. package/src/components/WaitingForResult/styles.ts +27 -0
  200. package/src/index.tsx +6 -0
  201. package/src/screens/CadastroFinger/components/AjudaCadastro/index.tsx +49 -0
  202. package/src/screens/CadastroFinger/components/AjudaCadastro/styles.ts +56 -0
  203. package/src/screens/CadastroFinger/components/CameraCadastro/index.tsx +356 -0
  204. package/src/screens/CadastroFinger/components/CameraCadastro/styles.ts +47 -0
  205. package/src/screens/CadastroFinger/components/ImageDisplayScreen/index.tsx +45 -0
  206. package/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.ts +55 -0
  207. package/src/screens/CadastroFinger/index.tsx +56 -0
  208. package/src/screens/CadastroScreen/CadastroScreen.tsx +212 -0
  209. package/src/screens/ProvaVidas/index.tsx +308 -0
  210. package/src/screens/ProvaVidas/styles.ts +99 -0
  211. package/src/screens/ValidadeFinger/index.tsx +263 -0
  212. package/src/screens/ValidadeFinger/styles.ts +47 -0
  213. package/src/services/index.ts +143 -0
  214. package/src/types/screen.ts +5 -0
  215. package/src/utils/file.ts +30 -0
  216. package/src/utils/getConfigCamera.ts +45 -0
  217. package/src/utils/index.ts +3 -0
@@ -0,0 +1,177 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ /* eslint-disable react-native/no-inline-styles */
3
+ import React, { useEffect, useState } from 'react';
4
+ import { View, Text, TextInput, TouchableOpacity, StyleSheet, Alert, Image } from 'react-native';
5
+ import { cadastro } from '../../services';
6
+ import Modal from 'react-native-modal';
7
+ export const CadastroScreen = ({
8
+ isVisible = false,
9
+ onCloseModal,
10
+ onError,
11
+ onSuccess,
12
+ ModalParams
13
+ }) => {
14
+ const [cpf, setCpf] = useState('');
15
+ const [nome, setNome] = useState('');
16
+ const [senha, setSenha] = useState('');
17
+ const [confirmarSenha, setConfirmarSenha] = useState('');
18
+ const generateRandomElevenDigits = () => {
19
+ let cpf = '';
20
+ for (let i = 0; i < 11; i++) {
21
+ cpf += Math.floor(Math.random() * 9);
22
+ }
23
+ return cpf;
24
+ };
25
+ const generateRandomName = () => {
26
+ // uma strin aleatória de 10 caracteres a 14 caracteres
27
+ let name = '';
28
+ const length = Math.floor(Math.random() * 5) + 10;
29
+ for (let i = 0; i < length; i++) {
30
+ name += String.fromCharCode(Math.floor(Math.random() * 26) + 97);
31
+ }
32
+ return name;
33
+ };
34
+ useEffect(() => {
35
+ generateRnadomUser();
36
+ }, []);
37
+ const generateRnadomUser = () => {
38
+ setCpf(generateRandomElevenDigits());
39
+ setNome(generateRandomName());
40
+ setSenha('123');
41
+ setConfirmarSenha('123');
42
+ };
43
+ const handleCadastro = async () => {
44
+ try {
45
+ if (senha === confirmarSenha) {
46
+ const response = await cadastro(cpf, nome, senha);
47
+ console.log(response);
48
+ var jsonString = JSON.stringify(response);
49
+ onSuccess && onSuccess(response);
50
+ onCloseModalHandler();
51
+ if (jsonString.includes('person_id')) {
52
+ if (response.finger === false) {
53
+ // openModal({
54
+ // type: 'ajuda',
55
+ // screenProps: {
56
+ // id: response.person_id,
57
+ // },
58
+ // });
59
+ } else {
60
+ // openModal({
61
+ // type: 'login',
62
+ // });
63
+ }
64
+ } else if (jsonString.includes('User exists')) {
65
+ Alert.alert('Usuário já cadastrado!');
66
+ // openModal({
67
+ // type: 'login',
68
+ // });
69
+ } else if (jsonString.includes('erro')) {
70
+ Alert.alert('Usuário não cadastrado', 'Por favor, cadastre-se!');
71
+ } else {
72
+ Alert.alert('Erro', 'Ocorreu um erro ao fazer o Cadastro. Por favor, tente novamente mais tarde.');
73
+ }
74
+ } else {
75
+ Alert.alert('Erro', 'As senhas não coincidem. Por favor, tente novamente.');
76
+ return;
77
+ }
78
+ } catch (error) {
79
+ onError && onError(error);
80
+ console.error(error);
81
+ }
82
+ };
83
+ const onCloseModalHandler = () => {
84
+ onCloseModal && onCloseModal();
85
+ generateRnadomUser();
86
+ };
87
+ return /*#__PURE__*/React.createElement(Modal, _extends({
88
+ style: {
89
+ margin: 0
90
+ },
91
+ isVisible: isVisible,
92
+ swipeDirection: "down",
93
+ propagateSwipe: true,
94
+ onSwipeComplete: onCloseModalHandler
95
+ }, ModalParams), /*#__PURE__*/React.createElement(View, {
96
+ style: styles.container
97
+ }, /*#__PURE__*/React.createElement(Image, {
98
+ source: require('../../assets/logo.png'),
99
+ style: styles.logo
100
+ }), /*#__PURE__*/React.createElement(Text, {
101
+ style: styles.title
102
+ }, "Cadastro de usu\xE1rio"), /*#__PURE__*/React.createElement(TextInput, {
103
+ style: styles.input,
104
+ placeholder: "CPF",
105
+ placeholderTextColor: "#000",
106
+ keyboardType: "numeric",
107
+ value: cpf,
108
+ onChangeText: setCpf
109
+ }), /*#__PURE__*/React.createElement(TextInput, {
110
+ style: styles.input,
111
+ placeholder: "Nome",
112
+ placeholderTextColor: "#000",
113
+ value: nome,
114
+ onChangeText: setNome
115
+ }), /*#__PURE__*/React.createElement(TextInput, {
116
+ style: styles.input,
117
+ placeholder: "Digite a senha",
118
+ placeholderTextColor: "#000",
119
+ secureTextEntry: true,
120
+ value: senha,
121
+ onChangeText: text => setSenha(text)
122
+ }), /*#__PURE__*/React.createElement(TextInput, {
123
+ style: styles.input,
124
+ placeholderTextColor: "#000",
125
+ placeholder: "Digite a senha novamente",
126
+ secureTextEntry: true,
127
+ value: confirmarSenha,
128
+ onChangeText: text => setConfirmarSenha(text)
129
+ }), /*#__PURE__*/React.createElement(TouchableOpacity, {
130
+ style: styles.button,
131
+ onPress: handleCadastro
132
+ }, /*#__PURE__*/React.createElement(Text, {
133
+ style: styles.buttonText
134
+ }, "Cadastrar"))));
135
+ };
136
+ const styles = StyleSheet.create({
137
+ container: {
138
+ flex: 1,
139
+ alignItems: 'center',
140
+ justifyContent: 'center',
141
+ backgroundColor: '#fff'
142
+ },
143
+ title: {
144
+ fontSize: 24,
145
+ marginBottom: 16,
146
+ color: '#00bfff'
147
+ },
148
+ input: {
149
+ width: '80%',
150
+ height: 50,
151
+ padding: 10,
152
+ borderWidth: 1,
153
+ borderColor: '#ccc',
154
+ borderRadius: 4,
155
+ marginBottom: 16,
156
+ fontSize: 16,
157
+ color: '#000'
158
+ },
159
+ button: {
160
+ width: '80%',
161
+ height: 50,
162
+ backgroundColor: '#00bfff',
163
+ borderRadius: 4,
164
+ alignItems: 'center',
165
+ justifyContent: 'center'
166
+ },
167
+ buttonText: {
168
+ fontSize: 16,
169
+ color: '#fff'
170
+ },
171
+ logo: {
172
+ width: 500,
173
+ height: 250,
174
+ resizeMode: 'contain'
175
+ }
176
+ });
177
+ //# sourceMappingURL=CadastroScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useEffect","useState","View","Text","TextInput","TouchableOpacity","StyleSheet","Alert","Image","cadastro","Modal","CadastroScreen","isVisible","onCloseModal","onError","onSuccess","ModalParams","cpf","setCpf","nome","setNome","senha","setSenha","confirmarSenha","setConfirmarSenha","generateRandomElevenDigits","i","Math","floor","random","generateRandomName","name","length","String","fromCharCode","generateRnadomUser","handleCadastro","response","console","log","jsonString","JSON","stringify","onCloseModalHandler","includes","finger","alert","error","createElement","_extends","style","margin","swipeDirection","propagateSwipe","onSwipeComplete","styles","container","source","require","logo","title","input","placeholder","placeholderTextColor","keyboardType","value","onChangeText","secureTextEntry","text","button","onPress","buttonText","create","flex","alignItems","justifyContent","backgroundColor","fontSize","marginBottom","color","width","height","padding","borderWidth","borderColor","borderRadius","resizeMode"],"sourceRoot":"../../../../src","sources":["screens/CadastroScreen/CadastroScreen.tsx"],"mappings":";AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SACEC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACLC,KAAK,QACA,cAAc;AACrB,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,KAAK,MAA2B,oBAAoB;AAa3D,OAAO,MAAMC,cAA6C,GAAGA,CAAC;EAC5DC,SAAS,GAAG,KAAK;EACjBC,YAAY;EACZC,OAAO;EACPC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,GAAG,EAAEC,MAAM,CAAC,GAAGjB,QAAQ,CAAC,EAAE,CAAC;EAClC,MAAM,CAACkB,IAAI,EAAEC,OAAO,CAAC,GAAGnB,QAAQ,CAAC,EAAE,CAAC;EACpC,MAAM,CAACoB,KAAK,EAAEC,QAAQ,CAAC,GAAGrB,QAAQ,CAAC,EAAE,CAAC;EACtC,MAAM,CAACsB,cAAc,EAAEC,iBAAiB,CAAC,GAAGvB,Q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;AACF,CAAC,CAAC"}
@@ -0,0 +1,239 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ /* eslint-disable react-native/no-inline-styles */
3
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
4
+ import { Text, View, TouchableOpacity, Button } from 'react-native';
5
+ import { Camera, useCameraDevice, useCameraFormat } from 'react-native-vision-camera';
6
+ import Modal from 'react-native-modal';
7
+ import { Toast } from '../../components/Toast/Toast';
8
+ import { provaVida } from '../../services';
9
+ import { getConfigCamera } from '../../utils';
10
+ import { Alert } from 'react-native';
11
+ import { Platform } from 'react-native';
12
+ import Orientation from 'react-native-orientation-locker';
13
+ import { WaitingForResult } from '../../components/WaitingForResult';
14
+ import { ErrorDisplay } from '../../components/ErrorDisplay';
15
+ import { DeviceNullDisplay } from '../../components/DeviceNullDisplay';
16
+ import { styles } from './styles';
17
+ import { CameraConfigInfos } from '../../components/CameraConfigInfos';
18
+ const IS_IOS = Platform.OS === 'ios';
19
+ export const CameraProvaVidas = ({
20
+ isVisible = false,
21
+ onCloseModal,
22
+ onError,
23
+ onSuccess,
24
+ ModalParams,
25
+ screenProps
26
+ }) => {
27
+ const id = screenProps === null || screenProps === void 0 ? void 0 : screenProps.id;
28
+ const camera = useRef(null);
29
+ const [showOverlay, setShowOverlay] = useState(false);
30
+ const [intervalState, setIntervalState] = useState(null);
31
+ const [timer, setTimer] = useState(0);
32
+ const [load, setLoad] = useState(false);
33
+ const [stateToastBpm, setStateToastBpm] = useState({
34
+ message: '',
35
+ visible: false
36
+ });
37
+ const [isRecording, setIsRecording] = useState(false);
38
+ const [cameraConfigs, setCameraConfigs] = useState();
39
+
40
+ // mantem a tela em modo portrait
41
+ useEffect(() => {
42
+ Orientation.lockToPortrait();
43
+ return () => {
44
+ Orientation.unlockAllOrientations();
45
+ };
46
+ }, []);
47
+
48
+ // Pega a permissão da camera do dispositivo
49
+ const requestCameraPermission = useCallback(async () => {
50
+ try {
51
+ await Camera.requestCameraPermission();
52
+ } catch (error) {}
53
+ }, []);
54
+
55
+ // pra garantir que a permissão da camera seja solicitada
56
+ useEffect(() => {
57
+ requestCameraPermission();
58
+ }, [requestCameraPermission]);
59
+ useEffect(() => {
60
+ getConfigCamera('liveness').then(config => {
61
+ setCameraConfigs(config);
62
+ }).catch(error => {
63
+ console.error(error);
64
+ });
65
+ }, []);
66
+ const device = useCameraDevice('back', {
67
+ physicalDevices: ['wide-angle-camera']
68
+ });
69
+ const cameraFormat = useCameraFormat(device, [{
70
+ videoResolution: {
71
+ height: 1280,
72
+ width: 720
73
+ }
74
+ }]);
75
+
76
+ // Envia o arquivo para a api
77
+ const sendFile = useCallback(async file => {
78
+ setLoad(true);
79
+ if (!id) return Alert.alert('Erro ao enviar o arquivo ( id error ), tente novamente mais tarde');
80
+ let req = await provaVida(file, id, cameraConfigs === null || cameraConfigs === void 0 ? void 0 : cameraConfigs.exposure);
81
+ if (req.code === 0 && req.bpm >= 0) {
82
+ setShowOverlay(false);
83
+ const optionsToast = {
84
+ message: `Seu batimento esta em: ${req.bpm}.\n Prova de vida concluida !`,
85
+ visible: true
86
+ };
87
+ setStateToastBpm(optionsToast);
88
+ onSuccess && onSuccess(req);
89
+ } else {
90
+ Alert.alert(req.message);
91
+ onError && onError(req);
92
+ }
93
+ setLoad(false);
94
+ setShowOverlay(false);
95
+ return;
96
+ }, [cameraConfigs === null || cameraConfigs === void 0 ? void 0 : cameraConfigs.exposure, id, onError, onSuccess]);
97
+
98
+ // Limpa tudo
99
+ useEffect(() => {
100
+ return () => {
101
+ // limpa tudo
102
+ setTimer(0);
103
+ setIsRecording(false);
104
+ setLoad(false);
105
+ setStateToastBpm({
106
+ message: '',
107
+ visible: false
108
+ });
109
+ };
110
+ }, []);
111
+
112
+ // Limpa o intervalo do timer
113
+ useEffect(() => {
114
+ if (timer < 0) {
115
+ if (!intervalState) return;
116
+ clearInterval(intervalState);
117
+ stopRecodingVideo();
118
+ }
119
+ }, [timer, intervalState]);
120
+
121
+ // Função para iniciar a gravação do video na referencia da camera
122
+ const startVideoRecording = useCallback(() => {
123
+ var _camera$current;
124
+ setIsRecording(true);
125
+ (_camera$current = camera.current) === null || _camera$current === void 0 || _camera$current.startRecording({
126
+ fileType: 'mp4',
127
+ onRecordingFinished: video => sendFile(video),
128
+ onRecordingError: error => console.error(error)
129
+ });
130
+ }, [sendFile]);
131
+
132
+ // Inicia a gravação do video
133
+ const recordingVideo = useCallback(async () => {
134
+ startVideoRecording();
135
+ setTimer(10);
136
+ setLoad(true);
137
+ setIntervalState(setInterval(() => {
138
+ setTimer(prevTimer => prevTimer - 1); // Update the timer state
139
+ }, 1000));
140
+ }, [startVideoRecording]);
141
+
142
+ // Para a gravação do video
143
+ const stopRecodingVideo = async () => {
144
+ var _camera$current2;
145
+ setIsRecording(false);
146
+ await ((_camera$current2 = camera.current) === null || _camera$current2 === void 0 ? void 0 : _camera$current2.stopRecording());
147
+ setShowOverlay(true);
148
+ return;
149
+ };
150
+
151
+ // Fecha o modal
152
+ const onCloseModalHandler = () => {
153
+ resetScreenStatesAndCamera();
154
+ onCloseModal && onCloseModal();
155
+ };
156
+
157
+ // Limpa os estados da tela e a camera
158
+ const resetScreenStatesAndCamera = () => {
159
+ setTimer(0);
160
+ setIsRecording(false);
161
+ setShowOverlay(false);
162
+ setLoad(false);
163
+ setStateToastBpm({
164
+ message: '',
165
+ visible: false
166
+ });
167
+ };
168
+ if (!screenProps && isVisible) {
169
+ return /*#__PURE__*/React.createElement(ErrorDisplay, {
170
+ isVisible: isVisible,
171
+ modalParams: ModalParams,
172
+ onCloseModalHandler: onCloseModalHandler,
173
+ requestCameraPermission: requestCameraPermission
174
+ });
175
+ }
176
+ if (device == null) {
177
+ return /*#__PURE__*/React.createElement(DeviceNullDisplay, {
178
+ isVisible: isVisible,
179
+ modalParams: ModalParams,
180
+ onCloseModalHandler: onCloseModalHandler,
181
+ requestCameraPermission: requestCameraPermission
182
+ });
183
+ }
184
+ return /*#__PURE__*/React.createElement(Modal, _extends({
185
+ style: {
186
+ margin: 0
187
+ },
188
+ isVisible: isVisible,
189
+ swipeDirection: "down",
190
+ propagateSwipe: true,
191
+ onSwipeComplete: onCloseModalHandler
192
+ }, ModalParams), /*#__PURE__*/React.createElement(View, {
193
+ style: styles.container
194
+ }, showOverlay && /*#__PURE__*/React.createElement(WaitingForResult, {
195
+ onPress: () => {
196
+ setShowOverlay(false);
197
+ }
198
+ }), /*#__PURE__*/React.createElement(Toast, {
199
+ message: stateToastBpm.message,
200
+ isVisible: stateToastBpm.visible,
201
+ onClose: onCloseModalHandler
202
+ }), /*#__PURE__*/React.createElement(View, {
203
+ style: styles.containerCamera
204
+ }, /*#__PURE__*/React.createElement(Camera, {
205
+ ref: camera,
206
+ style: styles.subContainer,
207
+ isActive: true,
208
+ device: device,
209
+ video: true,
210
+ torch: 'on',
211
+ format: cameraFormat,
212
+ exposure: cameraConfigs === null || cameraConfigs === void 0 ? void 0 : cameraConfigs.exposure,
213
+ zoom: cameraConfigs === null || cameraConfigs === void 0 ? void 0 : cameraConfigs.zoom
214
+ }), /*#__PURE__*/React.createElement(View, {
215
+ style: styles.cameraView
216
+ }), /*#__PURE__*/React.createElement(View, {
217
+ style: styles.containerTouch
218
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
219
+ onPress: () => recordingVideo(),
220
+ disabled: isRecording || load
221
+ }, /*#__PURE__*/React.createElement(View, {
222
+ style: styles.containerText
223
+ }, /*#__PURE__*/React.createElement(Text, {
224
+ style: styles.textRecording
225
+ }, isRecording ? `Aguarde ${timer} segundos` : load ? 'Processando...' : 'Medir Batimentos')))), /*#__PURE__*/React.createElement(View, {
226
+ style: {
227
+ marginBottom: IS_IOS ? 48 : 0
228
+ }
229
+ }, /*#__PURE__*/React.createElement(CameraConfigInfos, {
230
+ exposure: cameraConfigs === null || cameraConfigs === void 0 ? void 0 : cameraConfigs.exposure,
231
+ zoom: cameraConfigs === null || cameraConfigs === void 0 ? void 0 : cameraConfigs.zoom,
232
+ showButtonInfo: cameraConfigs === null || cameraConfigs === void 0 ? void 0 : cameraConfigs.showButtonInfo
233
+ }), /*#__PURE__*/React.createElement(Button, {
234
+ disabled: load,
235
+ title: "Fechar Camera",
236
+ onPress: onCloseModalHandler
237
+ })))));
238
+ };
239
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","useEffect","useRef","useState","Text","View","TouchableOpacity","Button","Camera","useCameraDevice","useCameraFormat","Modal","Toast","provaVida","getConfigCamera","Alert","Platform","Orientation","WaitingForResult","ErrorDisplay","DeviceNullDisplay","styles","CameraConfigInfos","IS_IOS","OS","CameraProvaVidas","isVisible","onCloseModal","onError","onSuccess","ModalParams","screenProps","id","camera","showOverlay","setShowOverlay","intervalState","setIntervalState","timer","setTimer","load","setLoad","stateToastBpm","setStateToastBpm","message","visible","isRecording","setIsRecording","cameraConfigs","setCameraConfigs","lockToPortrait","unlockAllOrientations","requestCameraPermission","error","then","config","catch","console","device","physicalDevices","cameraFormat","videoResolution","height","width","sendFile","file","alert","req","exposure","code","bpm","optionsToast","clearInterval","stopRecodingVideo","startVideoRecording","_camera$current","current","startRecording","fileType","onRecordingFinished","video","onRecordingError","recordingVideo","setInterval","prevTimer","_camera$current2","stopRecording","onCloseModalHandler","resetScreenStatesAndCamera","createElement","modalParams","_extends","style","margin","swipeDirection","propagateSwipe","onSwipeComplete","container","onPress","onClose","containerCamera","ref","subContainer","isActive","torch","format","zoom","cameraView","containerTouch","disabled","containerText","textRecording","marginBottom","showButtonInfo","title"],"sourceRoot":"../../../../src","sources":["screens/ProvaVidas/index.tsx"],"mappings":";AAAA;AACA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACvE,SAASC,IAAI,EAAEC,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,GAC3BE,IAAI,GACJ,gBAAgB,GAChB,kBACA,CACF,CACU,CACd,CAAC,eACPzC,KAAA,CAAA0F,aAAA,CAACpF,IAAI;IACHuF,KAAK,EAAE;MACLoB,YAAY,EAAEzF,MAAM,GAAG,EAAE,GAAG;IAC9B;EAAE,gBAEFxB,KAAA,CAAA0F,aAAA,CAACnE,iBAAiB;IAChB8C,QAAQ,EAAEpB,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEoB,QAAS;IAClCsC,IAAI,EAAE1D,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAE0D,IAAK;IAC1BO,cAAc,EAAEjE,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEiE;EAAe,CAC/C,CAAC,eACFlH,KAAA,CAAA0F,aAAA,CAAClF,MAAM;IACLsG,QAAQ,EAAErE,IAAK;IACf0E,KAAK,EAAC,eAAe;IACrBhB,OAAO,EAAEX;EAAoB,CAC9B,CACG,CACF,CACF,CACD,CAAC;AAEZ,CAAC"}
@@ -0,0 +1,87 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { RFValue } from 'react-native-responsive-fontsize';
3
+ export const styles = StyleSheet.create({
4
+ container: {
5
+ flex: 1
6
+ },
7
+ subContainer: {
8
+ flex: 1
9
+ },
10
+ image: {
11
+ width: RFValue(200),
12
+ height: RFValue(200)
13
+ },
14
+ modalImage: {
15
+ width: '100%',
16
+ height: '100%',
17
+ resizeMode: 'contain'
18
+ },
19
+ overlay: {
20
+ zIndex: 2,
21
+ flex: 1,
22
+ height: '100%',
23
+ width: '100%',
24
+ backgroundColor: `rgba(44, 45, 46, 0.5)`,
25
+ alignItems: `center`,
26
+ justifyContent: `center`,
27
+ position: `absolute`
28
+ },
29
+ textOverlay: {
30
+ fontSize: RFValue(18),
31
+ fontWeight: `500`,
32
+ color: `#fff`,
33
+ textAlign: `center`,
34
+ width: RFValue(300),
35
+ marginBottom: RFValue(20)
36
+ },
37
+ closeButton: {
38
+ position: 'absolute',
39
+ top: 20,
40
+ right: 20
41
+ },
42
+ closeIcon: {
43
+ width: 20,
44
+ height: 20
45
+ },
46
+ containerCamera: {
47
+ flex: 1
48
+ },
49
+ cameraView: {
50
+ width: '100%',
51
+ height: RFValue(250),
52
+ backgroundColor: `rgba(173, 216, 230, 0)`,
53
+ position: `absolute`,
54
+ alignSelf: 'center',
55
+ marginTop: RFValue(50),
56
+ alignItems: `center`,
57
+ justifyContent: `center`
58
+ },
59
+ containerTouch: {
60
+ height: RFValue(180),
61
+ alignItems: 'center'
62
+ },
63
+ containerText: {
64
+ width: RFValue(280),
65
+ height: RFValue(120),
66
+ borderRadius: 150,
67
+ backgroundColor: `blue`,
68
+ alignItems: `center`,
69
+ justifyContent: `center`,
70
+ marginTop: 10
71
+ },
72
+ textRecording: {
73
+ fontSize: RFValue(18),
74
+ fontWeight: `500`,
75
+ color: `#fff`
76
+ },
77
+ containerTextExposureAndZoom: {},
78
+ textExposureAndZoom: {
79
+ fontSize: 18,
80
+ fontWeight: `500`,
81
+ color: `#fff`,
82
+ textAlign: `center`,
83
+ width: RFValue(300),
84
+ marginBottom: RFValue(20)
85
+ }
86
+ });
87
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","RFValue","styles","create","container","flex","subContainer","image","width","height","modalImage","resizeMode","overlay","zIndex","backgroundColor","alignItems","justifyContent","position","textOverlay","fontSize","fontWeight","color","textAlign","marginBottom","closeButton","top","right","closeIcon","containerCamera","cameraView","alignSelf","marginTop","containerTouch","containerText","borderRadius","textRecording","containerTextExposureAndZoom","textExposureAndZoom"],"sourceRoot":"../../../../src","sources":["screens/ProvaVidas/styles.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,OAAO,QAAQ,kCAAkC;AAE1D,OAAO,MAAMC,MAAM,GAAGF,UAAU,CAACG,MAAM,CAAC;EACtCC,SAAS,EAAE;IACTC,IAAI,EAAE;EACR,CAAC;EAEDC,YAAY,EAAE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