@ha_tecno/live-id-sdk 2.6.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +59 -287
- package/lib/commonjs/components/deviceNotFound/deviceNotFound.js.map +1 -1
- package/lib/commonjs/components/deviceNotFound/styles.js.map +1 -1
- package/lib/commonjs/components/recordButton/styles.js.map +1 -1
- package/lib/commonjs/index.js +6 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js +0 -1
- package/lib/commonjs/screens/LifeCertificate/LifeCertificate.js.map +1 -1
- package/lib/commonjs/screens/MultiFingerRegister/MultiFingerRegister.js +247 -0
- package/lib/commonjs/screens/MultiFingerRegister/MultiFingerRegister.js.map +1 -0
- package/lib/commonjs/screens/MultiFingerRegister/styles.js +65 -0
- package/lib/commonjs/screens/MultiFingerRegister/styles.js.map +1 -0
- package/lib/commonjs/screens/index.js +7 -0
- package/lib/commonjs/screens/index.js.map +1 -1
- package/lib/commonjs/services/services.js +2 -2
- package/lib/commonjs/services/services.js.map +1 -1
- package/lib/commonjs/services/types.js +18 -0
- package/lib/commonjs/services/types.js.map +1 -1
- package/lib/commonjs/store/modules/fingerRegister/slice.js +30 -4
- package/lib/commonjs/store/modules/fingerRegister/slice.js.map +1 -1
- package/lib/commonjs/store/modules/fingerRegister/types.js +18 -0
- package/lib/commonjs/store/modules/fingerRegister/types.js.map +1 -1
- package/lib/module/components/deviceNotFound/deviceNotFound.js.map +1 -1
- package/lib/module/components/deviceNotFound/styles.js.map +1 -1
- package/lib/module/components/recordButton/styles.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/LifeCertificate/LifeCertificate.js +0 -1
- package/lib/module/screens/LifeCertificate/LifeCertificate.js.map +1 -1
- package/lib/module/screens/MultiFingerRegister/MultiFingerRegister.js +238 -0
- package/lib/module/screens/MultiFingerRegister/MultiFingerRegister.js.map +1 -0
- package/lib/module/screens/MultiFingerRegister/styles.js +59 -0
- package/lib/module/screens/MultiFingerRegister/styles.js.map +1 -0
- package/lib/module/screens/index.js +2 -1
- package/lib/module/screens/index.js.map +1 -1
- package/lib/module/services/services.js +2 -2
- package/lib/module/services/services.js.map +1 -1
- package/lib/module/services/types.js +13 -1
- package/lib/module/services/types.js.map +1 -1
- package/lib/module/store/modules/fingerRegister/slice.js +30 -4
- package/lib/module/store/modules/fingerRegister/slice.js.map +1 -1
- package/lib/module/store/modules/fingerRegister/types.js +13 -1
- package/lib/module/store/modules/fingerRegister/types.js.map +1 -1
- package/lib/typescript/src/components/deviceNotFound/deviceNotFound.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/LifeCertificate/LifeCertificate.d.ts.map +1 -1
- package/lib/typescript/src/screens/MultiFingerRegister/MultiFingerRegister.d.ts +10 -0
- package/lib/typescript/src/screens/MultiFingerRegister/MultiFingerRegister.d.ts.map +1 -0
- package/lib/typescript/src/screens/MultiFingerRegister/styles.d.ts +55 -0
- package/lib/typescript/src/screens/MultiFingerRegister/styles.d.ts.map +1 -0
- package/lib/typescript/src/screens/index.d.ts +2 -1
- package/lib/typescript/src/screens/index.d.ts.map +1 -1
- package/lib/typescript/src/services/services.d.ts +1 -1
- package/lib/typescript/src/services/services.d.ts.map +1 -1
- package/lib/typescript/src/services/types.d.ts +13 -0
- package/lib/typescript/src/services/types.d.ts.map +1 -1
- package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts +5 -1
- package/lib/typescript/src/store/modules/fingerRegister/selectors.d.ts.map +1 -1
- package/lib/typescript/src/store/modules/fingerRegister/slice.d.ts.map +1 -1
- package/lib/typescript/src/store/modules/fingerRegister/types.d.ts +17 -1
- package/lib/typescript/src/store/modules/fingerRegister/types.d.ts.map +1 -1
- package/package.json +7 -3
- package/src/components/deviceNotFound/deviceNotFound.tsx +10 -12
- package/src/components/deviceNotFound/styles.ts +26 -26
- package/src/components/recordButton/styles.ts +11 -11
- package/src/index.tsx +2 -2
- package/src/screens/LifeCertificate/LifeCertificate.tsx +0 -2
- package/src/screens/MultiFingerRegister/MultiFingerRegister.tsx +211 -0
- package/src/screens/MultiFingerRegister/styles.ts +50 -0
- package/src/screens/index.ts +2 -1
- package/src/services/services.ts +2 -2
- package/src/services/types.ts +14 -0
- package/src/store/modules/fingerRegister/slice.ts +48 -5
- package/src/store/modules/fingerRegister/types.ts +18 -1
@@ -0,0 +1,55 @@
|
|
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
|
+
iconClose: {
|
50
|
+
position: "absolute";
|
51
|
+
alignSelf: "flex-end";
|
52
|
+
padding: number;
|
53
|
+
};
|
54
|
+
};
|
55
|
+
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CjB,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
|
-
|
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;
|
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,
|
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;
|
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,oBAAY,MAAM;IAChB,UAAU,OAAO;IACjB,UAAU,OAAO;IACjB,WAAW,OAAO;IAClB,SAAS,OAAO;IAChB,UAAU,OAAO;IACjB,WAAW,OAAO;IAClB,WAAW,OAAO;IAClB,YAAY,OAAO;IACnB,UAAU,OAAO;IACjB,WAAW,OAAO;CACnB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,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,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
|
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,
|
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;
|
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;IACjB,WAAW,OAAO;IAClB,WAAW,OAAO;IAClB,YAAY,OAAO;IACnB,UAAU,OAAO;IACjB,WAAW,OAAO;CACnB;AAED,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;IACF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;CACvB,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,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C,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"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ha_tecno/live-id-sdk",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.8.0",
|
4
4
|
"description": "React Native SDK for Live ID",
|
5
5
|
"main": "lib/commonjs/index",
|
6
6
|
"module": "lib/module/index",
|
@@ -30,7 +30,8 @@
|
|
30
30
|
"typecheck": "tsc --noEmit",
|
31
31
|
"format": "prettier --write .",
|
32
32
|
"lint": "eslint . --ext .ts,.tsx",
|
33
|
-
"prepare": "
|
33
|
+
"prepare": "husky",
|
34
|
+
"bob": "bob build",
|
34
35
|
"release": "release-it"
|
35
36
|
},
|
36
37
|
"keywords": [
|
@@ -70,7 +71,9 @@
|
|
70
71
|
"eslint-plugin-react": "^7.34.1",
|
71
72
|
"eslint-plugin-react-hooks": "^4.6.0",
|
72
73
|
"globals": "^15.0.0",
|
74
|
+
"husky": "^9.1.4",
|
73
75
|
"jest": "^28.1.1",
|
76
|
+
"lint-staged": "^15.2.7",
|
74
77
|
"pod-install": "^0.1.0",
|
75
78
|
"prettier": "^3.2.5",
|
76
79
|
"react": "18.2.0",
|
@@ -142,13 +145,14 @@
|
|
142
145
|
]
|
143
146
|
},
|
144
147
|
"dependencies": {
|
148
|
+
"@react-native-picker/picker": "^2.7.7",
|
145
149
|
"axios": "^1.6.8",
|
146
|
-
"firebase": "^10.7.2",
|
147
150
|
"react-native-device-info": "^10.13.1",
|
148
151
|
"react-native-fs": "^2.20.0",
|
149
152
|
"react-native-gesture-handler": "^2.14.1",
|
150
153
|
"react-native-modal": "^13.0.1",
|
151
154
|
"react-native-orientation-locker": "^1.6.0",
|
155
|
+
"react-native-picker-select": "^9.1.3",
|
152
156
|
"react-native-reanimated": "^3.6.1",
|
153
157
|
"react-native-responsive-fontsize": "^0.5.1",
|
154
158
|
"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
|
-
|
7
|
-
|
6
|
+
hasPermission: boolean;
|
7
|
+
cameraPermission: () => void;
|
8
8
|
};
|
9
9
|
|
10
10
|
const DeviceNotFound = ({ hasPermission, cameraPermission }: Props) => {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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,211 @@
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from "react";
|
2
|
+
import { View, Modal, TouchableOpacity, Platform } 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
|
+
setTimeout(() => Platform.OS === "android" && closeModel(), 500);
|
155
|
+
dispatch.setCurrentFinger(value as Finger);
|
156
|
+
};
|
157
|
+
|
158
|
+
if (device == null || hasPermission === false)
|
159
|
+
return <DeviceNotFound hasPermission={hasPermission} cameraPermission={cameraPermission} />;
|
160
|
+
|
161
|
+
return (
|
162
|
+
<GestureHandlerRootView style={styles.root}>
|
163
|
+
<GestureDetector gesture={gesture}>
|
164
|
+
<View style={styles.cameraContainer}>
|
165
|
+
<Camera
|
166
|
+
ref={cameraRef}
|
167
|
+
style={styles.camera}
|
168
|
+
device={device}
|
169
|
+
format={cameraFormat}
|
170
|
+
isActive={isActive}
|
171
|
+
torch={isActive ? "on" : "off"}
|
172
|
+
exposure={state.exposure}
|
173
|
+
zoom={state.zoom}
|
174
|
+
photo
|
175
|
+
/>
|
176
|
+
<Gabarito />
|
177
|
+
</View>
|
178
|
+
</GestureDetector>
|
179
|
+
<View style={styles.containerModalIcon}>
|
180
|
+
<TouchableOpacity onPress={openModal}>
|
181
|
+
<Icon name="cog" size={40} color="#fff" />
|
182
|
+
</TouchableOpacity>
|
183
|
+
</View>
|
184
|
+
<View style={containerCaptureStyled}>
|
185
|
+
<CaptureButton onPress={takePhoto} imagesCount={state.base64Images.length} />
|
186
|
+
</View>
|
187
|
+
{state.showButtonInfo && <CameraConfigInfo exposure={state.exposure} zoom={state.zoom} />}
|
188
|
+
<ModalMessage isLoading={state.loading} modal={state.modal} />
|
189
|
+
<Modal animationType="slide" transparent={true} visible={showModal} onRequestClose={closeModel}>
|
190
|
+
<View style={styles.containerModal}>
|
191
|
+
<View style={styles.modal}>
|
192
|
+
<TouchableOpacity onPress={closeModel} style={styles.iconClose}>
|
193
|
+
<Icon name="close" size={32} color="red" />
|
194
|
+
</TouchableOpacity>
|
195
|
+
<Picker
|
196
|
+
style={pickerStyled}
|
197
|
+
useNativeAndroidPickerStyle={false}
|
198
|
+
placeholder={{}}
|
199
|
+
onDonePress={closeModel}
|
200
|
+
items={itemsPicker}
|
201
|
+
value={state.currentFinger}
|
202
|
+
onValueChange={handleCurrentFinger}
|
203
|
+
/>
|
204
|
+
</View>
|
205
|
+
</View>
|
206
|
+
</Modal>
|
207
|
+
</GestureHandlerRootView>
|
208
|
+
);
|
209
|
+
};
|
210
|
+
|
211
|
+
export default MultiFingerRegister;
|
@@ -0,0 +1,50 @@
|
|
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
|
+
iconClose: { position: "absolute", alignSelf: "flex-end", padding: 8 }
|
50
|
+
});
|
package/src/screens/index.ts
CHANGED
@@ -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 };
|
package/src/services/services.ts
CHANGED
@@ -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 },
|