@ha_tecno/live-id-sdk 2.17.1 → 2.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/lib/commonjs/components/Gabarito/gabarito.js +1 -1
  2. package/lib/commonjs/components/Gabarito/gabarito.js.map +1 -1
  3. package/lib/commonjs/components/HACaptureInstructions/HACaptureInstructions.js +1 -1
  4. package/lib/commonjs/components/HACaptureInstructions/HACaptureInstructions.js.map +1 -1
  5. package/lib/commonjs/components/HACaptureInstructions/data.js +2 -2
  6. package/lib/commonjs/components/HACaptureInstructions/data.js.map +1 -1
  7. package/lib/commonjs/components/HACarouselCalibration/HACarouselItem/HACarouselItem.js +3 -3
  8. package/lib/commonjs/components/HACarouselCalibration/HACarouselItem/HACarouselItem.js.map +1 -1
  9. package/lib/commonjs/components/HACarouselCalibration/HACarouselItem/styles.js.map +1 -1
  10. package/lib/commonjs/components/HACarouselCalibration/HAPagination/styles.js +0 -1
  11. package/lib/commonjs/components/HACarouselCalibration/HAPagination/styles.js.map +1 -1
  12. package/lib/commonjs/components/HARecordButton/HARecordButton.js +1 -1
  13. package/lib/commonjs/components/HARecordButton/HARecordButton.js.map +1 -1
  14. package/lib/commonjs/components/HARecordInstructions/HARecordInstructions.js +3 -3
  15. package/lib/commonjs/components/HARecordInstructions/HARecordInstructions.js.map +1 -1
  16. package/lib/commonjs/components/index.js +10 -10
  17. package/lib/commonjs/components/index.js.map +1 -1
  18. package/lib/commonjs/screens/FingerAuth/FingerAuth.js +14 -4
  19. package/lib/commonjs/screens/FingerAuth/FingerAuth.js.map +1 -1
  20. package/lib/commonjs/screens/FingerRegister/FingerRegister.js +14 -4
  21. package/lib/commonjs/screens/FingerRegister/FingerRegister.js.map +1 -1
  22. package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js +12 -2
  23. package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js.map +1 -1
  24. package/lib/commonjs/screens/RegisterOperations/registerOperationPointsBiometrics.js +26 -29
  25. package/lib/commonjs/screens/RegisterOperations/registerOperationPointsBiometrics.js.map +1 -1
  26. package/lib/commonjs/screens/RegisterOperations/styles.js +2 -11
  27. package/lib/commonjs/screens/RegisterOperations/styles.js.map +1 -1
  28. package/lib/commonjs/services/services.js +5 -3
  29. package/lib/commonjs/services/services.js.map +1 -1
  30. package/lib/commonjs/store/modules/operationPoints/slice.js +17 -17
  31. package/lib/commonjs/store/modules/operationPoints/slice.js.map +1 -1
  32. package/lib/commonjs/utils/index.js +1 -1
  33. package/lib/commonjs/utils/index.js.map +1 -1
  34. package/lib/module/components/Gabarito/gabarito.js +2 -2
  35. package/lib/module/components/Gabarito/gabarito.js.map +1 -1
  36. package/lib/module/components/HAButton/HAButton.js +1 -1
  37. package/lib/module/components/HAButton/HAButton.js.map +1 -1
  38. package/lib/module/components/HAButton/styles.js +1 -1
  39. package/lib/module/components/HAButton/styles.js.map +1 -1
  40. package/lib/module/components/HACaptureInstructions/HACaptureInstructions.js +2 -2
  41. package/lib/module/components/HACaptureInstructions/HACaptureInstructions.js.map +1 -1
  42. package/lib/module/components/HACaptureInstructions/HACard/HACard.js +1 -1
  43. package/lib/module/components/HACaptureInstructions/HACard/HACard.js.map +1 -1
  44. package/lib/module/components/HACaptureInstructions/HACard/styles.js +1 -1
  45. package/lib/module/components/HACaptureInstructions/HACard/styles.js.map +1 -1
  46. package/lib/module/components/HACaptureInstructions/data.js +2 -2
  47. package/lib/module/components/HACaptureInstructions/data.js.map +1 -1
  48. package/lib/module/components/HACaptureInstructions/style.js +1 -1
  49. package/lib/module/components/HACaptureInstructions/style.js.map +1 -1
  50. package/lib/module/components/HACarouselCalibration/HACarouselCalibration.js.map +1 -1
  51. package/lib/module/components/HACarouselCalibration/HACarouselItem/HACarouselItem.js +4 -4
  52. package/lib/module/components/HACarouselCalibration/HACarouselItem/HACarouselItem.js.map +1 -1
  53. package/lib/module/components/HACarouselCalibration/HACarouselItem/styles.js +1 -2
  54. package/lib/module/components/HACarouselCalibration/HACarouselItem/styles.js.map +1 -1
  55. package/lib/module/components/HACarouselCalibration/HAPagination/styles.js +0 -1
  56. package/lib/module/components/HACarouselCalibration/HAPagination/styles.js.map +1 -1
  57. package/lib/module/components/HARecordButton/HARecordButton.js +1 -1
  58. package/lib/module/components/HARecordButton/HARecordButton.js.map +1 -1
  59. package/lib/module/components/HARecordInstructions/HARecordInstructions.js +4 -4
  60. package/lib/module/components/HARecordInstructions/HARecordInstructions.js.map +1 -1
  61. package/lib/module/components/HARecordInstructions/styles.js +1 -1
  62. package/lib/module/components/HARecordInstructions/styles.js.map +1 -1
  63. package/lib/module/components/Toast/Toast.js +1 -1
  64. package/lib/module/components/Toast/Toast.js.map +1 -1
  65. package/lib/module/components/index.js +11 -11
  66. package/lib/module/components/index.js.map +1 -1
  67. package/lib/module/index.js +3 -3
  68. package/lib/module/index.js.map +1 -1
  69. package/lib/module/screens/FingerAuth/FingerAuth.js +17 -6
  70. package/lib/module/screens/FingerAuth/FingerAuth.js.map +1 -1
  71. package/lib/module/screens/FingerRegister/FingerRegister.js +16 -5
  72. package/lib/module/screens/FingerRegister/FingerRegister.js.map +1 -1
  73. package/lib/module/screens/LifeCertificate/LifeCertificate.js +13 -3
  74. package/lib/module/screens/LifeCertificate/LifeCertificate.js.map +1 -1
  75. package/lib/module/screens/RegisterOperations/registerOperationPointsBiometrics.js +28 -30
  76. package/lib/module/screens/RegisterOperations/registerOperationPointsBiometrics.js.map +1 -1
  77. package/lib/module/screens/RegisterOperations/styles.js +3 -12
  78. package/lib/module/screens/RegisterOperations/styles.js.map +1 -1
  79. package/lib/module/services/services.js +5 -3
  80. package/lib/module/services/services.js.map +1 -1
  81. package/lib/module/store/modules/operationPoints/slice.js +17 -17
  82. package/lib/module/store/modules/operationPoints/slice.js.map +1 -1
  83. package/lib/module/theme/theme.js +1 -1
  84. package/lib/module/theme/theme.js.map +1 -1
  85. package/lib/module/utils/hooks/useIsForeground.js +1 -1
  86. package/lib/module/utils/hooks/useIsForeground.js.map +1 -1
  87. package/lib/module/utils/index.js +2 -2
  88. package/lib/module/utils/index.js.map +1 -1
  89. package/lib/module/utils/utils.js +1 -1
  90. package/lib/module/utils/utils.js.map +1 -1
  91. package/lib/typescript/src/components/HACarouselCalibration/HACarouselItem/styles.d.ts.map +1 -1
  92. package/lib/typescript/src/components/HACarouselCalibration/HAPagination/styles.d.ts.map +1 -1
  93. package/lib/typescript/src/components/index.d.ts +11 -11
  94. package/lib/typescript/src/components/index.d.ts.map +1 -1
  95. package/lib/typescript/src/index.d.ts +3 -3
  96. package/lib/typescript/src/index.d.ts.map +1 -1
  97. package/lib/typescript/src/screens/FingerAuth/FingerAuth.d.ts.map +1 -1
  98. package/lib/typescript/src/screens/FingerRegister/FingerRegister.d.ts.map +1 -1
  99. package/lib/typescript/src/screens/LifeCertificate/LifeCertificate.d.ts.map +1 -1
  100. package/lib/typescript/src/screens/RegisterOperations/registerOperationPointsBiometrics.d.ts.map +1 -1
  101. package/lib/typescript/src/screens/RegisterOperations/styles.d.ts +2 -8
  102. package/lib/typescript/src/screens/RegisterOperations/styles.d.ts.map +1 -1
  103. package/lib/typescript/src/services/services.d.ts +2 -2
  104. package/lib/typescript/src/services/services.d.ts.map +1 -1
  105. package/lib/typescript/src/services/types.d.ts +1 -0
  106. package/lib/typescript/src/services/types.d.ts.map +1 -1
  107. package/lib/typescript/src/store/modules/operationPoints/selectors.d.ts +2 -1
  108. package/lib/typescript/src/store/modules/operationPoints/selectors.d.ts.map +1 -1
  109. package/lib/typescript/src/store/modules/operationPoints/slice.d.ts.map +1 -1
  110. package/lib/typescript/src/store/modules/operationPoints/types.d.ts +4 -1
  111. package/lib/typescript/src/store/modules/operationPoints/types.d.ts.map +1 -1
  112. package/lib/typescript/src/utils/index.d.ts +2 -2
  113. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  114. package/lib/typescript/src/utils/utils.d.ts +1 -1
  115. package/package.json +3 -3
  116. package/src/@types/declarations.d.ts +2 -0
  117. package/src/components/Gabarito/gabarito.tsx +2 -2
  118. package/src/components/HAButton/HAButton.tsx +1 -1
  119. package/src/components/HAButton/styles.ts +1 -1
  120. package/src/components/HACaptureInstructions/HACaptureInstructions.tsx +2 -2
  121. package/src/components/HACaptureInstructions/HACard/HACard.tsx +1 -1
  122. package/src/components/HACaptureInstructions/HACard/styles.ts +1 -1
  123. package/src/components/HACaptureInstructions/data.ts +2 -2
  124. package/src/components/HACaptureInstructions/style.ts +1 -1
  125. package/src/components/HACarouselCalibration/HACarouselCalibration.tsx +1 -1
  126. package/src/components/HACarouselCalibration/HACarouselItem/HACarouselItem.tsx +4 -4
  127. package/src/components/HACarouselCalibration/HACarouselItem/styles.ts +1 -3
  128. package/src/components/HACarouselCalibration/HAPagination/styles.ts +0 -1
  129. package/src/components/HARecordButton/HARecordButton.tsx +1 -1
  130. package/src/components/HARecordInstructions/HARecordInstructions.tsx +6 -6
  131. package/src/components/HARecordInstructions/styles.ts +1 -1
  132. package/src/components/Toast/Toast.tsx +1 -1
  133. package/src/components/index.ts +20 -20
  134. package/src/index.tsx +9 -9
  135. package/src/screens/FingerAuth/FingerAuth.tsx +19 -6
  136. package/src/screens/FingerRegister/FingerRegister.tsx +17 -5
  137. package/src/screens/LifeCertificate/LifeCertificate.tsx +14 -3
  138. package/src/screens/RegisterOperations/registerOperationPointsBiometrics.tsx +25 -28
  139. package/src/screens/RegisterOperations/styles.ts +3 -12
  140. package/src/services/services.ts +11 -9
  141. package/src/services/types.ts +1 -0
  142. package/src/store/modules/operationPoints/slice.ts +24 -24
  143. package/src/store/modules/operationPoints/types.ts +9 -1
  144. package/src/theme/theme.ts +1 -1
  145. package/src/utils/hooks/useIsForeground.ts +1 -1
  146. package/src/utils/index.ts +2 -2
  147. package/src/utils/utils.ts +1 -1
@@ -1,4 +1,4 @@
1
- import { StyleSheet, Platform } from "react-native";
1
+ import { Platform, StyleSheet } from "react-native";
2
2
 
3
3
  export const styles = StyleSheet.create({
4
4
  root: { flex: 1 },
@@ -31,22 +31,13 @@ export const styles = StyleSheet.create({
31
31
  },
32
32
  containerContent: { position: "absolute", alignSelf: "center", bottom: 20 },
33
33
  marginTabSelector: {
34
+ alignSelf: "center",
35
+ width: "100%",
34
36
  marginHorizontal: Platform.select({
35
37
  ios: 100,
36
38
  android: 80
37
39
  })
38
40
  },
39
- containerRuler: {
40
- paddingTop: 30
41
- },
42
- textStyleRuler: {
43
- color: "#FFB200",
44
- fontSize: Platform.select({
45
- ios: 14,
46
- android: 12
47
- }),
48
- fontWeight: "bold"
49
- },
50
41
  containerButton: {
51
42
  marginTop: 20,
52
43
  alignSelf: "center"
@@ -1,20 +1,20 @@
1
1
  import axios from "axios";
2
2
  import { Platform } from "react-native";
3
+ import DeviceInfo from "react-native-device-info";
3
4
  import uuid from "react-native-uuid";
4
5
  import type {
6
+ AuthFingerResponse,
7
+ AuthFingerType,
5
8
  GetConfigApiResponse,
6
9
  LifeCertificateResponse,
7
10
  LifeCertificateType,
8
- RegisterFingerResponse,
9
11
  RegisterFingerImagesType,
10
- AuthFingerType,
11
- AuthFingerResponse,
12
- SendImagesForRegisterOperationPointsType,
12
+ RegisterFingerResponse,
13
13
  SendImagesForRegisterOperationPointsResponse,
14
- SendVideoForRegisterOperationPointsType,
15
- SendVideoForRegisterOperationPointsResponse
14
+ SendImagesForRegisterOperationPointsType,
15
+ SendVideoForRegisterOperationPointsResponse,
16
+ SendVideoForRegisterOperationPointsType
16
17
  } from "./types";
17
- import DeviceInfo from "react-native-device-info";
18
18
 
19
19
  const API_URL = "https://api.liveid.app.br";
20
20
  const TOKEN =
@@ -161,7 +161,8 @@ export const sendImagesForRegisterOperationPoints = async ({
161
161
  zoom,
162
162
  zoomMax,
163
163
  zoomMin,
164
- zoomScaleZeroToOne
164
+ zoomScaleZeroToOne,
165
+ step
165
166
  }: SendImagesForRegisterOperationPointsType): Promise<SendImagesForRegisterOperationPointsResponse> => {
166
167
  try {
167
168
  const { data } = await axiosInstance.post(
@@ -177,7 +178,8 @@ export const sendImagesForRegisterOperationPoints = async ({
177
178
  zoomMin,
178
179
  zoomMax,
179
180
  zoomScaleZeroToOne,
180
- operationalSystem: Platform.OS
181
+ operationalSystem: Platform.OS,
182
+ step
181
183
  },
182
184
  {
183
185
  headers: {
@@ -70,6 +70,7 @@ export type SendImagesForRegisterOperationPointsType = {
70
70
  zoomMax: number;
71
71
  zoomMin: number;
72
72
  zoomScaleZeroToOne: number;
73
+ step: number;
73
74
  };
74
75
 
75
76
  export type SendImagesForRegisterOperationPointsResponse = {
@@ -1,28 +1,30 @@
1
+ import { Platform } from "react-native";
2
+ import { getModel } from "react-native-device-info";
1
3
  import { create } from "zustand";
4
+ import {
5
+ getConfigOperationPoints,
6
+ sendImagesForRegisterOperationPoints,
7
+ sendVideoForRegisterOperationPoints
8
+ } from "../../../services";
9
+ import { scale0to1, scale0to1Inverse } from "../../../utils";
2
10
  import {
3
11
  ExposureMapOperationPoints,
12
+ ExposureMapOperationPointsLifeCertificate,
4
13
  InitialState,
5
14
  OperationPointsState,
6
15
  SendImagesBase64Payload,
7
16
  SetImageBase64Payload,
8
17
  sendVideosLifeCertificatePayload
9
18
  } from "./types";
10
- import { Platform } from "react-native";
11
- import {
12
- getConfigOperationPoints,
13
- sendImagesForRegisterOperationPoints,
14
- sendVideoForRegisterOperationPoints
15
- } from "../../../services";
16
- import { getModel } from "react-native-device-info";
17
- import { scale0to1, scale0to1Inverse } from "../../../utils";
18
19
 
19
20
  const initialState: InitialState = {
20
21
  state: {
21
22
  loading: "idle",
23
+ step: 1,
22
24
  hasConfigOperationPointsBiometrics: "idle",
23
25
  hasConfigOperationPointsLifeCertificate: "idle",
24
26
  base64Images: [],
25
- exposureScaleZeroToOneBiometrics: Platform.OS === "android" ? 0.12 : 0.3,
27
+ exposureScaleZeroToOneBiometrics: 0.5,
26
28
  exposureScaleZeroToOneLifeCertificate: Platform.OS === "android" ? 0.12 : 0.3,
27
29
  registered: false,
28
30
  exposure: 0,
@@ -76,24 +78,20 @@ const setImageBase64 = (imageBase64: SetImageBase64Payload) => {
76
78
  const changeExposureBiometrics = () => {
77
79
  resetState();
78
80
  const exposureMap: ExposureMapOperationPoints = {
79
- 0.12: 0.2,
80
- 0.2: 0.35,
81
- 0.3: 0.4,
82
- 0.35: 0.5,
83
- 0.4: 0.5,
84
- 0.5: Platform.OS === "android" ? 0.65 : 0.6,
85
- 0.65: 0.8,
86
- 0.6: 0.7,
87
- 0.7: 0.3,
88
- 0.8: 0.12
81
+ 0.5: 0.45,
82
+ 0.45: 0.55,
83
+ 0.55: 0.4,
84
+ 0.4: 0.6,
85
+ 0.6: 0.5
89
86
  };
90
87
  slice.setState((state) => {
91
- const { exposureScaleZeroToOneBiometrics } = state.state;
88
+ const { exposureScaleZeroToOneBiometrics, step } = state.state;
92
89
  return {
93
90
  state: {
94
91
  ...state.state,
95
92
  exposureScaleZeroToOneBiometrics:
96
- exposureMap[exposureScaleZeroToOneBiometrics] || exposureScaleZeroToOneBiometrics
93
+ exposureMap[exposureScaleZeroToOneBiometrics] || exposureScaleZeroToOneBiometrics,
94
+ step: step < 5 ? step + 1 : 5
97
95
  }
98
96
  };
99
97
  });
@@ -101,7 +99,7 @@ const changeExposureBiometrics = () => {
101
99
 
102
100
  const changeExposureLifeCertificate = () => {
103
101
  resetState();
104
- const exposureMap: ExposureMapOperationPoints = {
102
+ const exposureMap: ExposureMapOperationPointsLifeCertificate = {
105
103
  0.12: 0.2,
106
104
  0.2: 0.35,
107
105
  0.3: 0.4,
@@ -166,7 +164,8 @@ const sendImagesBase64 = async ({
166
164
  exposureMax,
167
165
  exposureMin,
168
166
  zoomMax,
169
- zoomMin
167
+ zoomMin,
168
+ step
170
169
  }: SendImagesBase64Payload) => {
171
170
  loadingPending();
172
171
  const deviceModel = getModel();
@@ -183,7 +182,8 @@ const sendImagesBase64 = async ({
183
182
  zoom,
184
183
  zoomMin,
185
184
  zoomMax,
186
- zoomScaleZeroToOne
185
+ zoomScaleZeroToOne,
186
+ step
187
187
  });
188
188
  slice.setState((state) => ({
189
189
  state: {
@@ -4,8 +4,10 @@ type ScaleZeroToOneIOS = 0.3 | 0.4 | 0.5 | 0.6 | 0.7;
4
4
  type StatusConfigOperationPoints = "empty" | "notEmpty" | "idle";
5
5
 
6
6
  type State = {
7
- exposureScaleZeroToOneBiometrics: ScaleZeroToOneIOS | ScaleZeroToOneAndroid;
7
+ //0.4 | 0.45 | 0.5 | 0.55 | 0.6
8
+ exposureScaleZeroToOneBiometrics: 0.4 | 0.45 | 0.5 | 0.55 | 0.6;
8
9
  exposureScaleZeroToOneLifeCertificate: ScaleZeroToOneIOS | ScaleZeroToOneAndroid;
10
+ step: number;
9
11
  loading: "idle" | "pending" | "succeeded" | "failed";
10
12
  hasConfigOperationPointsBiometrics: StatusConfigOperationPoints;
11
13
  hasConfigOperationPointsLifeCertificate: StatusConfigOperationPoints;
@@ -50,6 +52,11 @@ export type ExposureMapOperationPoints = Record<
50
52
  State["exposureScaleZeroToOneBiometrics"]
51
53
  >;
52
54
 
55
+ export type ExposureMapOperationPointsLifeCertificate = Record<
56
+ State["exposureScaleZeroToOneLifeCertificate"],
57
+ State["exposureScaleZeroToOneLifeCertificate"]
58
+ >;
59
+
53
60
  export type SetImageBase64Payload = string;
54
61
 
55
62
  export type SendImagesBase64Payload = {
@@ -59,6 +66,7 @@ export type SendImagesBase64Payload = {
59
66
  exposureMax: number;
60
67
  zoomMin: number;
61
68
  zoomMax: number;
69
+ step: number;
62
70
  };
63
71
 
64
72
  export type sendVideosLifeCertificatePayload = {
@@ -1,5 +1,5 @@
1
1
  import { useColorScheme } from "react-native";
2
- import { light, dark } from "./colors";
2
+ import { dark, light } from "./colors";
3
3
 
4
4
  export const useTheme = () => {
5
5
  const isDark = useColorScheme() === "dark";
@@ -1,4 +1,4 @@
1
- import { useState, useEffect } from "react";
1
+ import { useEffect, useState } from "react";
2
2
  import { AppState, AppStateStatus } from "react-native";
3
3
 
4
4
  export const useIsForeground = () => {
@@ -1,5 +1,5 @@
1
1
  import getConfigCamera from "./getConfigCamera";
2
- import { randomHeartRate, filteredFingers, scale0to1, scale0to1Inverse } from "./utils";
3
2
  import { useIsForeground } from "./hooks/useIsForeground";
3
+ import { filteredFingers, randomHeartRate, scale0to1, scale0to1Inverse } from "./utils";
4
4
 
5
- export { getConfigCamera, useIsForeground, randomHeartRate, filteredFingers, scale0to1, scale0to1Inverse };
5
+ export { filteredFingers, getConfigCamera, randomHeartRate, scale0to1, scale0to1Inverse, useIsForeground };
@@ -19,4 +19,4 @@ const scale0to1Inverse = (scaledValue: number, min: number, max: number) => {
19
19
  return scaledValue * (max - min) + min;
20
20
  };
21
21
 
22
- export { randomHeartRate, filteredFingers, scale0to1, scale0to1Inverse };
22
+ export { filteredFingers, randomHeartRate, scale0to1, scale0to1Inverse };