@finos_sdk/sdk-ekyc 1.2.9 → 1.3.1

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.
@@ -3,10 +3,10 @@ import { NfcConfig, NfcError } from './src/types/ekycNFCType';
3
3
  import { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent } from './src/types/ekycType';
4
4
  import { C06Config } from './src/types/ekycC06Type';
5
5
  import { OcrConfig } from './src/types/ekycOCRType';
6
- import { LivenessConfig } from './src/types/ekycLivenessType';
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 { UserEsignModel, ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from './src/types/ekycESignType';
9
+ import { UserEsignModel, 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 {
@@ -52,7 +52,8 @@ declare class SDKeKYC {
52
52
  onSmsOtpVerifySuccess(callback: (data: SmsOtpResult) => void): EmitterSubscription | null;
53
53
  onSmsOtpResendSuccess(callback: (data: SmsOtpResult) => void): EmitterSubscription | null;
54
54
  onSmsOtpError(callback: (error: SmsOtpError) => void): EmitterSubscription | null;
55
- initializeESign(): Promise<ESignInitResult>;
55
+ initializeESign(finosToken?: string): Promise<ESignInitResult>;
56
+ getSdkToken(identity: string, name: string, deviceId: string): Promise<string>;
56
57
  openSessionId(accessToken?: string, username?: string, rememberMe?: boolean, userEsignModel?: UserEsignModel, privateKeyFilePath?: string): Promise<ESignOpenSessionResult>;
57
58
  registerDevice(recoverCode: string, pinCode: string, fcmToken?: string): Promise<{
58
59
  code: string;
@@ -72,14 +73,13 @@ declare class SDKeKYC {
72
73
  code: string;
73
74
  message: string;
74
75
  }>;
75
- authenticate(username: string, password: string): Promise<ESignAuthenticateResult>;
76
- registerRemoteSigning(accessToken: string, requestJson: string): Promise<{
76
+ registerRemoteSigning(requestJson: string): Promise<{
77
77
  response: string;
78
78
  }>;
79
- signPdf(accessToken: string, requestJson: string): Promise<{
79
+ signPdf(requestJson: string): Promise<{
80
80
  response: string;
81
81
  }>;
82
- sendConfirmationDocument(accessToken: string, requestJson: string): Promise<{
82
+ sendConfirmationDocument(requestJson: string): Promise<{
83
83
  response: string;
84
84
  }>;
85
85
  onESignInitSuccess(callback: (data: ESignInitResult) => void): EmitterSubscription | null;
@@ -102,7 +102,6 @@ declare class SDKeKYC {
102
102
  code: string;
103
103
  message: string;
104
104
  }) => void): EmitterSubscription | null;
105
- onESignAuthenticateSuccess(callback: (data: ESignAuthenticateResult) => void): EmitterSubscription | null;
106
105
  onESignRegisterRemoteSigningSuccess(callback: (data: {
107
106
  response: string;
108
107
  }) => void): EmitterSubscription | null;
@@ -164,4 +163,5 @@ declare class SDKeKYC {
164
163
  }
165
164
  declare const sdkEKYC: SDKeKYC;
166
165
  export { SDKeKYC };
166
+ export { SDKFaceDetectStatus };
167
167
  export default sdkEKYC;
@@ -3,8 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SDKeKYC = exports.SDK_NAME = exports.SDK_VERSION = void 0;
6
+ exports.SDKFaceDetectStatus = exports.SDKeKYC = exports.SDK_NAME = exports.SDK_VERSION = void 0;
7
7
  const react_native_1 = require("react-native");
8
+ const ekycLivenessType_1 = require("./src/types/ekycLivenessType");
9
+ Object.defineProperty(exports, "SDKFaceDetectStatus", { enumerable: true, get: function () { return ekycLivenessType_1.SDKFaceDetectStatus; } });
8
10
  // Version information - dynamically imported from package.json
9
11
  const package_json_1 = __importDefault(require("./package.json"));
10
12
  exports.SDK_VERSION = package_json_1.default.version;
@@ -204,11 +206,13 @@ class SDKeKYC {
204
206
  }
205
207
  }
206
208
  async startLiveness(config) {
207
- var _a;
209
+ var _a, _b, _c;
208
210
  this.validateConfig(config, ['appKey', 'selfieImage', 'transactionId']);
209
211
  const nativeModule = this.ensureNativeModule();
210
212
  try {
211
- return await nativeModule.startLiveness(config.appKey, config.selfieImage, config.usingRandomAction, (_a = config.transactionId) !== null && _a !== void 0 ? _a : '', config.isStraight, config.switchFrontCamera !== undefined ? config.switchFrontCamera : false);
213
+ // Convert SDKFaceDetectStatus enum array to string array
214
+ const customActionsStrings = (_b = (_a = config.customActions) === null || _a === void 0 ? void 0 : _a.map(action => String(action))) !== null && _b !== void 0 ? _b : undefined;
215
+ return await nativeModule.startLiveness(config.appKey, config.selfieImage, (_c = config.transactionId) !== null && _c !== void 0 ? _c : '', config.switchFrontCamera !== undefined ? config.switchFrontCamera : false, config.isActiveLiveness, config.autoCapture, config.isShowCameraFont, customActionsStrings, config.activeActionCount, config.forceCaptureTimeout);
212
216
  }
213
217
  catch (error) {
214
218
  console.error('Liveness Error:', error);
@@ -527,10 +531,10 @@ class SDKeKYC {
527
531
  }
528
532
  }
529
533
  // ==================== eSign Methods ====================
530
- async initializeESign() {
534
+ async initializeESign(finosToken) {
531
535
  const nativeModule = this.ensureNativeModule();
532
536
  try {
533
- const result = await nativeModule.initializeESign();
537
+ const result = await nativeModule.initializeESign(finosToken);
534
538
  return result;
535
539
  }
536
540
  catch (error) {
@@ -538,6 +542,16 @@ class SDKeKYC {
538
542
  throw error;
539
543
  }
540
544
  }
545
+ async getSdkToken(identity, name, deviceId) {
546
+ const nativeModule = this.ensureNativeModule();
547
+ try {
548
+ return await nativeModule.getSdkToken(identity, name, deviceId);
549
+ }
550
+ catch (error) {
551
+ console.error('getSdkToken Error:', error);
552
+ throw error;
553
+ }
554
+ }
541
555
  async openSessionId(accessToken, username, rememberMe, userEsignModel, privateKeyFilePath) {
542
556
  const nativeModule = this.ensureNativeModule();
543
557
  try {
@@ -553,7 +567,7 @@ class SDKeKYC {
553
567
  async registerDevice(recoverCode, pinCode, fcmToken) {
554
568
  const nativeModule = this.ensureNativeModule();
555
569
  try {
556
- const result = await nativeModule.registerDevice(recoverCode, pinCode, fcmToken || null);
570
+ const result = await nativeModule.registerDevice(recoverCode, pinCode, fcmToken || "");
557
571
  return result;
558
572
  }
559
573
  catch (error) {
@@ -564,7 +578,19 @@ class SDKeKYC {
564
578
  async listCerts(pageNumber = 1, pageSize = 10) {
565
579
  const nativeModule = this.ensureNativeModule();
566
580
  try {
581
+ console.log(`📋 listCerts called with pageNumber=${pageNumber}, pageSize=${pageSize}`);
567
582
  const result = await nativeModule.listCerts(pageNumber, pageSize);
583
+ console.log('📋 listCerts result:', JSON.stringify(result));
584
+ // Validate response format
585
+ if (!result) {
586
+ console.warn('⚠️ listCerts: result is null/undefined, returning empty array');
587
+ return { certs: [] };
588
+ }
589
+ // Ensure certs array exists
590
+ if (!result.certs) {
591
+ console.warn('⚠️ listCerts: result.certs is missing, creating empty array');
592
+ return { certs: [] };
593
+ }
568
594
  return result;
569
595
  }
570
596
  catch (error) {
@@ -575,7 +601,23 @@ class SDKeKYC {
575
601
  async verifyCert(serial) {
576
602
  const nativeModule = this.ensureNativeModule();
577
603
  try {
604
+ console.log(`✅ verifyCert called with serial=${serial}`);
578
605
  const result = await nativeModule.verifyCert(serial);
606
+ console.log('✅ verifyCert result:', JSON.stringify(result));
607
+ // Validate response format
608
+ if (!result) {
609
+ console.warn('⚠️ verifyCert: result is null/undefined');
610
+ throw new Error('verifyCert returned null/undefined result');
611
+ }
612
+ // Ensure code and message exist
613
+ if (!result.code || !result.message) {
614
+ console.warn('⚠️ verifyCert: result missing code or message:', result);
615
+ // Try to create a valid response from what we have
616
+ return {
617
+ code: result.code || 'UNKNOWN',
618
+ message: result.message || 'Unknown response'
619
+ };
620
+ }
579
621
  return result;
580
622
  }
581
623
  catch (error) {
@@ -597,7 +639,7 @@ class SDKeKYC {
597
639
  async confirmSign(signRequestId, pinCode, authId, authData, confirm = true) {
598
640
  const nativeModule = this.ensureNativeModule();
599
641
  try {
600
- const result = await nativeModule.confirmSign(signRequestId, pinCode, authId || null, authData || null, confirm !== undefined ? confirm : true);
642
+ const result = await nativeModule.confirmSign(signRequestId, pinCode, authId || "", authData || "", confirm !== undefined ? confirm : true);
601
643
  return result;
602
644
  }
603
645
  catch (error) {
@@ -605,21 +647,10 @@ class SDKeKYC {
605
647
  throw error;
606
648
  }
607
649
  }
608
- async authenticate(username, password) {
609
- const nativeModule = this.ensureNativeModule();
610
- try {
611
- const result = await nativeModule.authenticate(username, password);
612
- return result;
613
- }
614
- catch (error) {
615
- console.error('eSign Authenticate Error:', error);
616
- throw error;
617
- }
618
- }
619
- async registerRemoteSigning(accessToken, requestJson) {
650
+ async registerRemoteSigning(requestJson) {
620
651
  const nativeModule = this.ensureNativeModule();
621
652
  try {
622
- const result = await nativeModule.registerRemoteSigning(accessToken, requestJson);
653
+ const result = await nativeModule.registerRemoteSigning(requestJson);
623
654
  return result;
624
655
  }
625
656
  catch (error) {
@@ -627,10 +658,31 @@ class SDKeKYC {
627
658
  throw error;
628
659
  }
629
660
  }
630
- async signPdf(accessToken, requestJson) {
661
+ async signPdf(requestJson) {
631
662
  const nativeModule = this.ensureNativeModule();
632
663
  try {
633
- const result = await nativeModule.signPdf(accessToken, requestJson);
664
+ console.log('📄 signPdf called with requestJson length:', (requestJson === null || requestJson === void 0 ? void 0 : requestJson.length) || 0);
665
+ const result = await nativeModule.signPdf(requestJson);
666
+ console.log('📄 signPdf result:', JSON.stringify(result));
667
+ // Validate response format
668
+ if (!result) {
669
+ console.warn('⚠️ signPdf: result is null/undefined');
670
+ throw new Error('signPdf returned null/undefined result');
671
+ }
672
+ // Ensure response field exists
673
+ if (!result.response) {
674
+ console.warn('⚠️ signPdf: result.response is missing:', result);
675
+ // Try to create a valid response from what we have
676
+ // Check if result itself is a string
677
+ if (typeof result === 'string') {
678
+ return { response: result };
679
+ }
680
+ // Check if result has message field
681
+ if (result.message) {
682
+ return { response: result.message };
683
+ }
684
+ throw new Error('signPdf result missing response field');
685
+ }
634
686
  return result;
635
687
  }
636
688
  catch (error) {
@@ -638,10 +690,10 @@ class SDKeKYC {
638
690
  throw error;
639
691
  }
640
692
  }
641
- async sendConfirmationDocument(accessToken, requestJson) {
693
+ async sendConfirmationDocument(requestJson) {
642
694
  const nativeModule = this.ensureNativeModule();
643
695
  try {
644
- const result = await nativeModule.sendConfirmationDocument(accessToken, requestJson);
696
+ const result = await nativeModule.sendConfirmationDocument(requestJson);
645
697
  return result;
646
698
  }
647
699
  catch (error) {
@@ -762,22 +814,6 @@ class SDKeKYC {
762
814
  return null;
763
815
  }
764
816
  }
765
- onESignAuthenticateSuccess(callback) {
766
- try {
767
- const emitter = this.ensureEventEmitter();
768
- if (!emitter) {
769
- console.error('❌ Event emitter not available for onESignAuthenticateSuccess');
770
- return null;
771
- }
772
- const listener = emitter.addListener('onESignAuthenticateSuccess', callback);
773
- this.listeners.push(listener);
774
- return listener;
775
- }
776
- catch (error) {
777
- console.error('Failed to add onESignAuthenticateSuccess listener:', error);
778
- return null;
779
- }
780
- }
781
817
  onESignRegisterRemoteSigningSuccess(callback) {
782
818
  try {
783
819
  const emitter = this.ensureEventEmitter();
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export type { NfcConfig, NFCData, NfcInfo } from './src/types/ekycNFCType';
9
9
  export type { C06Config } from './src/types/ekycC06Type';
10
10
  export type { OcrConfig } from './src/types/ekycOCRType';
11
11
  export type { LivenessConfig } from './src/types/ekycLivenessType';
12
+ export { SDKFaceDetectStatus } from './src/types/ekycLivenessType';
12
13
  export type { FaceServiceConfig } from './src/types/ekycFaceType';
13
14
  export type { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent } from './src/types/ekycType';
14
15
  export type { NfcError } from './src/types/ekycNFCType';
package/dist/index.js CHANGED
@@ -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.parseNfcResponse = exports.FinosESignModule = exports.FinosESign = exports.FinosEKYCModule = exports.FinosEKYC = exports.SDKeKYC = exports.sdkEKYC = void 0;
26
+ exports.SDK_NAME = exports.SDK_VERSION = exports.parseNfcResponse = exports.SDKFaceDetectStatus = exports.FinosESignModule = exports.FinosESign = exports.FinosEKYCModule = exports.FinosEKYC = exports.SDKeKYC = exports.sdkEKYC = void 0;
27
27
  const EKYCModule_1 = __importStar(require("./EKYCModule"));
28
28
  exports.sdkEKYC = EKYCModule_1.default;
29
29
  Object.defineProperty(exports, "SDKeKYC", { enumerable: true, get: function () { return EKYCModule_1.SDKeKYC; } });
@@ -38,6 +38,8 @@ Object.defineProperty(exports, "FinosESignModule", { enumerable: true, get: func
38
38
  console.log('✅ SDK modules loaded successfully');
39
39
  // Export main SDK instance and class (legacy)
40
40
  exports.default = EKYCModule_1.default;
41
+ var ekycLivenessType_1 = require("./src/types/ekycLivenessType");
42
+ Object.defineProperty(exports, "SDKFaceDetectStatus", { enumerable: true, get: function () { return ekycLivenessType_1.SDKFaceDetectStatus; } });
41
43
  // Export utility functions
42
44
  var utils_1 = require("./src/utils/utils");
43
45
  Object.defineProperty(exports, "parseNfcResponse", { enumerable: true, get: function () { return utils_1.parseNfcResponse; } });
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos_sdk/sdk-ekyc",
3
- "version": "1.2.9",
3
+ "version": "1.3.1",
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 { UserEsignModel, ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType';
9
+ import { UserEsignModel, ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError } from '../types/ekycESignType';
10
10
  /**
11
11
  * Finos eKYC SDK Module
12
12
  *
@@ -65,10 +65,16 @@ export declare class FinosEKYCModule {
65
65
  * Start OCR document scanning
66
66
  * @param config OCR configuration
67
67
  */
68
- startOCR(config: OcrConfig): Promise<SDKEkycResultStringWithEvent>;
68
+ startOcr(config: OcrConfig): Promise<SDKEkycResultStringWithEvent>;
69
69
  /**
70
70
  * Start liveness detection
71
- * @param config Liveness configuration (includes switchFrontCamera for camera control)
71
+ * @param config Liveness configuration
72
+ * @param config.isActiveLiveness - Enable active liveness detection (default: false)
73
+ * @param config.autoCapture - Enable auto capture (default: true)
74
+ * @param config.isShowCameraFont - Show camera font (default: true)
75
+ * @param config.customActions - Custom actions array (LEFT, RIGHT, STRAIGHT). If provided, uses these actions instead of random
76
+ * @param config.activeActionCount - Number of random actions (1-10), only used when customActions is null (default: 2)
77
+ * @param config.switchFrontCamera - Use front camera (default: false)
72
78
  */
73
79
  startLiveness(config: LivenessConfig): Promise<SDKEkycResultStringWithEvent>;
74
80
  /**
@@ -116,11 +122,11 @@ export declare class FinosEKYCModule {
116
122
  /**
117
123
  * Listen for OCR success events
118
124
  */
119
- onOCRSuccess(callback: (data: SDKEkycResultStringWithEvent) => void): import("react-native").EmitterSubscription | null;
125
+ onOcrSuccess(callback: (data: SDKEkycResultStringWithEvent) => void): import("react-native").EmitterSubscription | null;
120
126
  /**
121
127
  * Listen for OCR error events
122
128
  */
123
- onOCRError(callback: (error: any) => void): import("react-native").EmitterSubscription | null;
129
+ onOcrError(callback: (error: any) => void): import("react-native").EmitterSubscription | null;
124
130
  /**
125
131
  * Listen for liveness success events
126
132
  */
@@ -158,7 +164,6 @@ export declare class FinosEKYCModule {
158
164
  */
159
165
  resendOtp(config: SmsOtpConfig): Promise<SmsOtpResult>;
160
166
  onSmsOtpSendSuccess(callback: (data: SmsOtpResult) => void): import("react-native").EmitterSubscription | null;
161
- onSmsOtpVerifySuccess(callback: (data: SmsOtpResult) => void): import("react-native").EmitterSubscription | null;
162
167
  onSmsOtpResendSuccess(callback: (data: SmsOtpResult) => void): import("react-native").EmitterSubscription | null;
163
168
  onSmsOtpError(callback: (error: SmsOtpError) => void): import("react-native").EmitterSubscription | null;
164
169
  /**
@@ -220,18 +225,12 @@ export declare class FinosEKYCModule {
220
225
  code: string;
221
226
  message: string;
222
227
  }>;
223
- /**
224
- * Authenticate with eSign
225
- * @param username eSign username
226
- * @param password eSign password
227
- */
228
- authenticate(username: string, password: string): Promise<ESignAuthenticateResult>;
229
228
  /**
230
229
  * Register remote signing certificate
231
230
  * @param accessToken JWT access token
232
231
  * @param requestJson JSON request body
233
232
  */
234
- registerRemoteSigning(accessToken: string, requestJson: string): Promise<{
233
+ registerRemoteSigning(requestJson: string): Promise<{
235
234
  response: string;
236
235
  }>;
237
236
  /**
@@ -239,7 +238,7 @@ export declare class FinosEKYCModule {
239
238
  * @param accessToken JWT access token
240
239
  * @param requestJson JSON request body
241
240
  */
242
- signPdf(accessToken: string, requestJson: string): Promise<{
241
+ signPdf(requestJson: string): Promise<{
243
242
  response: string;
244
243
  }>;
245
244
  /**
@@ -247,7 +246,7 @@ export declare class FinosEKYCModule {
247
246
  * @param accessToken JWT access token
248
247
  * @param requestJson JSON string containing request data
249
248
  */
250
- sendConfirmationDocument(accessToken: string, requestJson: string): Promise<{
249
+ sendConfirmationDocument(requestJson: string): Promise<{
251
250
  response: string;
252
251
  }>;
253
252
  onESignInitSuccess(callback: (data: ESignInitResult) => void): import("react-native").EmitterSubscription | null;
@@ -270,7 +269,6 @@ export declare class FinosEKYCModule {
270
269
  code: string;
271
270
  message: string;
272
271
  }) => void): import("react-native").EmitterSubscription | null;
273
- onESignAuthenticateSuccess(callback: (data: ESignAuthenticateResult) => void): import("react-native").EmitterSubscription | null;
274
272
  onESignRegisterRemoteSigningSuccess(callback: (data: {
275
273
  response: string;
276
274
  }) => void): import("react-native").EmitterSubscription | null;
@@ -348,6 +346,7 @@ export type { NfcConfig, NfcError } from '../types/ekycNFCType';
348
346
  export type { C06Config } from '../types/ekycC06Type';
349
347
  export type { OcrConfig } from '../types/ekycOCRType';
350
348
  export type { LivenessConfig } from '../types/ekycLivenessType';
349
+ export { SDKFaceDetectStatus } from '../types/ekycLivenessType';
351
350
  export type { FaceServiceConfig } from '../types/ekycFaceType';
352
351
  export type { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent } from '../types/ekycType';
353
352
  export type { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
@@ -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 startOCR(config) {
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 (includes switchFrontCamera for camera control)
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
- onOCRSuccess(callback) {
305
+ onOcrSuccess(callback) {
291
306
  return this.sdk.onOcrSuccess(callback);
292
307
  }
293
308
  /**
294
309
  * Listen for OCR error events
295
310
  */
296
- onOCRError(callback) {
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) {
@@ -540,34 +548,16 @@ class FinosEKYCModule {
540
548
  throw error;
541
549
  }
542
550
  }
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
551
  /**
562
552
  * Register remote signing certificate
563
553
  * @param accessToken JWT access token
564
554
  * @param requestJson JSON request body
565
555
  */
566
- async registerRemoteSigning(accessToken, requestJson) {
556
+ async registerRemoteSigning(requestJson) {
567
557
  this.validateSDKReady();
568
558
  try {
569
559
  console.log('📝 Registering remote signing certificate...');
570
- const result = await this.sdk.registerRemoteSigning(accessToken, requestJson);
560
+ const result = await this.sdk.registerRemoteSigning(requestJson);
571
561
  console.log('✅ Remote signing certificate registered successfully');
572
562
  return result;
573
563
  }
@@ -581,11 +571,11 @@ class FinosEKYCModule {
581
571
  * @param accessToken JWT access token
582
572
  * @param requestJson JSON request body
583
573
  */
584
- async signPdf(accessToken, requestJson) {
574
+ async signPdf(requestJson) {
585
575
  this.validateSDKReady();
586
576
  try {
587
577
  console.log('📄 Signing PDF document...');
588
- const result = await this.sdk.signPdf(accessToken, requestJson);
578
+ const result = await this.sdk.signPdf(requestJson);
589
579
  console.log('✅ PDF document signed successfully');
590
580
  return result;
591
581
  }
@@ -599,11 +589,11 @@ class FinosEKYCModule {
599
589
  * @param accessToken JWT access token
600
590
  * @param requestJson JSON string containing request data
601
591
  */
602
- async sendConfirmationDocument(accessToken, requestJson) {
592
+ async sendConfirmationDocument(requestJson) {
603
593
  this.validateSDKReady();
604
594
  try {
605
595
  console.log('📧 Sending confirmation document...');
606
- const result = await this.sdk.sendConfirmationDocument(accessToken, requestJson);
596
+ const result = await this.sdk.sendConfirmationDocument(requestJson);
607
597
  console.log('✅ Confirmation document sent successfully');
608
598
  return result;
609
599
  }
@@ -634,9 +624,6 @@ class FinosEKYCModule {
634
624
  onESignConfirmSignSuccess(callback) {
635
625
  return this.sdk.onESignConfirmSignSuccess(callback);
636
626
  }
637
- onESignAuthenticateSuccess(callback) {
638
- return this.sdk.onESignAuthenticateSuccess(callback);
639
- }
640
627
  onESignRegisterRemoteSigningSuccess(callback) {
641
628
  return this.sdk.onESignRegisterRemoteSigningSuccess(callback);
642
629
  }
@@ -735,13 +722,13 @@ const createFinosEKYCStub = () => {
735
722
  const eventListenerMethods = [
736
723
  'onNfcScanStart', 'onNfcScanSuccess', 'onNfcError',
737
724
  'onC06Success', 'onC06Error',
738
- 'onOCRSuccess', 'onOCRError',
725
+ 'onOcrSuccess', 'onOcrError',
739
726
  'onLivenessSuccess', 'onLivenessError',
740
727
  'onFaceCompareSuccess', 'onFaceCompareError',
741
728
  'onSmsOtpSendSuccess', 'onSmsOtpVerifySuccess', 'onSmsOtpResendSuccess', 'onSmsOtpError',
742
729
  'onESignInitSuccess', 'onESignOpenSessionSuccess', 'onESignRegisterDeviceSuccess',
743
730
  'onESignListCertsSuccess', 'onESignVerifyCertSuccess', 'onESignListSignRequestSuccess',
744
- 'onESignConfirmSignSuccess', 'onESignAuthenticateSuccess', 'onESignRegisterRemoteSigningSuccess',
731
+ 'onESignConfirmSignSuccess', 'onESignRegisterRemoteSigningSuccess',
745
732
  'onESignSignPdfSuccess', 'onESignSendConfirmationDocumentSuccess', 'onESignError'
746
733
  ];
747
734
  eventListenerMethods.forEach(method => {
@@ -752,10 +739,10 @@ const createFinosEKYCStub = () => {
752
739
  });
753
740
  // Add all other methods
754
741
  const otherMethods = [
755
- 'initialize', 'startNfcScan', 'checkC06', 'startOCR', 'startLiveness', 'startFaceCompare',
742
+ 'initialize', 'startNfcScan', 'checkC06', 'startOcr', 'startLiveness', 'startFaceCompare',
756
743
  'startEkycUI', 'sendOtp', 'verifyOtp', 'resendOtp', 'initializeESign', 'openSessionId',
757
744
  'registerDevice', 'listCerts', 'verifyCert', 'listSignRequest', 'confirmSign',
758
- 'authenticate', 'registerRemoteSigning', 'signPdf', 'sendConfirmationDocument',
745
+ 'registerRemoteSigning', 'signPdf', 'sendConfirmationDocument',
759
746
  'onResume', 'onPause', 'isSDKReady', 'getSDKInfo'
760
747
  ];
761
748
  otherMethods.forEach(method => {
@@ -837,5 +824,7 @@ const createFinosEKYCWrapper = () => {
837
824
  };
838
825
  // Export - this ensures FinosEKYC is never undefined
839
826
  exports.FinosEKYC = createFinosEKYCWrapper();
827
+ var ekycLivenessType_1 = require("../types/ekycLivenessType");
828
+ Object.defineProperty(exports, "SDKFaceDetectStatus", { enumerable: true, get: function () { return ekycLivenessType_1.SDKFaceDetectStatus; } });
840
829
  // Default export
841
830
  exports.default = exports.FinosEKYC;