@finos_sdk/sdk-ekyc 1.3.1 → 1.3.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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/finos/sdk/ekyc/EKYCModule.kt +3 -45
- package/dist/EKYCModule.d.ts +2 -2
- package/dist/EKYCModule.js +2 -3
- package/dist/index.d.ts +1 -1
- package/dist/package.json +1 -1
- package/dist/src/modules/FinosEKYCModule.d.ts +9 -9
- package/dist/src/modules/FinosEKYCModule.js +11 -18
- package/dist/src/modules/FinosESignModule.d.ts +9 -9
- package/dist/src/modules/FinosESignModule.js +11 -10
- package/dist/src/types/ekycESignType.d.ts +3 -18
- package/package.json +1 -1
- package/src/modules/FinosEKYCModule.ts +21 -30
- package/src/modules/FinosESignModule.ts +18 -18
- package/src/types/ekycESignType.ts +5 -21
package/android/build.gradle
CHANGED
|
@@ -65,7 +65,7 @@ dependencies {
|
|
|
65
65
|
implementation 'com.facebook.react:react-android'
|
|
66
66
|
|
|
67
67
|
// Finos eKYC SDK dependencies from GitHub Packages Maven repository
|
|
68
|
-
def sdkVersion = "1.3.
|
|
68
|
+
def sdkVersion = "1.3.2"
|
|
69
69
|
implementation("finos.sdk.ekyc:ekyc:$sdkVersion")
|
|
70
70
|
implementation("finos.sdk.ekyc:ekycui:$sdkVersion")
|
|
71
71
|
implementation("finos.sdk.ekyc:nfc:$sdkVersion")
|
|
@@ -37,7 +37,7 @@ import finos.sdk.ocr.SdkEkycOcr
|
|
|
37
37
|
import finos.sdk.smsotp.SdkSmsOtpService
|
|
38
38
|
import finos.sdk.core.model.sdk.config.SmsOtpConfig
|
|
39
39
|
import vn.softdreams.easyca.sdk.SdkeSign
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
import org.json.JSONObject
|
|
42
42
|
import java.io.File
|
|
43
43
|
import java.io.FileOutputStream
|
|
@@ -1052,7 +1052,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1052
1052
|
Log.d(TAG, "✅ getSdkToken() success")
|
|
1053
1053
|
promise.resolve(token)
|
|
1054
1054
|
},
|
|
1055
|
-
callbackError = { error ->
|
|
1055
|
+
callbackError = { event, error ->
|
|
1056
1056
|
Log.e(TAG, "❌ getSdkToken() failed: $error")
|
|
1057
1057
|
// error might be String or Object, toString() covers both
|
|
1058
1058
|
promise.reject("GET_SDK_TOKEN_ERROR", error.toString())
|
|
@@ -1069,8 +1069,6 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1069
1069
|
accessToken: String?,
|
|
1070
1070
|
username: String?,
|
|
1071
1071
|
rememberMe: Boolean?,
|
|
1072
|
-
userEsignModelJson: String?,
|
|
1073
|
-
privateKeyFilePath: String?,
|
|
1074
1072
|
promise: Promise
|
|
1075
1073
|
) {
|
|
1076
1074
|
Log.d(TAG, "▶️ openSessionId() called")
|
|
@@ -1110,49 +1108,9 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1110
1108
|
promise.reject(event.name.toString(), error.message ?: "Unknown Error")
|
|
1111
1109
|
}
|
|
1112
1110
|
)
|
|
1113
|
-
} else if (userEsignModelJson != null && privateKeyFilePath != null) {
|
|
1114
|
-
// Option 2: Auto-create token from user info
|
|
1115
|
-
val json = JSONObject(userEsignModelJson)
|
|
1116
|
-
val userInfo = UserEsignModel(
|
|
1117
|
-
cccd = json.getString("cccd"),
|
|
1118
|
-
name = json.getString("name"),
|
|
1119
|
-
device = json.optString("device", "Android"),
|
|
1120
|
-
deviceId = json.optString("deviceId", android.provider.Settings.Secure.getString(
|
|
1121
|
-
reactApplicationContext.contentResolver,
|
|
1122
|
-
android.provider.Settings.Secure.ANDROID_ID
|
|
1123
|
-
) ?: "")
|
|
1124
|
-
)
|
|
1125
|
-
|
|
1126
|
-
SdkeSign.openSessionId(
|
|
1127
|
-
context = currentActivity,
|
|
1128
|
-
userEsignModel = userInfo,
|
|
1129
|
-
privateKeyFilePath = privateKeyFilePath,
|
|
1130
|
-
username = username ?: "",
|
|
1131
|
-
rememberMe = rememberMe ?: false,
|
|
1132
|
-
callbackSuccess = { deviceState, code, message ->
|
|
1133
|
-
Log.d(TAG, "✅ openSessionId() success")
|
|
1134
|
-
val (eventMap, promiseMap) = createSeparateMaps { map ->
|
|
1135
|
-
map.putString("deviceState", deviceState)
|
|
1136
|
-
map.putString("code", code.toString())
|
|
1137
|
-
map.putString("message", message)
|
|
1138
|
-
}
|
|
1139
|
-
sendEvent("onESignOpenSessionSuccess", eventMap)
|
|
1140
|
-
promise.resolve(promiseMap)
|
|
1141
|
-
},
|
|
1142
|
-
callbackError = { event, error ->
|
|
1143
|
-
Log.e(TAG, "❌ openSessionId() failed - Event: $event, Message: ${error.message}")
|
|
1144
|
-
val errorMap = Arguments.createMap().apply {
|
|
1145
|
-
putString("event", event.name.toString())
|
|
1146
|
-
putString("message", error.message ?: "")
|
|
1147
|
-
putString("code", error.code.toString())
|
|
1148
|
-
}
|
|
1149
|
-
sendEvent("onESignError", errorMap)
|
|
1150
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error")
|
|
1151
|
-
}
|
|
1152
|
-
)
|
|
1153
1111
|
} else {
|
|
1154
1112
|
Log.e(TAG, "❌ openSessionId() failed: Invalid parameters")
|
|
1155
|
-
promise.reject("INVALID_PARAMS", "
|
|
1113
|
+
promise.reject("INVALID_PARAMS", "accessToken must be provided")
|
|
1156
1114
|
}
|
|
1157
1115
|
} catch (e: Exception) {
|
|
1158
1116
|
Log.e(TAG, "❌ openSessionId() exception: ${e.message}", e)
|
package/dist/EKYCModule.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { OcrConfig } from './src/types/ekycOCRType';
|
|
|
6
6
|
import { LivenessConfig, SDKFaceDetectStatus } from './src/types/ekycLivenessType';
|
|
7
7
|
import { FaceServiceConfig } from './src/types/ekycFaceType';
|
|
8
8
|
import { SmsOtpConfig, SmsOtpResult, SmsOtpError } from './src/types/ekycSmsOtpType';
|
|
9
|
-
import {
|
|
9
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError } from './src/types/ekycESignType';
|
|
10
10
|
export declare const SDK_VERSION: string;
|
|
11
11
|
export declare const SDK_NAME: string;
|
|
12
12
|
declare class SDKeKYC {
|
|
@@ -54,7 +54,7 @@ declare class SDKeKYC {
|
|
|
54
54
|
onSmsOtpError(callback: (error: SmsOtpError) => void): EmitterSubscription | null;
|
|
55
55
|
initializeESign(finosToken?: string): Promise<ESignInitResult>;
|
|
56
56
|
getSdkToken(identity: string, name: string, deviceId: string): Promise<string>;
|
|
57
|
-
openSessionId(accessToken
|
|
57
|
+
openSessionId(accessToken: string | null, username: string | null, rememberMe: boolean | null): Promise<ESignOpenSessionResult>;
|
|
58
58
|
registerDevice(recoverCode: string, pinCode: string, fcmToken?: string): Promise<{
|
|
59
59
|
code: string;
|
|
60
60
|
message: string;
|
package/dist/EKYCModule.js
CHANGED
|
@@ -552,11 +552,10 @@ class SDKeKYC {
|
|
|
552
552
|
throw error;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
async openSessionId(accessToken, username, rememberMe
|
|
555
|
+
async openSessionId(accessToken, username, rememberMe) {
|
|
556
556
|
const nativeModule = this.ensureNativeModule();
|
|
557
557
|
try {
|
|
558
|
-
const
|
|
559
|
-
const result = await nativeModule.openSessionId(accessToken || null, username || null, rememberMe !== undefined ? rememberMe : false, userEsignModelJson, privateKeyFilePath || null);
|
|
558
|
+
const result = await nativeModule.openSessionId(accessToken || null, username || null, rememberMe !== null ? rememberMe : null);
|
|
560
559
|
return result;
|
|
561
560
|
}
|
|
562
561
|
catch (error) {
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,6 @@ export type { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent } from './src
|
|
|
15
15
|
export type { NfcError } from './src/types/ekycNFCType';
|
|
16
16
|
export type { SDKTransactionResponse } from './src/types/ekycTransactionType';
|
|
17
17
|
export type { SmsOtpConfig, SmsOtpResult, SmsOtpError } from './src/types/ekycSmsOtpType';
|
|
18
|
-
export type {
|
|
18
|
+
export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult, UserEsignModel } from './src/types/ekycESignType';
|
|
19
19
|
export { parseNfcResponse } from './src/utils/utils';
|
|
20
20
|
export { SDK_VERSION, SDK_NAME };
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos_sdk/sdk-ekyc",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "React Native SDK for eKYC - Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, and C06, eSign, SmsOTP residence verification",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -6,7 +6,7 @@ import { OcrConfig } from '../types/ekycOCRType';
|
|
|
6
6
|
import { LivenessConfig } from '../types/ekycLivenessType';
|
|
7
7
|
import { FaceServiceConfig } from '../types/ekycFaceType';
|
|
8
8
|
import { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
9
|
-
import {
|
|
9
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError } from '../types/ekycESignType';
|
|
10
10
|
/**
|
|
11
11
|
* Finos eKYC SDK Module
|
|
12
12
|
*
|
|
@@ -171,14 +171,14 @@ export declare class FinosEKYCModule {
|
|
|
171
171
|
*/
|
|
172
172
|
initializeESign(): Promise<ESignInitResult>;
|
|
173
173
|
/**
|
|
174
|
-
* Open eSign
|
|
175
|
-
* @param accessToken
|
|
176
|
-
* @param username
|
|
177
|
-
* @param rememberMe Remember
|
|
178
|
-
* @param userEsignModel User info for auto
|
|
179
|
-
* @param privateKeyFilePath Path to private key file
|
|
174
|
+
* Open eSign Session
|
|
175
|
+
* @param accessToken Access token (JWT)
|
|
176
|
+
* @param username Username
|
|
177
|
+
* @param rememberMe Remember me flag
|
|
178
|
+
* @param userEsignModel User info model (for auto-token generation)
|
|
179
|
+
* @param privateKeyFilePath Path to private key file (for auto-token generation)
|
|
180
180
|
*/
|
|
181
|
-
openSessionId(accessToken
|
|
181
|
+
openSessionId(accessToken: string | null, username: string | null, rememberMe: boolean | null): Promise<ESignOpenSessionResult>;
|
|
182
182
|
/**
|
|
183
183
|
* Register device for eSign
|
|
184
184
|
* @param recoverCode 8-digit recovery code
|
|
@@ -350,6 +350,6 @@ export { SDKFaceDetectStatus } from '../types/ekycLivenessType';
|
|
|
350
350
|
export type { FaceServiceConfig } from '../types/ekycFaceType';
|
|
351
351
|
export type { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent } from '../types/ekycType';
|
|
352
352
|
export type { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
353
|
-
export type {
|
|
353
|
+
export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType';
|
|
354
354
|
export { SDK_VERSION, SDK_NAME };
|
|
355
355
|
export default FinosEKYC;
|
|
@@ -435,25 +435,17 @@ class FinosEKYCModule {
|
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
/**
|
|
438
|
-
* Open eSign
|
|
439
|
-
* @param accessToken
|
|
440
|
-
* @param username
|
|
441
|
-
* @param rememberMe Remember
|
|
442
|
-
* @param userEsignModel User info for auto
|
|
443
|
-
* @param privateKeyFilePath Path to private key file
|
|
444
|
-
*/
|
|
445
|
-
async openSessionId(accessToken, username, rememberMe
|
|
438
|
+
* Open eSign Session
|
|
439
|
+
* @param accessToken Access token (JWT)
|
|
440
|
+
* @param username Username
|
|
441
|
+
* @param rememberMe Remember me flag
|
|
442
|
+
* @param userEsignModel User info model (for auto-token generation)
|
|
443
|
+
* @param privateKeyFilePath Path to private key file (for auto-token generation)
|
|
444
|
+
*/
|
|
445
|
+
async openSessionId(accessToken, username, rememberMe) {
|
|
446
446
|
this.validateSDKReady();
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
const result = await this.sdk.openSessionId(accessToken, username, rememberMe, userEsignModel, privateKeyFilePath);
|
|
450
|
-
console.log('✅ eSign session opened successfully');
|
|
451
|
-
return result;
|
|
452
|
-
}
|
|
453
|
-
catch (error) {
|
|
454
|
-
console.error('❌ eSign session open failed:', error);
|
|
455
|
-
throw error;
|
|
456
|
-
}
|
|
447
|
+
// Pass through to SDK - error handling is done in EKYCModule.ts
|
|
448
|
+
return await this.sdk.openSessionId(accessToken, username, rememberMe);
|
|
457
449
|
}
|
|
458
450
|
/**
|
|
459
451
|
* Register device for eSign
|
|
@@ -708,6 +700,7 @@ const isMethod = (prop) => {
|
|
|
708
700
|
return typeof prototype[prop] === 'function' ||
|
|
709
701
|
prop.startsWith('on') ||
|
|
710
702
|
prop === 'initialize' ||
|
|
703
|
+
prop === 'openSessionId' ||
|
|
711
704
|
prop === 'startEkycUI' ||
|
|
712
705
|
prop === 'startNfcScan' ||
|
|
713
706
|
prop === 'checkC06' ||
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SDK_VERSION, SDK_NAME } from '../../EKYCModule';
|
|
2
2
|
import { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
3
|
-
import {
|
|
3
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError } from '../types/ekycESignType';
|
|
4
4
|
import { LivenessConfig } from '../types/ekycLivenessType';
|
|
5
5
|
import { FaceServiceConfig } from '../types/ekycFaceType';
|
|
6
6
|
import { SDKEkycResultStringWithEvent, SDKEkycResultWithEvent } from '../types/ekycType';
|
|
@@ -76,14 +76,14 @@ export declare class FinosESignModule {
|
|
|
76
76
|
*/
|
|
77
77
|
getSdkToken(identity: string, name: string, deviceId: string): Promise<string>;
|
|
78
78
|
/**
|
|
79
|
-
* Open eSign
|
|
80
|
-
* @param accessToken
|
|
81
|
-
* @param username
|
|
82
|
-
* @param rememberMe Remember
|
|
83
|
-
* @param userEsignModel User info for auto
|
|
84
|
-
* @param privateKeyFilePath Path to private key file
|
|
79
|
+
* Open eSign Session
|
|
80
|
+
* @param accessToken Access token (JWT)
|
|
81
|
+
* @param username Username
|
|
82
|
+
* @param rememberMe Remember me flag
|
|
83
|
+
* @param userEsignModel User info model (for auto-token generation)
|
|
84
|
+
* @param privateKeyFilePath Path to private key file (for auto-token generation)
|
|
85
85
|
*/
|
|
86
|
-
openSessionId(accessToken
|
|
86
|
+
openSessionId(accessToken: string | null, username: string | null, rememberMe: boolean | null): Promise<ESignOpenSessionResult>;
|
|
87
87
|
/**
|
|
88
88
|
* Register device for eSign
|
|
89
89
|
* @param recoverCode 8-digit recovery code
|
|
@@ -266,7 +266,7 @@ export declare class FinosESignModule {
|
|
|
266
266
|
}
|
|
267
267
|
export declare const FinosESign: FinosESignModule;
|
|
268
268
|
export type { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
269
|
-
export type {
|
|
269
|
+
export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType';
|
|
270
270
|
export type { LivenessConfig } from '../types/ekycLivenessType';
|
|
271
271
|
export { SDKFaceDetectStatus } from '../types/ekycLivenessType';
|
|
272
272
|
export type { FaceServiceConfig } from '../types/ekycFaceType';
|
|
@@ -189,17 +189,17 @@ class FinosESignModule {
|
|
|
189
189
|
return await this.sdk.getSdkToken(identity, name, deviceId);
|
|
190
190
|
}
|
|
191
191
|
/**
|
|
192
|
-
* Open eSign
|
|
193
|
-
* @param accessToken
|
|
194
|
-
* @param username
|
|
195
|
-
* @param rememberMe Remember
|
|
196
|
-
* @param userEsignModel User info for auto
|
|
197
|
-
* @param privateKeyFilePath Path to private key file
|
|
192
|
+
* Open eSign Session
|
|
193
|
+
* @param accessToken Access token (JWT)
|
|
194
|
+
* @param username Username
|
|
195
|
+
* @param rememberMe Remember me flag
|
|
196
|
+
* @param userEsignModel User info model (for auto-token generation)
|
|
197
|
+
* @param privateKeyFilePath Path to private key file (for auto-token generation)
|
|
198
198
|
*/
|
|
199
|
-
async openSessionId(accessToken, username, rememberMe
|
|
199
|
+
async openSessionId(accessToken, username, rememberMe) {
|
|
200
200
|
this.validateSDKReady();
|
|
201
201
|
// Pass through to SDK - error handling is done in EKYCModule.ts
|
|
202
|
-
return await this.sdk.openSessionId(accessToken, username, rememberMe
|
|
202
|
+
return await this.sdk.openSessionId(accessToken, username, rememberMe);
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* Register device for eSign
|
|
@@ -480,10 +480,11 @@ const isMethod = (prop) => {
|
|
|
480
480
|
prop.startsWith('on') ||
|
|
481
481
|
prop === 'initialize' ||
|
|
482
482
|
prop === 'initializeESign' ||
|
|
483
|
+
prop === 'getSdkToken' ||
|
|
484
|
+
prop === 'openSessionId' ||
|
|
483
485
|
prop === 'sendOtp' ||
|
|
484
486
|
prop === 'verifyOtp' ||
|
|
485
487
|
prop === 'resendOtp' ||
|
|
486
|
-
prop === 'openSessionId' ||
|
|
487
488
|
prop === 'registerDevice' ||
|
|
488
489
|
prop === 'listCerts' ||
|
|
489
490
|
prop === 'verifyCert' ||
|
|
@@ -558,7 +559,7 @@ const createFinosESignStub = () => {
|
|
|
558
559
|
// Add all other methods
|
|
559
560
|
const otherMethods = [
|
|
560
561
|
'initialize', 'startNfcScan', 'checkC06', 'startOcr', 'startLiveness', 'startFaceCompare',
|
|
561
|
-
'startEkycUI', 'sendOtp', 'verifyOtp', 'resendOtp', 'initializeESign', 'openSessionId',
|
|
562
|
+
'startEkycUI', 'sendOtp', 'verifyOtp', 'resendOtp', 'initializeESign', 'getSdkToken', 'openSessionId',
|
|
562
563
|
'registerDevice', 'listCerts', 'verifyCert', 'listSignRequest', 'confirmSign',
|
|
563
564
|
'registerRemoteSigning', 'signPdf', 'sendConfirmationDocument',
|
|
564
565
|
'onResume', 'onPause', 'isSDKReady', 'getSDKInfo'
|
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* eSign Initialize Result
|
|
3
3
|
*/
|
|
4
4
|
export interface UserEsignModel {
|
|
5
|
-
/**
|
|
6
|
-
* ID card number (CCCD/CMND)
|
|
7
|
-
*/
|
|
8
5
|
cccd: string;
|
|
9
|
-
/**
|
|
10
|
-
* User name
|
|
11
|
-
*/
|
|
12
6
|
name: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
device: string;
|
|
17
|
-
/**
|
|
18
|
-
* Device ID
|
|
19
|
-
*/
|
|
20
|
-
deviceId: string;
|
|
7
|
+
device?: string;
|
|
8
|
+
deviceId?: string;
|
|
21
9
|
}
|
|
22
|
-
/**
|
|
23
|
-
* eSign Initialize Result
|
|
24
|
-
*/
|
|
25
10
|
export interface ESignInitResult {
|
|
26
11
|
code: string;
|
|
27
12
|
message: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos_sdk/sdk-ekyc",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "React Native SDK for eKYC - Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, and C06, eSign, SmsOTP residence verification",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -7,7 +7,7 @@ import { OcrConfig } from '../types/ekycOCRType';
|
|
|
7
7
|
import { LivenessConfig } from '../types/ekycLivenessType';
|
|
8
8
|
import { FaceServiceConfig } from '../types/ekycFaceType';
|
|
9
9
|
import { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
10
|
-
import {
|
|
10
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Finos eKYC SDK Module
|
|
@@ -467,41 +467,31 @@ export class FinosEKYCModule {
|
|
|
467
467
|
throw error;
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
|
|
471
470
|
/**
|
|
472
|
-
* Open eSign
|
|
473
|
-
* @param accessToken
|
|
474
|
-
* @param username
|
|
475
|
-
* @param rememberMe Remember
|
|
476
|
-
* @param userEsignModel User info for auto
|
|
477
|
-
* @param privateKeyFilePath Path to private key file
|
|
471
|
+
* Open eSign Session
|
|
472
|
+
* @param accessToken Access token (JWT)
|
|
473
|
+
* @param username Username
|
|
474
|
+
* @param rememberMe Remember me flag
|
|
475
|
+
* @param userEsignModel User info model (for auto-token generation)
|
|
476
|
+
* @param privateKeyFilePath Path to private key file (for auto-token generation)
|
|
478
477
|
*/
|
|
479
478
|
public async openSessionId(
|
|
480
|
-
accessToken
|
|
481
|
-
username
|
|
482
|
-
rememberMe
|
|
483
|
-
userEsignModel?: UserEsignModel,
|
|
484
|
-
privateKeyFilePath?: string
|
|
479
|
+
accessToken: string | null,
|
|
480
|
+
username: string | null,
|
|
481
|
+
rememberMe: boolean | null
|
|
485
482
|
): Promise<ESignOpenSessionResult> {
|
|
486
483
|
this.validateSDKReady();
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
rememberMe,
|
|
494
|
-
userEsignModel,
|
|
495
|
-
privateKeyFilePath
|
|
496
|
-
);
|
|
497
|
-
console.log('✅ eSign session opened successfully');
|
|
498
|
-
return result;
|
|
499
|
-
} catch (error) {
|
|
500
|
-
console.error('❌ eSign session open failed:', error);
|
|
501
|
-
throw error;
|
|
502
|
-
}
|
|
484
|
+
// Pass through to SDK - error handling is done in EKYCModule.ts
|
|
485
|
+
return await this.sdk.openSessionId(
|
|
486
|
+
accessToken,
|
|
487
|
+
username,
|
|
488
|
+
rememberMe
|
|
489
|
+
);
|
|
503
490
|
}
|
|
504
491
|
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
|
|
505
495
|
/**
|
|
506
496
|
* Register device for eSign
|
|
507
497
|
* @param recoverCode 8-digit recovery code
|
|
@@ -867,6 +857,7 @@ const isMethod = (prop: string | symbol): boolean => {
|
|
|
867
857
|
return typeof prototype[prop] === 'function' ||
|
|
868
858
|
prop.startsWith('on') ||
|
|
869
859
|
prop === 'initialize' ||
|
|
860
|
+
prop === 'openSessionId' ||
|
|
870
861
|
prop === 'startEkycUI' ||
|
|
871
862
|
prop === 'startNfcScan' ||
|
|
872
863
|
prop === 'checkC06' ||
|
|
@@ -1003,7 +994,7 @@ export { SDKFaceDetectStatus } from '../types/ekycLivenessType';
|
|
|
1003
994
|
export type { FaceServiceConfig } from '../types/ekycFaceType';
|
|
1004
995
|
export type { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent } from '../types/ekycType';
|
|
1005
996
|
export type { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
1006
|
-
export type {
|
|
997
|
+
export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType';
|
|
1007
998
|
|
|
1008
999
|
// Export constants
|
|
1009
1000
|
export { SDK_VERSION, SDK_NAME };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import sdkEKYC, { SDKeKYC, SDK_VERSION, SDK_NAME } from '../../EKYCModule';
|
|
3
3
|
import { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
4
|
-
import {
|
|
4
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType';
|
|
5
5
|
import { LivenessConfig } from '../types/ekycLivenessType';
|
|
6
6
|
import { FaceServiceConfig } from '../types/ekycFaceType';
|
|
7
7
|
import { SDKEkycResultStringWithEvent, SDKEkycResultWithEvent } from '../types/ekycType';
|
|
@@ -197,32 +197,30 @@ export class FinosESignModule {
|
|
|
197
197
|
return await this.sdk.getSdkToken(identity, name, deviceId);
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
+
|
|
200
201
|
/**
|
|
201
|
-
* Open eSign
|
|
202
|
-
* @param accessToken
|
|
203
|
-
* @param username
|
|
204
|
-
* @param rememberMe Remember
|
|
205
|
-
* @param userEsignModel User info for auto
|
|
206
|
-
* @param privateKeyFilePath Path to private key file
|
|
202
|
+
* Open eSign Session
|
|
203
|
+
* @param accessToken Access token (JWT)
|
|
204
|
+
* @param username Username
|
|
205
|
+
* @param rememberMe Remember me flag
|
|
206
|
+
* @param userEsignModel User info model (for auto-token generation)
|
|
207
|
+
* @param privateKeyFilePath Path to private key file (for auto-token generation)
|
|
207
208
|
*/
|
|
208
209
|
public async openSessionId(
|
|
209
|
-
accessToken
|
|
210
|
-
username
|
|
211
|
-
rememberMe
|
|
212
|
-
userEsignModel?: UserEsignModel,
|
|
213
|
-
privateKeyFilePath?: string
|
|
210
|
+
accessToken: string | null,
|
|
211
|
+
username: string | null,
|
|
212
|
+
rememberMe: boolean | null
|
|
214
213
|
): Promise<ESignOpenSessionResult> {
|
|
215
214
|
this.validateSDKReady();
|
|
216
215
|
// Pass through to SDK - error handling is done in EKYCModule.ts
|
|
217
216
|
return await this.sdk.openSessionId(
|
|
218
217
|
accessToken,
|
|
219
218
|
username,
|
|
220
|
-
rememberMe
|
|
221
|
-
userEsignModel,
|
|
222
|
-
privateKeyFilePath
|
|
219
|
+
rememberMe
|
|
223
220
|
);
|
|
224
221
|
}
|
|
225
222
|
|
|
223
|
+
|
|
226
224
|
/**
|
|
227
225
|
* Register device for eSign
|
|
228
226
|
* @param recoverCode 8-digit recovery code
|
|
@@ -623,10 +621,12 @@ const isMethod = (prop: string | symbol): boolean => {
|
|
|
623
621
|
prop.startsWith('on') ||
|
|
624
622
|
prop === 'initialize' ||
|
|
625
623
|
prop === 'initializeESign' ||
|
|
624
|
+
prop === 'getSdkToken' ||
|
|
625
|
+
prop === 'openSessionId' ||
|
|
626
626
|
prop === 'sendOtp' ||
|
|
627
627
|
prop === 'verifyOtp' ||
|
|
628
628
|
prop === 'resendOtp' ||
|
|
629
|
-
|
|
629
|
+
|
|
630
630
|
prop === 'registerDevice' ||
|
|
631
631
|
prop === 'listCerts' ||
|
|
632
632
|
prop === 'verifyCert' ||
|
|
@@ -704,7 +704,7 @@ const createFinosESignStub = (): FinosESignModule => {
|
|
|
704
704
|
// Add all other methods
|
|
705
705
|
const otherMethods = [
|
|
706
706
|
'initialize', 'startNfcScan', 'checkC06', 'startOcr', 'startLiveness', 'startFaceCompare',
|
|
707
|
-
'startEkycUI', 'sendOtp', 'verifyOtp', 'resendOtp', 'initializeESign', 'openSessionId',
|
|
707
|
+
'startEkycUI', 'sendOtp', 'verifyOtp', 'resendOtp', 'initializeESign', 'getSdkToken', 'openSessionId',
|
|
708
708
|
'registerDevice', 'listCerts', 'verifyCert', 'listSignRequest', 'confirmSign',
|
|
709
709
|
'registerRemoteSigning', 'signPdf', 'sendConfirmationDocument',
|
|
710
710
|
'onResume', 'onPause', 'isSDKReady', 'getSDKInfo'
|
|
@@ -757,7 +757,7 @@ export const FinosESign = createFinosESignWrapper();
|
|
|
757
757
|
|
|
758
758
|
// Export types
|
|
759
759
|
export type { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
760
|
-
export type {
|
|
760
|
+
export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType';
|
|
761
761
|
export type { LivenessConfig } from '../types/ekycLivenessType';
|
|
762
762
|
export { SDKFaceDetectStatus } from '../types/ekycLivenessType';
|
|
763
763
|
export type { FaceServiceConfig } from '../types/ekycFaceType';
|
|
@@ -1,31 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* eSign Initialize Result
|
|
3
5
|
*/
|
|
4
6
|
export interface UserEsignModel {
|
|
5
|
-
/**
|
|
6
|
-
* ID card number (CCCD/CMND)
|
|
7
|
-
*/
|
|
8
7
|
cccd: string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* User name
|
|
12
|
-
*/
|
|
13
8
|
name: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* Device type (e.g., "Android", "iOS")
|
|
17
|
-
*/
|
|
18
|
-
device: string;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Device ID
|
|
22
|
-
*/
|
|
23
|
-
deviceId: string;
|
|
9
|
+
device?: string;
|
|
10
|
+
deviceId?: string;
|
|
24
11
|
}
|
|
25
12
|
|
|
26
|
-
/**
|
|
27
|
-
* eSign Initialize Result
|
|
28
|
-
*/
|
|
29
13
|
export interface ESignInitResult {
|
|
30
14
|
code: string;
|
|
31
15
|
message: string;
|