@finos_sdk/sdk-ekyc 1.2.9 → 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 +206 -160
- package/dist/EKYCModule.d.ts +9 -9
- package/dist/EKYCModule.js +78 -43
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/package.json +1 -1
- package/dist/src/modules/FinosEKYCModule.d.ts +23 -24
- package/dist/src/modules/FinosEKYCModule.js +42 -60
- package/dist/src/modules/FinosESignModule.d.ts +29 -24
- package/dist/src/modules/FinosESignModule.js +82 -226
- package/dist/src/types/ekycESignType.d.ts +3 -18
- package/dist/src/types/ekycLivenessType.d.ts +11 -2
- package/dist/src/types/ekycLivenessType.js +7 -0
- package/package.json +2 -2
- package/src/modules/FinosEKYCModule.ts +92 -116
- package/src/modules/FinosESignModule.ts +130 -279
- package/src/modules/README.md +21 -2
- package/src/types/ekycESignType.ts +5 -21
- package/src/types/ekycLivenessType.ts +16 -2
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.SDK_NAME = exports.SDK_VERSION = exports.FinosEKYC = exports.FinosEKYCModule = void 0;
|
|
26
|
+
exports.SDK_NAME = exports.SDK_VERSION = exports.SDKFaceDetectStatus = exports.FinosEKYC = exports.FinosEKYCModule = void 0;
|
|
27
27
|
const react_native_1 = require("react-native");
|
|
28
28
|
const EKYCModule_1 = __importStar(require("../../EKYCModule"));
|
|
29
29
|
Object.defineProperty(exports, "SDK_VERSION", { enumerable: true, get: function () { return EKYCModule_1.SDK_VERSION; } });
|
|
@@ -165,7 +165,7 @@ class FinosEKYCModule {
|
|
|
165
165
|
* Start OCR document scanning
|
|
166
166
|
* @param config OCR configuration
|
|
167
167
|
*/
|
|
168
|
-
async
|
|
168
|
+
async startOcr(config) {
|
|
169
169
|
this.validateSDKReady();
|
|
170
170
|
try {
|
|
171
171
|
console.log('📄 Starting OCR scan...');
|
|
@@ -180,12 +180,27 @@ class FinosEKYCModule {
|
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
182
|
* Start liveness detection
|
|
183
|
-
* @param config Liveness configuration
|
|
183
|
+
* @param config Liveness configuration
|
|
184
|
+
* @param config.isActiveLiveness - Enable active liveness detection (default: false)
|
|
185
|
+
* @param config.autoCapture - Enable auto capture (default: true)
|
|
186
|
+
* @param config.isShowCameraFont - Show camera font (default: true)
|
|
187
|
+
* @param config.customActions - Custom actions array (LEFT, RIGHT, STRAIGHT). If provided, uses these actions instead of random
|
|
188
|
+
* @param config.activeActionCount - Number of random actions (1-10), only used when customActions is null (default: 2)
|
|
189
|
+
* @param config.switchFrontCamera - Use front camera (default: false)
|
|
184
190
|
*/
|
|
185
191
|
async startLiveness(config) {
|
|
186
192
|
this.validateSDKReady();
|
|
187
193
|
try {
|
|
188
194
|
console.log('👁️ Starting liveness detection...');
|
|
195
|
+
if (config.isActiveLiveness !== undefined) {
|
|
196
|
+
console.log('🔴 Active liveness:', config.isActiveLiveness ? 'ON' : 'OFF');
|
|
197
|
+
}
|
|
198
|
+
if (config.customActions && config.customActions.length > 0) {
|
|
199
|
+
console.log('🎯 Custom actions:', config.customActions.join(', '));
|
|
200
|
+
}
|
|
201
|
+
else if (config.activeActionCount !== undefined) {
|
|
202
|
+
console.log('🎲 Random actions count:', config.activeActionCount);
|
|
203
|
+
}
|
|
189
204
|
if (config.switchFrontCamera !== undefined) {
|
|
190
205
|
console.log('📷 Front camera setting:', config.switchFrontCamera ? 'ON' : 'OFF');
|
|
191
206
|
}
|
|
@@ -287,13 +302,13 @@ class FinosEKYCModule {
|
|
|
287
302
|
/**
|
|
288
303
|
* Listen for OCR success events
|
|
289
304
|
*/
|
|
290
|
-
|
|
305
|
+
onOcrSuccess(callback) {
|
|
291
306
|
return this.sdk.onOcrSuccess(callback);
|
|
292
307
|
}
|
|
293
308
|
/**
|
|
294
309
|
* Listen for OCR error events
|
|
295
310
|
*/
|
|
296
|
-
|
|
311
|
+
onOcrError(callback) {
|
|
297
312
|
return this.sdk.onOcrError(callback);
|
|
298
313
|
}
|
|
299
314
|
/**
|
|
@@ -388,13 +403,6 @@ class FinosEKYCModule {
|
|
|
388
403
|
}
|
|
389
404
|
return listener;
|
|
390
405
|
}
|
|
391
|
-
onSmsOtpVerifySuccess(callback) {
|
|
392
|
-
const listener = this.sdk.onSmsOtpVerifySuccess(callback);
|
|
393
|
-
if (!listener) {
|
|
394
|
-
console.warn('⚠️ onSmsOtpVerifySuccess: Event emitter not ready.');
|
|
395
|
-
}
|
|
396
|
-
return listener;
|
|
397
|
-
}
|
|
398
406
|
onSmsOtpResendSuccess(callback) {
|
|
399
407
|
const listener = this.sdk.onSmsOtpResendSuccess(callback);
|
|
400
408
|
if (!listener) {
|
|
@@ -427,25 +435,17 @@ class FinosEKYCModule {
|
|
|
427
435
|
}
|
|
428
436
|
}
|
|
429
437
|
/**
|
|
430
|
-
* Open eSign
|
|
431
|
-
* @param accessToken
|
|
432
|
-
* @param username
|
|
433
|
-
* @param rememberMe Remember
|
|
434
|
-
* @param userEsignModel User info for auto
|
|
435
|
-
* @param privateKeyFilePath Path to private key file
|
|
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)
|
|
436
444
|
*/
|
|
437
|
-
async openSessionId(accessToken, username, rememberMe
|
|
445
|
+
async openSessionId(accessToken, username, rememberMe) {
|
|
438
446
|
this.validateSDKReady();
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
const result = await this.sdk.openSessionId(accessToken, username, rememberMe, userEsignModel, privateKeyFilePath);
|
|
442
|
-
console.log('✅ eSign session opened successfully');
|
|
443
|
-
return result;
|
|
444
|
-
}
|
|
445
|
-
catch (error) {
|
|
446
|
-
console.error('❌ eSign session open failed:', error);
|
|
447
|
-
throw error;
|
|
448
|
-
}
|
|
447
|
+
// Pass through to SDK - error handling is done in EKYCModule.ts
|
|
448
|
+
return await this.sdk.openSessionId(accessToken, username, rememberMe);
|
|
449
449
|
}
|
|
450
450
|
/**
|
|
451
451
|
* Register device for eSign
|
|
@@ -540,34 +540,16 @@ class FinosEKYCModule {
|
|
|
540
540
|
throw error;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
/**
|
|
544
|
-
* Authenticate with eSign
|
|
545
|
-
* @param username eSign username
|
|
546
|
-
* @param password eSign password
|
|
547
|
-
*/
|
|
548
|
-
async authenticate(username, password) {
|
|
549
|
-
this.validateSDKReady();
|
|
550
|
-
try {
|
|
551
|
-
console.log('🔐 Authenticating with eSign...');
|
|
552
|
-
const result = await this.sdk.authenticate(username, password);
|
|
553
|
-
console.log('✅ eSign authentication successful');
|
|
554
|
-
return result;
|
|
555
|
-
}
|
|
556
|
-
catch (error) {
|
|
557
|
-
console.error('❌ eSign authentication failed:', error);
|
|
558
|
-
throw error;
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
543
|
/**
|
|
562
544
|
* Register remote signing certificate
|
|
563
545
|
* @param accessToken JWT access token
|
|
564
546
|
* @param requestJson JSON request body
|
|
565
547
|
*/
|
|
566
|
-
async registerRemoteSigning(
|
|
548
|
+
async registerRemoteSigning(requestJson) {
|
|
567
549
|
this.validateSDKReady();
|
|
568
550
|
try {
|
|
569
551
|
console.log('📝 Registering remote signing certificate...');
|
|
570
|
-
const result = await this.sdk.registerRemoteSigning(
|
|
552
|
+
const result = await this.sdk.registerRemoteSigning(requestJson);
|
|
571
553
|
console.log('✅ Remote signing certificate registered successfully');
|
|
572
554
|
return result;
|
|
573
555
|
}
|
|
@@ -581,11 +563,11 @@ class FinosEKYCModule {
|
|
|
581
563
|
* @param accessToken JWT access token
|
|
582
564
|
* @param requestJson JSON request body
|
|
583
565
|
*/
|
|
584
|
-
async signPdf(
|
|
566
|
+
async signPdf(requestJson) {
|
|
585
567
|
this.validateSDKReady();
|
|
586
568
|
try {
|
|
587
569
|
console.log('📄 Signing PDF document...');
|
|
588
|
-
const result = await this.sdk.signPdf(
|
|
570
|
+
const result = await this.sdk.signPdf(requestJson);
|
|
589
571
|
console.log('✅ PDF document signed successfully');
|
|
590
572
|
return result;
|
|
591
573
|
}
|
|
@@ -599,11 +581,11 @@ class FinosEKYCModule {
|
|
|
599
581
|
* @param accessToken JWT access token
|
|
600
582
|
* @param requestJson JSON string containing request data
|
|
601
583
|
*/
|
|
602
|
-
async sendConfirmationDocument(
|
|
584
|
+
async sendConfirmationDocument(requestJson) {
|
|
603
585
|
this.validateSDKReady();
|
|
604
586
|
try {
|
|
605
587
|
console.log('📧 Sending confirmation document...');
|
|
606
|
-
const result = await this.sdk.sendConfirmationDocument(
|
|
588
|
+
const result = await this.sdk.sendConfirmationDocument(requestJson);
|
|
607
589
|
console.log('✅ Confirmation document sent successfully');
|
|
608
590
|
return result;
|
|
609
591
|
}
|
|
@@ -634,9 +616,6 @@ class FinosEKYCModule {
|
|
|
634
616
|
onESignConfirmSignSuccess(callback) {
|
|
635
617
|
return this.sdk.onESignConfirmSignSuccess(callback);
|
|
636
618
|
}
|
|
637
|
-
onESignAuthenticateSuccess(callback) {
|
|
638
|
-
return this.sdk.onESignAuthenticateSuccess(callback);
|
|
639
|
-
}
|
|
640
619
|
onESignRegisterRemoteSigningSuccess(callback) {
|
|
641
620
|
return this.sdk.onESignRegisterRemoteSigningSuccess(callback);
|
|
642
621
|
}
|
|
@@ -721,6 +700,7 @@ const isMethod = (prop) => {
|
|
|
721
700
|
return typeof prototype[prop] === 'function' ||
|
|
722
701
|
prop.startsWith('on') ||
|
|
723
702
|
prop === 'initialize' ||
|
|
703
|
+
prop === 'openSessionId' ||
|
|
724
704
|
prop === 'startEkycUI' ||
|
|
725
705
|
prop === 'startNfcScan' ||
|
|
726
706
|
prop === 'checkC06' ||
|
|
@@ -735,13 +715,13 @@ const createFinosEKYCStub = () => {
|
|
|
735
715
|
const eventListenerMethods = [
|
|
736
716
|
'onNfcScanStart', 'onNfcScanSuccess', 'onNfcError',
|
|
737
717
|
'onC06Success', 'onC06Error',
|
|
738
|
-
'
|
|
718
|
+
'onOcrSuccess', 'onOcrError',
|
|
739
719
|
'onLivenessSuccess', 'onLivenessError',
|
|
740
720
|
'onFaceCompareSuccess', 'onFaceCompareError',
|
|
741
721
|
'onSmsOtpSendSuccess', 'onSmsOtpVerifySuccess', 'onSmsOtpResendSuccess', 'onSmsOtpError',
|
|
742
722
|
'onESignInitSuccess', 'onESignOpenSessionSuccess', 'onESignRegisterDeviceSuccess',
|
|
743
723
|
'onESignListCertsSuccess', 'onESignVerifyCertSuccess', 'onESignListSignRequestSuccess',
|
|
744
|
-
'onESignConfirmSignSuccess', '
|
|
724
|
+
'onESignConfirmSignSuccess', 'onESignRegisterRemoteSigningSuccess',
|
|
745
725
|
'onESignSignPdfSuccess', 'onESignSendConfirmationDocumentSuccess', 'onESignError'
|
|
746
726
|
];
|
|
747
727
|
eventListenerMethods.forEach(method => {
|
|
@@ -752,10 +732,10 @@ const createFinosEKYCStub = () => {
|
|
|
752
732
|
});
|
|
753
733
|
// Add all other methods
|
|
754
734
|
const otherMethods = [
|
|
755
|
-
'initialize', 'startNfcScan', 'checkC06', '
|
|
735
|
+
'initialize', 'startNfcScan', 'checkC06', 'startOcr', 'startLiveness', 'startFaceCompare',
|
|
756
736
|
'startEkycUI', 'sendOtp', 'verifyOtp', 'resendOtp', 'initializeESign', 'openSessionId',
|
|
757
737
|
'registerDevice', 'listCerts', 'verifyCert', 'listSignRequest', 'confirmSign',
|
|
758
|
-
'
|
|
738
|
+
'registerRemoteSigning', 'signPdf', 'sendConfirmationDocument',
|
|
759
739
|
'onResume', 'onPause', 'isSDKReady', 'getSDKInfo'
|
|
760
740
|
];
|
|
761
741
|
otherMethods.forEach(method => {
|
|
@@ -837,5 +817,7 @@ const createFinosEKYCWrapper = () => {
|
|
|
837
817
|
};
|
|
838
818
|
// Export - this ensures FinosEKYC is never undefined
|
|
839
819
|
exports.FinosEKYC = createFinosEKYCWrapper();
|
|
820
|
+
var ekycLivenessType_1 = require("../types/ekycLivenessType");
|
|
821
|
+
Object.defineProperty(exports, "SDKFaceDetectStatus", { enumerable: true, get: function () { return ekycLivenessType_1.SDKFaceDetectStatus; } });
|
|
840
822
|
// Default export
|
|
841
823
|
exports.default = exports.FinosEKYC;
|
|
@@ -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';
|
|
@@ -65,17 +65,25 @@ export declare class FinosESignModule {
|
|
|
65
65
|
onSmsOtpError(callback: (error: SmsOtpError) => void): import("react-native").EmitterSubscription | null;
|
|
66
66
|
/**
|
|
67
67
|
* Initialize eSign SDK
|
|
68
|
+
* @param finosToken Optional access token (Client Credentials)
|
|
68
69
|
*/
|
|
69
|
-
initializeESign(): Promise<ESignInitResult>;
|
|
70
|
+
initializeESign(finosToken?: string): Promise<ESignInitResult>;
|
|
70
71
|
/**
|
|
71
|
-
*
|
|
72
|
-
* @param
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @param userEsignModel User info for auto token creation (optional if using accessToken)
|
|
76
|
-
* @param privateKeyFilePath Path to private key file in assets (required if using userEsignModel)
|
|
72
|
+
* Get SDK Token for Session
|
|
73
|
+
* @param identity User Identity (CCCD/CMND)
|
|
74
|
+
* @param name User Name
|
|
75
|
+
* @param deviceId Device ID
|
|
77
76
|
*/
|
|
78
|
-
|
|
77
|
+
getSdkToken(identity: string, name: string, deviceId: string): Promise<string>;
|
|
78
|
+
/**
|
|
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
|
+
*/
|
|
86
|
+
openSessionId(accessToken: string | null, username: string | null, rememberMe: boolean | null): Promise<ESignOpenSessionResult>;
|
|
79
87
|
/**
|
|
80
88
|
* Register device for eSign
|
|
81
89
|
* @param recoverCode 8-digit recovery code
|
|
@@ -122,34 +130,25 @@ export declare class FinosESignModule {
|
|
|
122
130
|
code: string;
|
|
123
131
|
message: string;
|
|
124
132
|
}>;
|
|
125
|
-
/**
|
|
126
|
-
* Authenticate with eSign
|
|
127
|
-
* @param username eSign username
|
|
128
|
-
* @param password eSign password
|
|
129
|
-
*/
|
|
130
|
-
authenticate(username: string, password: string): Promise<ESignAuthenticateResult>;
|
|
131
133
|
/**
|
|
132
134
|
* Register remote signing certificate
|
|
133
|
-
* @param accessToken JWT access token
|
|
134
135
|
* @param requestJson JSON request body
|
|
135
136
|
*/
|
|
136
|
-
registerRemoteSigning(
|
|
137
|
+
registerRemoteSigning(requestJson: string): Promise<{
|
|
137
138
|
response: string;
|
|
138
139
|
}>;
|
|
139
140
|
/**
|
|
140
141
|
* Sign PDF document
|
|
141
|
-
* @param accessToken JWT access token
|
|
142
142
|
* @param requestJson JSON request body
|
|
143
143
|
*/
|
|
144
|
-
signPdf(
|
|
144
|
+
signPdf(requestJson: string): Promise<{
|
|
145
145
|
response: string;
|
|
146
146
|
}>;
|
|
147
147
|
/**
|
|
148
148
|
* Send confirmation document
|
|
149
|
-
* @param accessToken JWT access token
|
|
150
149
|
* @param requestJson JSON string containing request data
|
|
151
150
|
*/
|
|
152
|
-
sendConfirmationDocument(
|
|
151
|
+
sendConfirmationDocument(requestJson: string): Promise<{
|
|
153
152
|
response: string;
|
|
154
153
|
}>;
|
|
155
154
|
/**
|
|
@@ -176,7 +175,6 @@ export declare class FinosESignModule {
|
|
|
176
175
|
code: string;
|
|
177
176
|
message: string;
|
|
178
177
|
}) => void): import("react-native").EmitterSubscription | null;
|
|
179
|
-
onESignAuthenticateSuccess(callback: (data: ESignAuthenticateResult) => void): import("react-native").EmitterSubscription | null;
|
|
180
178
|
onESignRegisterRemoteSigningSuccess(callback: (data: {
|
|
181
179
|
response: string;
|
|
182
180
|
}) => void): import("react-native").EmitterSubscription | null;
|
|
@@ -189,7 +187,13 @@ export declare class FinosESignModule {
|
|
|
189
187
|
onESignError(callback: (error: ESignError) => void): import("react-native").EmitterSubscription | null;
|
|
190
188
|
/**
|
|
191
189
|
* Start liveness detection
|
|
192
|
-
* @param config Liveness configuration
|
|
190
|
+
* @param config Liveness configuration
|
|
191
|
+
* @param config.isActiveLiveness - Enable active liveness detection (default: false)
|
|
192
|
+
* @param config.autoCapture - Enable auto capture (default: true)
|
|
193
|
+
* @param config.isShowCameraFont - Show camera font (default: true)
|
|
194
|
+
* @param config.customActions - Custom actions array (LEFT, RIGHT, STRAIGHT). If provided, uses these actions instead of random
|
|
195
|
+
* @param config.activeActionCount - Number of random actions (1-10), only used when customActions is null (default: 2)
|
|
196
|
+
* @param config.switchFrontCamera - Use front camera (default: false)
|
|
193
197
|
*/
|
|
194
198
|
startLiveness(config: LivenessConfig): Promise<SDKEkycResultStringWithEvent>;
|
|
195
199
|
onLivenessSuccess(callback: (data: SDKEkycResultStringWithEvent) => void): import("react-native").EmitterSubscription | null;
|
|
@@ -262,8 +266,9 @@ export declare class FinosESignModule {
|
|
|
262
266
|
}
|
|
263
267
|
export declare const FinosESign: FinosESignModule;
|
|
264
268
|
export type { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
265
|
-
export type {
|
|
269
|
+
export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType';
|
|
266
270
|
export type { LivenessConfig } from '../types/ekycLivenessType';
|
|
271
|
+
export { SDKFaceDetectStatus } from '../types/ekycLivenessType';
|
|
267
272
|
export type { FaceServiceConfig } from '../types/ekycFaceType';
|
|
268
273
|
export type { SDKEkycResultStringWithEvent, SDKEkycResultWithEvent } from '../types/ekycType';
|
|
269
274
|
export { SDK_VERSION, SDK_NAME };
|