@ha_tecno/live-id-sdk 2.6.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/lib/commonjs/components/deviceNotFound/deviceNotFound.js.map +1 -1
  2. package/lib/commonjs/components/deviceNotFound/styles.js.map +1 -1
  3. package/lib/commonjs/components/recordButton/styles.js.map +1 -1
  4. package/lib/commonjs/index.js +6 -0
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js +0 -1
  7. package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js.map +1 -1
  8. package/lib/commonjs/screens/MultiFingerRegister/MultiFingerRegister.js +239 -0
  9. package/lib/commonjs/screens/MultiFingerRegister/MultiFingerRegister.js.map +1 -0
  10. package/lib/commonjs/screens/MultiFingerRegister/styles.js +60 -0
  11. package/lib/commonjs/screens/MultiFingerRegister/styles.js.map +1 -0
  12. package/lib/commonjs/screens/index.js +7 -0
  13. package/lib/commonjs/screens/index.js.map +1 -1
  14. package/lib/commonjs/services/services.js +2 -2
  15. package/lib/commonjs/services/services.js.map +1 -1
  16. package/lib/commonjs/services/types.js +18 -0
  17. package/lib/commonjs/services/types.js.map +1 -1
  18. package/lib/commonjs/store/modules/fingerRegister/slice.js +30 -4
  19. package/lib/commonjs/store/modules/fingerRegister/slice.js.map +1 -1
  20. package/lib/commonjs/store/modules/fingerRegister/types.js +18 -0
  21. package/lib/commonjs/store/modules/fingerRegister/types.js.map +1 -1
  22. package/lib/module/components/deviceNotFound/deviceNotFound.js.map +1 -1
  23. package/lib/module/components/deviceNotFound/styles.js.map +1 -1
  24. package/lib/module/components/recordButton/styles.js.map +1 -1
  25. package/lib/module/index.js +2 -2
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/screens/LifeCertificate/LifeCertificate.js +0 -1
  28. package/lib/module/screens/LifeCertificate/LifeCertificate.js.map +1 -1
  29. package/lib/module/screens/MultiFingerRegister/MultiFingerRegister.js +230 -0
  30. package/lib/module/screens/MultiFingerRegister/MultiFingerRegister.js.map +1 -0
  31. package/lib/module/screens/MultiFingerRegister/styles.js +54 -0
  32. package/lib/module/screens/MultiFingerRegister/styles.js.map +1 -0
  33. package/lib/module/screens/index.js +2 -1
  34. package/lib/module/screens/index.js.map +1 -1
  35. package/lib/module/services/services.js +2 -2
  36. package/lib/module/services/services.js.map +1 -1
  37. package/lib/module/services/types.js +13 -1
  38. package/lib/module/services/types.js.map +1 -1
  39. package/lib/module/store/modules/fingerRegister/slice.js +30 -4
  40. package/lib/module/store/modules/fingerRegister/slice.js.map +1 -1
  41. package/lib/module/store/modules/fingerRegister/types.js +13 -1
  42. package/lib/module/store/modules/fingerRegister/types.js.map +1 -1
  43. package/lib/typescript/src/components/deviceNotFound/deviceNotFound.d.ts.map +1 -1
  44. package/lib/typescript/src/index.d.ts +2 -2
  45. package/lib/typescript/src/index.d.ts.map +1 -1
  46. package/lib/typescript/src/screens/LifeCertificate/LifeCertificate.d.ts.map +1 -1
  47. package/lib/typescript/src/screens/MultiFingerRegister/MultiFingerRegister.d.ts +10 -0
  48. package/lib/typescript/src/screens/MultiFingerRegister/MultiFingerRegister.d.ts.map +1 -0
  49. package/lib/typescript/src/screens/MultiFingerRegister/styles.d.ts +50 -0
  50. package/lib/typescript/src/screens/MultiFingerRegister/styles.d.ts.map +1 -0
  51. package/lib/typescript/src/screens/index.d.ts +2 -1
  52. package/lib/typescript/src/screens/index.d.ts.map +1 -1
  53. package/lib/typescript/src/services/services.d.ts +1 -1
  54. package/lib/typescript/src/services/services.d.ts.map +1 -1
  55. package/lib/typescript/src/services/types.d.ts +13 -0
  56. package/lib/typescript/src/services/types.d.ts.map +1 -1
  57. package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts +5 -1
  58. package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts.map +1 -1
  59. package/lib/typescript/src/store/modules/fingerRegister/slice.d.ts.map +1 -1
  60. package/lib/typescript/src/store/modules/fingerRegister/types.d.ts +17 -1
  61. package/lib/typescript/src/store/modules/fingerRegister/types.d.ts.map +1 -1
  62. package/package.json +3 -2
  63. package/src/components/deviceNotFound/deviceNotFound.tsx +10 -12
  64. package/src/components/deviceNotFound/styles.ts +26 -26
  65. package/src/components/recordButton/styles.ts +11 -11
  66. package/src/index.tsx +2 -2
  67. package/src/screens/LifeCertificate/LifeCertificate.tsx +0 -2
  68. package/src/screens/MultiFingerRegister/MultiFingerRegister.tsx +207 -0
  69. package/src/screens/MultiFingerRegister/styles.ts +49 -0
  70. package/src/screens/index.ts +2 -1
  71. package/src/services/services.ts +2 -2
  72. package/src/services/types.ts +14 -0
  73. package/src/store/modules/fingerRegister/slice.ts +48 -5
  74. package/src/store/modules/fingerRegister/types.ts +18 -1
@@ -1 +1 @@
1
- {"version":3,"file":"LifeCertificate.d.ts","sourceRoot":"","sources":["../../../../../src/screens/LifeCertificate/LifeCertificate.tsx"],"names":[],"mappings":";AASA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,eAAe,kBAAmB,KAAK,gBA0I5C,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"LifeCertificate.d.ts","sourceRoot":"","sources":["../../../../../src/screens/LifeCertificate/LifeCertificate.tsx"],"names":[],"mappings":";AASA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,eAAe,kBAAmB,KAAK,gBAwI5C,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ UID: string;
4
+ onSuccess: (code: number) => void;
5
+ isFocused?: boolean;
6
+ mock?: boolean;
7
+ };
8
+ declare const MultiFingerRegister: ({ UID, onSuccess, isFocused, mock }: Props) => JSX.Element;
9
+ export default MultiFingerRegister;
10
+ //# sourceMappingURL=MultiFingerRegister.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiFingerRegister.d.ts","sourceRoot":"","sources":["../../../../../src/screens/MultiFingerRegister/MultiFingerRegister.tsx"],"names":[],"mappings":";AA2BA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,mBAAmB,wCAAyC,KAAK,gBA0KtE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,50 @@
1
+ export declare const styles: {
2
+ container: {
3
+ flex: number;
4
+ };
5
+ root: {
6
+ flex: number;
7
+ };
8
+ cameraContainer: {
9
+ flex: number;
10
+ justifyContent: "center";
11
+ };
12
+ camera: {
13
+ flex: number;
14
+ paddingBottom: number;
15
+ };
16
+ containerCapture: {
17
+ position: "absolute";
18
+ width: "100%";
19
+ alignItems: "center";
20
+ };
21
+ cameraConfigs: {
22
+ alignItems: "center";
23
+ };
24
+ containerModalIcon: {
25
+ position: "absolute";
26
+ top: number;
27
+ right: number;
28
+ zIndex: number;
29
+ };
30
+ containerModal: {
31
+ flex: number;
32
+ justifyContent: "flex-end";
33
+ marginBottom: "15%";
34
+ };
35
+ modal: {
36
+ margin: number;
37
+ backgroundColor: string;
38
+ borderRadius: number;
39
+ padding: number;
40
+ shadowColor: string;
41
+ shadowOffset: {
42
+ width: number;
43
+ height: number;
44
+ };
45
+ shadowOpacity: number;
46
+ shadowRadius: number;
47
+ elevation: number;
48
+ };
49
+ };
50
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/screens/MultiFingerRegister/styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CjB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import FingerRegister from "./FingerRegister/FingerRegister";
2
2
  import LifeCertificate from "./LifeCertificate/LifeCertificate";
3
3
  import FingerAuth from "./FingerAuth/FingerAuth";
4
- export { FingerRegister, LifeCertificate, FingerAuth };
4
+ import MultiFingerRegister from "./MultiFingerRegister/MultiFingerRegister";
5
+ export { FingerRegister, LifeCertificate, FingerAuth, MultiFingerRegister };
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/screens/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,eAAe,MAAM,mCAAmC,CAAC;AAChE,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/screens/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,eAAe,MAAM,mCAAmC,CAAC;AAChE,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,mBAAmB,MAAM,2CAA2C,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { GetConfigApiResponse, LifeCertificateResponse, LifeCertificateType, RegisterFingerResponse, RegisterFingerImagesType, AuthFingerType, AuthFingerResponse } from "./types";
2
2
  export declare const getConfigsApi: () => Promise<GetConfigApiResponse>;
3
- export declare const registerFingerImages: ({ UID, images }: RegisterFingerImagesType) => Promise<RegisterFingerResponse>;
3
+ export declare const registerFingerImages: ({ UID, images, finger }: RegisterFingerImagesType) => Promise<RegisterFingerResponse>;
4
4
  export declare const authFinger: ({ UID, image }: AuthFingerType) => Promise<AuthFingerResponse>;
5
5
  export declare const lifeCertificate: ({ videoPath, exposure, UID }: LifeCertificateType) => Promise<LifeCertificateResponse>;
6
6
  //# sourceMappingURL=services.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/services/services.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAWjB,eAAO,MAAM,aAAa,QAAa,QAAQ,oBAAoB,CAQlE,CAAC;AAEF,eAAO,MAAM,oBAAoB,oBAG9B,wBAAwB,KAAG,QAAQ,sBAAsB,CAwB3D,CAAC;AAEF,eAAO,MAAM,UAAU,mBAA0B,cAAc,KAAG,QAAQ,kBAAkB,CAyB3F,CAAC;AAEF,eAAO,MAAM,eAAe,iCAIzB,mBAAmB,KAAG,QAAQ,uBAAuB,CAoCvD,CAAC"}
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/services/services.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAWjB,eAAO,MAAM,aAAa,QAAa,QAAQ,oBAAoB,CAQlE,CAAC;AAEF,eAAO,MAAM,oBAAoB,4BAI9B,wBAAwB,KAAG,QAAQ,sBAAsB,CAuB3D,CAAC;AAEF,eAAO,MAAM,UAAU,mBAA0B,cAAc,KAAG,QAAQ,kBAAkB,CAyB3F,CAAC;AAEF,eAAO,MAAM,eAAe,iCAIzB,mBAAmB,KAAG,QAAQ,uBAAuB,CAoCvD,CAAC"}
@@ -8,9 +8,22 @@ export type GetConfigApiResponse = {
8
8
  serviceType: string;
9
9
  showButtonInfo: boolean;
10
10
  }[];
11
+ export declare enum Finger {
12
+ LEFT_THUMB = "LT",
13
+ LEFT_INDEX = "LI",
14
+ LEFT_MIDDLE = "LM",
15
+ LEFT_RING = "LR",
16
+ LEFT_PINKY = "LP",
17
+ RIGHT_THUMB = "RT",
18
+ RIGHT_INDEX = "RI",
19
+ RIGHT_MIDDLE = "RM",
20
+ RIGHT_RING = "RR",
21
+ RIGHT_PINKY = "RP"
22
+ }
11
23
  export type RegisterFingerImagesType = {
12
24
  UID: string;
13
25
  images: string[];
26
+ finger: Finger | undefined;
14
27
  };
15
28
  export type RegisterFingerResponse = {
16
29
  code: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB,EAAE,CAAC;AAEJ,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,M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B,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -10,13 +10,17 @@ export declare const useSelector: () => {
10
10
  title: string;
11
11
  message: string;
12
12
  } | undefined;
13
+ currentFingerIndex: number;
14
+ currentFinger: import("./types").Finger;
13
15
  };
14
16
  export declare const useDispatch: () => {
15
17
  getConfig: (serviceType: "finger" | "liveness") => void;
16
18
  handleLoading: () => void;
17
19
  setImagePath: (imagePath: string) => void;
18
- sendImages: (images: string[], UID: string, mock?: boolean | undefined) => void;
20
+ sendImages: (images: string[], UID: string, mock?: boolean | undefined, finger?: import("./types").Finger | undefined) => void;
19
21
  setModal: (title: string, message: string) => void;
20
22
  resetState: () => void;
23
+ handleFinger: () => void;
24
+ setCurrentFinger: (finger: import("./types").Finger) => void;
21
25
  };
22
26
  //# sourceMappingURL=selectors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../../../../src/store/modules/fingerRegister/selectors.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW;;;;;;;;;;;;CAAqB,CAAC;AAC9C,eAAO,MAAM,WAAW;;;;;;;CAAwB,CAAC"}
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../../../../src/store/modules/fingerRegister/selectors.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;CAAqB,CAAC;AAC9C,eAAO,MAAM,WAAW;;;;;;;;;CAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"slice.d.ts","sourceRoot":"","sources":["../../../../../../src/store/modules/fingerRegister/slice.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAgB,MAAM,SAAS,CAAC;AA6F5D,QAAA,MAAM,KAAK,kFAUR,CAAC;AAEJ,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"slice.d.ts","sourceRoot":"","sources":["../../../../../../src/store/modules/fingerRegister/slice.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,mBAAmB,EAAgB,MAAM,SAAS,CAAC;AAsIpE,QAAA,MAAM,KAAK,kFAYR,CAAC;AAEJ,eAAe,KAAK,CAAC"}
@@ -1,3 +1,15 @@
1
+ export declare enum Finger {
2
+ LEFT_THUMB = "LT",
3
+ LEFT_INDEX = "LI",
4
+ LEFT_MIDDLE = "LM",
5
+ LEFT_RING = "LR",
6
+ LEFT_PINKY = "LP",
7
+ RIGHT_THUMB = "RT",
8
+ RIGHT_INDEX = "RI",
9
+ RIGHT_MIDDLE = "RM",
10
+ RIGHT_RING = "RR",
11
+ RIGHT_PINKY = "RP"
12
+ }
1
13
  type State = {
2
14
  exposure: number;
3
15
  zoom: number;
@@ -10,14 +22,18 @@ type State = {
10
22
  title: string;
11
23
  message: string;
12
24
  };
25
+ currentFingerIndex: number;
26
+ currentFinger: Finger;
13
27
  };
14
28
  type Dispatch = {
15
29
  getConfig: (serviceType: "finger" | "liveness") => void;
16
30
  handleLoading: () => void;
17
31
  setImagePath: (imagePath: string) => void;
18
- sendImages: (images: string[], UID: string, mock?: boolean) => void;
32
+ sendImages: (images: string[], UID: string, mock?: boolean, finger?: Finger) => void;
19
33
  setModal: (title: string, message: string) => void;
20
34
  resetState: () => void;
35
+ handleFinger: () => void;
36
+ setCurrentFinger: (finger: Finger) => void;
21
37
  };
22
38
  export type InitialState = {
23
39
  state: State;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/store/modules/fingerRegister/types.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AACF,KAAK,QAAQ,GAAG;IACd,SAAS,EAAE,CAAC,WAAW,EAAE,QAAQ,GAAG,UAAU,KAAK,IAAI,CAAC;IACxD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/store/modules/fingerRegister/types.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM;IAChB,UAAU,OAAO;IACjB,UAAU,OAAO;IACjB,WAAW,OAAO;IAClB,SAAS,OAAO;IAChB,UAAU,OAAO;IAC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AAC;IACb,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ha_tecno/live-id-sdk",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "React Native SDK for Live ID",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -142,13 +142,14 @@
142
142
  ]
143
143
  },
144
144
  "dependencies": {
145
+ "@react-native-picker/picker": "^2.7.7",
145
146
  "axios": "^1.6.8",
146
- "firebase": "^10.7.2",
147
147
  "react-native-device-info": "^10.13.1",
148
148
  "react-native-fs": "^2.20.0",
149
149
  "react-native-gesture-handler": "^2.14.1",
150
150
  "react-native-modal": "^13.0.1",
151
151
  "react-native-orientation-locker": "^1.6.0",
152
+ "react-native-picker-select": "^9.1.3",
152
153
  "react-native-reanimated": "^3.6.1",
153
154
  "react-native-responsive-fontsize": "^0.5.1",
154
155
  "react-native-uuid": "^2.0.2",
@@ -3,21 +3,19 @@ import { Pressable, Text, View } from "react-native";
3
3
  import { styles } from "./styles";
4
4
 
5
5
  type Props = {
6
- hasPermission: boolean;
7
- cameraPermission: () => void;
6
+ hasPermission: boolean;
7
+ cameraPermission: () => void;
8
8
  };
9
9
 
10
10
  const DeviceNotFound = ({ hasPermission, cameraPermission }: Props) => {
11
- return (
12
- <View style={styles.container}>
13
- <Text style={styles.text}>Device not found</Text>
14
- <Pressable style={styles.button} onPress={cameraPermission}>
15
- <Text style={styles.textButton}>
16
- {hasPermission ? "Permission granted" : "Request permission"}
17
- </Text>
18
- </Pressable>
19
- </View>
20
- );
11
+ return (
12
+ <View style={styles.container}>
13
+ <Text style={styles.text}>Device not found</Text>
14
+ <Pressable style={styles.button} onPress={cameraPermission}>
15
+ <Text style={styles.textButton}>{hasPermission ? "Permission granted" : "Request permission"}</Text>
16
+ </Pressable>
17
+ </View>
18
+ );
21
19
  };
22
20
 
23
21
  export default DeviceNotFound;
@@ -1,30 +1,30 @@
1
1
  import { StyleSheet } from "react-native";
2
2
 
3
3
  export const styles = StyleSheet.create({
4
- container: {
5
- flex: 1,
6
- justifyContent: "center",
7
- alignItems: "center",
8
- gap: 20,
9
- },
10
- text: {
11
- color: "#000",
12
- fontSize: 20,
13
- },
14
- button: {
15
- alignItems: "center",
16
- justifyContent: "center",
17
- paddingVertical: 12,
18
- paddingHorizontal: 32,
19
- borderRadius: 4,
20
- elevation: 3,
21
- backgroundColor: "black",
22
- },
23
- textButton: {
24
- fontSize: 16,
25
- lineHeight: 21,
26
- fontWeight: "bold",
27
- letterSpacing: 0.25,
28
- color: "white",
29
- },
4
+ container: {
5
+ flex: 1,
6
+ justifyContent: "center",
7
+ alignItems: "center",
8
+ gap: 20
9
+ },
10
+ text: {
11
+ color: "#000",
12
+ fontSize: 20
13
+ },
14
+ button: {
15
+ alignItems: "center",
16
+ justifyContent: "center",
17
+ paddingVertical: 12,
18
+ paddingHorizontal: 32,
19
+ borderRadius: 4,
20
+ elevation: 3,
21
+ backgroundColor: "black"
22
+ },
23
+ textButton: {
24
+ fontSize: 16,
25
+ lineHeight: 21,
26
+ fontWeight: "bold",
27
+ letterSpacing: 0.25,
28
+ color: "white"
29
+ }
30
30
  });
@@ -1,15 +1,15 @@
1
1
  import { StyleSheet } from "react-native";
2
2
 
3
3
  export const styles = StyleSheet.create({
4
- container: {
5
- flexDirection: "row",
6
- height: 50,
7
- justifyContent: "center",
8
- alignItems: "center",
9
- borderRadius: 50,
10
- },
11
- text: {
12
- position: "absolute",
13
- color: "#fff",
14
- },
4
+ container: {
5
+ flexDirection: "row",
6
+ height: 50,
7
+ justifyContent: "center",
8
+ alignItems: "center",
9
+ borderRadius: 50
10
+ },
11
+ text: {
12
+ position: "absolute",
13
+ color: "#fff"
14
+ }
15
15
  });
package/src/index.tsx CHANGED
@@ -1,3 +1,3 @@
1
- import { LifeCertificate, FingerRegister, FingerAuth } from "./screens";
1
+ import { LifeCertificate, FingerRegister, FingerAuth, MultiFingerRegister } from "./screens";
2
2
 
3
- export { LifeCertificate, FingerRegister, FingerAuth };
3
+ export { LifeCertificate, FingerRegister, FingerAuth, MultiFingerRegister };
@@ -51,8 +51,6 @@ const LifeCertificate = ({ UID, mock }: Props) => {
51
51
  Orientation.lockToPortrait();
52
52
  }, []);
53
53
 
54
- console.log(state.bpm);
55
-
56
54
  useEffect(() => {
57
55
  if (state.code === 0) {
58
56
  dispatch.setModal("Sucesso!", `Seu batimento está em: ${state.bpm}.\nProva de vida concluída!`);
@@ -0,0 +1,207 @@
1
+ import React, { useCallback, useEffect, useRef, useState } from "react";
2
+ import { View, Modal, TouchableOpacity } from "react-native";
3
+ import { Camera, Point, useCameraDevice, useCameraFormat, useCameraPermission } from "react-native-vision-camera";
4
+ import Orientation from "react-native-orientation-locker";
5
+ import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
6
+ import { runOnJS } from "react-native-reanimated";
7
+ import Picker, { PickerStyle } from "react-native-picker-select";
8
+
9
+ import { CameraConfigInfo, CaptureButton, DeviceNotFound, Gabarito, ModalMessage } from "../../components";
10
+ import { styles } from "./styles";
11
+ import { useDispatch, useSelector } from "../../store/modules/fingerRegister";
12
+ import Icon from "../../components/icon/icon";
13
+ import { useIsForeground } from "../../utils";
14
+
15
+ enum Finger {
16
+ LEFT_THUMB = "LT",
17
+ LEFT_INDEX = "LI",
18
+ LEFT_MIDDLE = "LM",
19
+ LEFT_RING = "LR",
20
+ LEFT_PINKY = "LP",
21
+ RIGHT_THUMB = "RT",
22
+ RIGHT_INDEX = "RI",
23
+ RIGHT_MIDDLE = "RM",
24
+ RIGHT_RING = "RR",
25
+ RIGHT_PINKY = "RP"
26
+ }
27
+
28
+ type Props = {
29
+ UID: string;
30
+ onSuccess: (code: number) => void;
31
+ isFocused?: boolean;
32
+ mock?: boolean;
33
+ };
34
+
35
+ const MultiFingerRegister = ({ UID, onSuccess, isFocused, mock }: Props) => {
36
+ const [showModal, setShowModal] = useState(false);
37
+ const cameraRef = useRef<Camera>(null);
38
+ const isForeground = useIsForeground();
39
+ const isActive = isFocused !== undefined ? isForeground && isFocused : isForeground;
40
+ const { hasPermission, requestPermission } = useCameraPermission();
41
+ const device = useCameraDevice("back");
42
+ const state = useSelector();
43
+ const dispatch = useDispatch();
44
+
45
+ const containerCaptureStyled = [styles.containerCapture, { bottom: state.showButtonInfo ? 75 : 20 }];
46
+ const pickerStyled: PickerStyle = {
47
+ chevronDown: { display: "none" },
48
+ chevronUp: { display: "none" },
49
+ inputIOS: {
50
+ fontSize: 16,
51
+ color: "#000",
52
+ textAlign: "center"
53
+ },
54
+ inputAndroid: {
55
+ fontSize: 14,
56
+ color: "#000",
57
+ textAlign: "center"
58
+ }
59
+ };
60
+
61
+ const itemsPicker = [
62
+ { label: "Indicador Direito", value: Finger.RIGHT_INDEX },
63
+ { label: "Médio Direito", value: Finger.RIGHT_MIDDLE },
64
+ { label: "Anelar Direito", value: Finger.RIGHT_RING },
65
+ { label: "Mínimo Direito", value: Finger.RIGHT_PINKY },
66
+ { label: "Polegar Direito", value: Finger.RIGHT_THUMB },
67
+ { label: "Indicador Esquerdo", value: Finger.LEFT_INDEX },
68
+ { label: "Médio Esquerdo", value: Finger.LEFT_MIDDLE },
69
+ { label: "Anelar Esquerdo", value: Finger.LEFT_RING },
70
+ { label: "Mínimo Esquerdo", value: Finger.LEFT_PINKY },
71
+ { label: "Polegar Esquerdo", value: Finger.LEFT_THUMB }
72
+ ];
73
+
74
+ useEffect(() => {
75
+ Orientation.lockToPortrait();
76
+ return () => {
77
+ Orientation.unlockAllOrientations();
78
+ };
79
+ });
80
+
81
+ const cameraPermission = useCallback(async () => {
82
+ if (!hasPermission) {
83
+ await requestPermission();
84
+ }
85
+ }, [hasPermission, requestPermission]);
86
+
87
+ useEffect(() => {
88
+ cameraPermission();
89
+ dispatch.getConfig("finger");
90
+ }, [cameraPermission, dispatch.getConfig]);
91
+
92
+ const cameraFormat = useCameraFormat(device, [
93
+ {
94
+ photoResolution: {
95
+ width: 1280,
96
+ height: 720
97
+ }
98
+ }
99
+ ]);
100
+
101
+ useEffect(() => {
102
+ if (state.base64Images !== undefined && state.base64Images.length === 3) {
103
+ if (!UID) {
104
+ dispatch.setModal("Ocorreu um erro!", "Erro: UID não encontrado!");
105
+ }
106
+ dispatch.handleLoading();
107
+ dispatch.sendImages(state.base64Images, UID, mock, state.currentFinger);
108
+ }
109
+ }, [dispatch.sendImages, dispatch.handleLoading, state.base64Images, state.base64Images.length, mock]);
110
+
111
+ useEffect(() => {
112
+ if (state.code === 0) {
113
+ dispatch.setModal("Sucesso!", "Cadastro de digital realizado com sucesso!");
114
+ onSuccess && onSuccess?.(state.code);
115
+ mock === true ? setTimeout(() => dispatch.handleLoading(), 2000) : dispatch.handleLoading();
116
+ dispatch.handleFinger();
117
+ }
118
+ if (state.code !== 0 && state.code !== null) {
119
+ dispatch.setModal("Ocorreu um erro!", `Erro: ${state.message}`);
120
+ dispatch.handleLoading();
121
+ }
122
+ dispatch.resetState();
123
+ }, [state.code, state.message, dispatch.handleLoading, dispatch.resetState, dispatch.setModal, onSuccess, mock]);
124
+
125
+ const takePhoto = async () => {
126
+ const photo = await cameraRef.current?.takePhoto({
127
+ qualityPrioritization: "balanced"
128
+ });
129
+ if (photo != null) {
130
+ dispatch.setImagePath(photo.path);
131
+ }
132
+ };
133
+
134
+ const focus = useCallback((point: Point) => {
135
+ const camera = cameraRef.current;
136
+ if (camera != null) {
137
+ camera.focus(point);
138
+ }
139
+ }, []);
140
+
141
+ const gesture = Gesture.Tap().onBegin(({ x, y }) => {
142
+ runOnJS(focus)({ x, y });
143
+ });
144
+
145
+ const openModal = () => {
146
+ setShowModal(true);
147
+ };
148
+
149
+ const closeModel = () => {
150
+ setShowModal(false);
151
+ };
152
+
153
+ const handleCurrentFinger = (value: string) => {
154
+ dispatch.setCurrentFinger(value as Finger);
155
+ };
156
+
157
+ if (device == null || hasPermission === false)
158
+ return <DeviceNotFound hasPermission={hasPermission} cameraPermission={cameraPermission} />;
159
+
160
+ return (
161
+ <GestureHandlerRootView style={styles.root}>
162
+ <GestureDetector gesture={gesture}>
163
+ <View style={styles.cameraContainer}>
164
+ <Camera
165
+ ref={cameraRef}
166
+ style={styles.camera}
167
+ device={device}
168
+ format={cameraFormat}
169
+ isActive={isActive}
170
+ torch={isActive ? "on" : "off"}
171
+ exposure={state.exposure}
172
+ zoom={state.zoom}
173
+ photo
174
+ />
175
+ <Gabarito />
176
+ </View>
177
+ </GestureDetector>
178
+ <View style={styles.containerModalIcon}>
179
+ <TouchableOpacity onPress={openModal}>
180
+ <Icon name="cog" size={35} color="#fff" />
181
+ </TouchableOpacity>
182
+ </View>
183
+ <View style={containerCaptureStyled}>
184
+ <CaptureButton onPress={takePhoto} imagesCount={state.base64Images.length} />
185
+ </View>
186
+ {state.showButtonInfo && <CameraConfigInfo exposure={state.exposure} zoom={state.zoom} />}
187
+ <ModalMessage isLoading={state.loading} modal={state.modal} />
188
+ <Modal animationType="slide" transparent={true} visible={showModal} onRequestClose={closeModel}>
189
+ <View style={styles.containerModal}>
190
+ <View style={styles.modal}>
191
+ <Picker
192
+ style={pickerStyled}
193
+ useNativeAndroidPickerStyle={false}
194
+ placeholder={{}}
195
+ onDonePress={closeModel}
196
+ items={itemsPicker}
197
+ value={state.currentFinger}
198
+ onValueChange={handleCurrentFinger}
199
+ />
200
+ </View>
201
+ </View>
202
+ </Modal>
203
+ </GestureHandlerRootView>
204
+ );
205
+ };
206
+
207
+ export default MultiFingerRegister;
@@ -0,0 +1,49 @@
1
+ import { StyleSheet, Dimensions, Platform } from "react-native";
2
+
3
+ const { height } = Dimensions.get("window");
4
+
5
+ export const styles = StyleSheet.create({
6
+ container: {
7
+ flex: 1
8
+ },
9
+ root: {
10
+ flex: 1
11
+ },
12
+ cameraContainer: {
13
+ flex: 1,
14
+ justifyContent: "center"
15
+ },
16
+ camera: {
17
+ flex: 1,
18
+ paddingBottom: height * 0.2
19
+ },
20
+ containerCapture: {
21
+ position: "absolute",
22
+ width: "100%",
23
+ alignItems: "center"
24
+ },
25
+ cameraConfigs: {
26
+ alignItems: "center"
27
+ },
28
+ containerModalIcon: {
29
+ position: "absolute",
30
+ top: 10,
31
+ right: 10,
32
+ zIndex: 9999
33
+ },
34
+ containerModal: { flex: 1, justifyContent: "flex-end", marginBottom: "15%" },
35
+ modal: {
36
+ margin: 20,
37
+ backgroundColor: "white",
38
+ borderRadius: 20,
39
+ padding: Platform.OS === "ios" ? 35 : 20,
40
+ shadowColor: "#000",
41
+ shadowOffset: {
42
+ width: 0,
43
+ height: 2
44
+ },
45
+ shadowOpacity: 0.25,
46
+ shadowRadius: 4,
47
+ elevation: 5
48
+ }
49
+ });
@@ -1,5 +1,6 @@
1
1
  import FingerRegister from "./FingerRegister/FingerRegister";
2
2
  import LifeCertificate from "./LifeCertificate/LifeCertificate";
3
3
  import FingerAuth from "./FingerAuth/FingerAuth";
4
+ import MultiFingerRegister from "./MultiFingerRegister/MultiFingerRegister";
4
5
 
5
- export { FingerRegister, LifeCertificate, FingerAuth };
6
+ export { FingerRegister, LifeCertificate, FingerAuth, MultiFingerRegister };
@@ -32,10 +32,10 @@ export const getConfigsApi = async (): Promise<GetConfigApiResponse> => {
32
32
 
33
33
  export const registerFingerImages = async ({
34
34
  UID,
35
- images
35
+ images,
36
+ finger
36
37
  }: RegisterFingerImagesType): Promise<RegisterFingerResponse> => {
37
38
  try {
38
- const finger = "DI";
39
39
  const { data } = await axiosInstance.post(
40
40
  "/enroll-images",
41
41
  { UID, finger, images },