@finos_sdk/sdk-ekyc 1.3.2 → 1.3.4
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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/finos/sdk/ekyc/EKYCModule.kt +281 -96
- package/dist/EKYCModule.d.ts +17 -2
- package/dist/EKYCModule.js +41 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.js +8 -1
- package/dist/package.json +1 -1
- package/dist/src/modules/FinosEKYCModule.d.ts +13 -5
- package/dist/src/modules/FinosEKYCModule.js +10 -8
- package/dist/src/modules/FinosESignModule.d.ts +13 -1
- package/dist/src/modules/FinosESignModule.js +23 -4
- package/dist/src/types/ekycFaceType.d.ts +7 -0
- package/dist/src/types/ekycFlowType.d.ts +17 -0
- package/dist/src/types/ekycFlowType.js +28 -0
- package/dist/src/types/ekycLivenessType.d.ts +16 -0
- package/dist/src/types/ekycLivenessType.js +32 -1
- package/dist/src/types/ekycType.d.ts +30 -0
- package/package.json +1 -1
- package/src/modules/FinosEKYCModule.ts +23 -10
- package/src/modules/FinosESignModule.ts +32 -5
- package/src/modules/README.md +1 -1
- package/src/types/ekycFaceType.ts +7 -0
- package/src/types/ekycFlowType.ts +25 -0
- package/src/types/ekycLivenessType.ts +33 -1
- package/src/types/ekycType.ts +31 -0
|
@@ -15,7 +15,14 @@ export interface FaceVerifyResult {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface FaceServiceConfig {
|
|
18
|
+
/**
|
|
19
|
+
* Backward/forward compatible:
|
|
20
|
+
* - SDK code uses `appKey`
|
|
21
|
+
* - Some integration docs use `appKeyFaceService`
|
|
22
|
+
* Provide either; `startFaceCompare()` will normalize.
|
|
23
|
+
*/
|
|
18
24
|
appKey: string,
|
|
25
|
+
appKeyFaceService?: string,
|
|
19
26
|
transactionId?: string,
|
|
20
27
|
selfieImage: string,
|
|
21
28
|
idImage: string,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Các bước trong flow eKYC – map với Android SDKType (OCR, NFC, LIVENESS).
|
|
3
|
+
* Bên sử dụng truyền enum vào SDK thay vì string.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* import { FinosEKYC, SDKFlowType } from '@finos_sdk/sdk-ekyc';
|
|
7
|
+
* await FinosEKYC.startEkycUI(appKey, [SDKFlowType.OCR, SDKFlowType.NFC, SDKFlowType.LIVENESS], ...);
|
|
8
|
+
*/
|
|
9
|
+
export enum SDKFlowType {
|
|
10
|
+
OCR = 'OCR',
|
|
11
|
+
NFC = 'NFC',
|
|
12
|
+
LIVENESS = 'LIVENESS',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Mảng đầy đủ các bước (dùng cho picker / default flow). */
|
|
16
|
+
export const SDK_FLOW_OPTIONS: readonly SDKFlowType[] = [
|
|
17
|
+
SDKFlowType.OCR,
|
|
18
|
+
SDKFlowType.NFC,
|
|
19
|
+
SDKFlowType.LIVENESS,
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
/** Chuyển flow enum[] sang string[] khi gửi xuống native (giá trị enum đã là 'OCR'|'NFC'|'LIVENESS'). */
|
|
23
|
+
export function flowToStrings(flow: SDKFlowType[]): string[] {
|
|
24
|
+
return flow.map(f => f as string);
|
|
25
|
+
}
|
|
@@ -1,9 +1,41 @@
|
|
|
1
1
|
import { CheckSummaryResponse } from "./ekycOCRType";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Custom actions cho liveness – map Android SDKFaceDetectStatus.
|
|
5
|
+
* Bên sử dụng truyền enum vào optionConfig.customActions thay vì string.
|
|
6
|
+
*/
|
|
3
7
|
export enum SDKFaceDetectStatus {
|
|
4
8
|
LEFT = "LEFT",
|
|
5
9
|
RIGHT = "RIGHT",
|
|
6
|
-
|
|
10
|
+
UP = "UP",
|
|
11
|
+
DOWN = "DOWN",
|
|
12
|
+
SMILE = "SMILE",
|
|
13
|
+
BLINK = "BLINK",
|
|
14
|
+
TILT_LEFT = "TILT_LEFT",
|
|
15
|
+
TILT_RIGHT = "TILT_RIGHT",
|
|
16
|
+
WINK_LEFT = "WINK_LEFT",
|
|
17
|
+
WINK_RIGHT = "WINK_RIGHT",
|
|
18
|
+
STRAIGHT = "STRAIGHT",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Mảng đầy đủ các action (trừ STRAIGHT thường được SDK tự thêm cuối) – dùng cho picker / default. */
|
|
22
|
+
export const SDK_LIVENESS_ACTIONS: readonly SDKFaceDetectStatus[] = [
|
|
23
|
+
SDKFaceDetectStatus.LEFT,
|
|
24
|
+
SDKFaceDetectStatus.RIGHT,
|
|
25
|
+
SDKFaceDetectStatus.UP,
|
|
26
|
+
SDKFaceDetectStatus.DOWN,
|
|
27
|
+
SDKFaceDetectStatus.SMILE,
|
|
28
|
+
SDKFaceDetectStatus.BLINK,
|
|
29
|
+
SDKFaceDetectStatus.TILT_LEFT,
|
|
30
|
+
SDKFaceDetectStatus.TILT_RIGHT,
|
|
31
|
+
SDKFaceDetectStatus.WINK_LEFT,
|
|
32
|
+
SDKFaceDetectStatus.WINK_RIGHT,
|
|
33
|
+
SDKFaceDetectStatus.STRAIGHT,
|
|
34
|
+
] as const;
|
|
35
|
+
|
|
36
|
+
/** Chuyển customActions enum[] sang string[] khi gửi xuống native. */
|
|
37
|
+
export function customActionsToStrings(actions: SDKFaceDetectStatus[]): string[] {
|
|
38
|
+
return actions.map(a => a as string);
|
|
7
39
|
}
|
|
8
40
|
|
|
9
41
|
export interface LivenessConfig {
|
package/src/types/ekycType.ts
CHANGED
|
@@ -22,4 +22,35 @@ export interface SDKEkycResultWithEvent {
|
|
|
22
22
|
export interface SDKEkycResultStringWithEvent {
|
|
23
23
|
data: string;
|
|
24
24
|
event: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Result from startEkycUI() – maps Android SDK data.ekycStateModel.eKYCFileModel.
|
|
29
|
+
* Use the same shape as Android: data?.ekycStateModel?.eKYCFileModel?.imageFace.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const result = await sdkEKYC.startEkycUI(...);
|
|
33
|
+
* const selfieBase64 = result?.imageFace; // base64 selfie (liveness/face)
|
|
34
|
+
* const frontBase64 = result?.imageOcrFront; // base64 CCCD/CMND mặt trước
|
|
35
|
+
* const backBase64 = result?.imageOcrBack; // base64 CCCD/CMND mặt sau
|
|
36
|
+
* const selfiePath = result?.imageFacePath; // file path (e.g. for FormData)
|
|
37
|
+
* const transactionId = result?.transactionId;
|
|
38
|
+
*/
|
|
39
|
+
export interface StartEkycUIResult {
|
|
40
|
+
status: 'success';
|
|
41
|
+
event: string;
|
|
42
|
+
data?: string;
|
|
43
|
+
transactionId?: string;
|
|
44
|
+
/** Base64 selfie (liveness) – same as Android data.ekycStateModel.eKYCFileModel.imageFace */
|
|
45
|
+
imageFace?: string;
|
|
46
|
+
/** Base64 OCR front – same as Android eKYCFileModel.imageOcrFront */
|
|
47
|
+
imageOcrFront?: string;
|
|
48
|
+
/** Base64 OCR back – same as Android eKYCFileModel.imageOcrBack */
|
|
49
|
+
imageOcrBack?: string;
|
|
50
|
+
/** Absolute path to selfie file (e.g. for react-native-fs / FormData) */
|
|
51
|
+
imageFacePath?: string;
|
|
52
|
+
/** Absolute path to OCR front image file */
|
|
53
|
+
imageOcrFrontPath?: string;
|
|
54
|
+
/** Absolute path to OCR back image file */
|
|
55
|
+
imageOcrBackPath?: string;
|
|
25
56
|
}
|