@finos_sdk/sdk-ekyc 1.2.8 → 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 {
@@ -22,6 +22,7 @@ declare class SDKeKYC {
22
22
  buildNumber: string;
23
23
  }>;
24
24
  initSdkEkyc(): Promise<string>;
25
+ setTransactionId(transactionId: string): Promise<boolean>;
25
26
  isSDKInitialized(): boolean;
26
27
  private ensureNativeModule;
27
28
  private validateConfig;
@@ -51,7 +52,8 @@ declare class SDKeKYC {
51
52
  onSmsOtpVerifySuccess(callback: (data: SmsOtpResult) => void): EmitterSubscription | null;
52
53
  onSmsOtpResendSuccess(callback: (data: SmsOtpResult) => void): EmitterSubscription | null;
53
54
  onSmsOtpError(callback: (error: SmsOtpError) => void): EmitterSubscription | null;
54
- initializeESign(): Promise<ESignInitResult>;
55
+ initializeESign(finosToken?: string): Promise<ESignInitResult>;
56
+ getSdkToken(identity: string, name: string, deviceId: string): Promise<string>;
55
57
  openSessionId(accessToken?: string, username?: string, rememberMe?: boolean, userEsignModel?: UserEsignModel, privateKeyFilePath?: string): Promise<ESignOpenSessionResult>;
56
58
  registerDevice(recoverCode: string, pinCode: string, fcmToken?: string): Promise<{
57
59
  code: string;
@@ -71,14 +73,13 @@ declare class SDKeKYC {
71
73
  code: string;
72
74
  message: string;
73
75
  }>;
74
- authenticate(username: string, password: string): Promise<ESignAuthenticateResult>;
75
- registerRemoteSigning(accessToken: string, requestJson: string): Promise<{
76
+ registerRemoteSigning(requestJson: string): Promise<{
76
77
  response: string;
77
78
  }>;
78
- signPdf(accessToken: string, requestJson: string): Promise<{
79
+ signPdf(requestJson: string): Promise<{
79
80
  response: string;
80
81
  }>;
81
- sendConfirmationDocument(accessToken: string, requestJson: string): Promise<{
82
+ sendConfirmationDocument(requestJson: string): Promise<{
82
83
  response: string;
83
84
  }>;
84
85
  onESignInitSuccess(callback: (data: ESignInitResult) => void): EmitterSubscription | null;
@@ -101,7 +102,6 @@ declare class SDKeKYC {
101
102
  code: string;
102
103
  message: string;
103
104
  }) => void): EmitterSubscription | null;
104
- onESignAuthenticateSuccess(callback: (data: ESignAuthenticateResult) => void): EmitterSubscription | null;
105
105
  onESignRegisterRemoteSigningSuccess(callback: (data: {
106
106
  response: string;
107
107
  }) => void): EmitterSubscription | null;
@@ -163,4 +163,5 @@ declare class SDKeKYC {
163
163
  }
164
164
  declare const sdkEKYC: SDKeKYC;
165
165
  export { SDKeKYC };
166
+ export { SDKFaceDetectStatus };
166
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;
@@ -130,6 +132,19 @@ class SDKeKYC {
130
132
  throw error;
131
133
  }
132
134
  }
135
+ // Set transaction ID
136
+ async setTransactionId(transactionId) {
137
+ const nativeModule = this.ensureNativeModule();
138
+ try {
139
+ const result = await nativeModule.setTransactionId(transactionId);
140
+ console.log('✅ Transaction ID set successfully:', transactionId);
141
+ return result;
142
+ }
143
+ catch (error) {
144
+ console.error('❌ Failed to set transaction ID:', error);
145
+ throw error;
146
+ }
147
+ }
133
148
  // Check if SDK is initialized
134
149
  isSDKInitialized() {
135
150
  return this.isInitialized;
@@ -191,11 +206,13 @@ class SDKeKYC {
191
206
  }
192
207
  }
193
208
  async startLiveness(config) {
194
- var _a;
209
+ var _a, _b, _c;
195
210
  this.validateConfig(config, ['appKey', 'selfieImage', 'transactionId']);
196
211
  const nativeModule = this.ensureNativeModule();
197
212
  try {
198
- 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);
199
216
  }
200
217
  catch (error) {
201
218
  console.error('Liveness Error:', error);
@@ -514,10 +531,10 @@ class SDKeKYC {
514
531
  }
515
532
  }
516
533
  // ==================== eSign Methods ====================
517
- async initializeESign() {
534
+ async initializeESign(finosToken) {
518
535
  const nativeModule = this.ensureNativeModule();
519
536
  try {
520
- const result = await nativeModule.initializeESign();
537
+ const result = await nativeModule.initializeESign(finosToken);
521
538
  return result;
522
539
  }
523
540
  catch (error) {
@@ -525,6 +542,16 @@ class SDKeKYC {
525
542
  throw error;
526
543
  }
527
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
+ }
528
555
  async openSessionId(accessToken, username, rememberMe, userEsignModel, privateKeyFilePath) {
529
556
  const nativeModule = this.ensureNativeModule();
530
557
  try {
@@ -540,7 +567,7 @@ class SDKeKYC {
540
567
  async registerDevice(recoverCode, pinCode, fcmToken) {
541
568
  const nativeModule = this.ensureNativeModule();
542
569
  try {
543
- const result = await nativeModule.registerDevice(recoverCode, pinCode, fcmToken || null);
570
+ const result = await nativeModule.registerDevice(recoverCode, pinCode, fcmToken || "");
544
571
  return result;
545
572
  }
546
573
  catch (error) {
@@ -551,7 +578,19 @@ class SDKeKYC {
551
578
  async listCerts(pageNumber = 1, pageSize = 10) {
552
579
  const nativeModule = this.ensureNativeModule();
553
580
  try {
581
+ console.log(`📋 listCerts called with pageNumber=${pageNumber}, pageSize=${pageSize}`);
554
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
+ }
555
594
  return result;
556
595
  }
557
596
  catch (error) {
@@ -562,7 +601,23 @@ class SDKeKYC {
562
601
  async verifyCert(serial) {
563
602
  const nativeModule = this.ensureNativeModule();
564
603
  try {
604
+ console.log(`✅ verifyCert called with serial=${serial}`);
565
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
+ }
566
621
  return result;
567
622
  }
568
623
  catch (error) {
@@ -584,7 +639,7 @@ class SDKeKYC {
584
639
  async confirmSign(signRequestId, pinCode, authId, authData, confirm = true) {
585
640
  const nativeModule = this.ensureNativeModule();
586
641
  try {
587
- 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);
588
643
  return result;
589
644
  }
590
645
  catch (error) {
@@ -592,21 +647,10 @@ class SDKeKYC {
592
647
  throw error;
593
648
  }
594
649
  }
595
- async authenticate(username, password) {
596
- const nativeModule = this.ensureNativeModule();
597
- try {
598
- const result = await nativeModule.authenticate(username, password);
599
- return result;
600
- }
601
- catch (error) {
602
- console.error('eSign Authenticate Error:', error);
603
- throw error;
604
- }
605
- }
606
- async registerRemoteSigning(accessToken, requestJson) {
650
+ async registerRemoteSigning(requestJson) {
607
651
  const nativeModule = this.ensureNativeModule();
608
652
  try {
609
- const result = await nativeModule.registerRemoteSigning(accessToken, requestJson);
653
+ const result = await nativeModule.registerRemoteSigning(requestJson);
610
654
  return result;
611
655
  }
612
656
  catch (error) {
@@ -614,10 +658,31 @@ class SDKeKYC {
614
658
  throw error;
615
659
  }
616
660
  }
617
- async signPdf(accessToken, requestJson) {
661
+ async signPdf(requestJson) {
618
662
  const nativeModule = this.ensureNativeModule();
619
663
  try {
620
- 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
+ }
621
686
  return result;
622
687
  }
623
688
  catch (error) {
@@ -625,10 +690,10 @@ class SDKeKYC {
625
690
  throw error;
626
691
  }
627
692
  }
628
- async sendConfirmationDocument(accessToken, requestJson) {
693
+ async sendConfirmationDocument(requestJson) {
629
694
  const nativeModule = this.ensureNativeModule();
630
695
  try {
631
- const result = await nativeModule.sendConfirmationDocument(accessToken, requestJson);
696
+ const result = await nativeModule.sendConfirmationDocument(requestJson);
632
697
  return result;
633
698
  }
634
699
  catch (error) {
@@ -749,22 +814,6 @@ class SDKeKYC {
749
814
  return null;
750
815
  }
751
816
  }
752
- onESignAuthenticateSuccess(callback) {
753
- try {
754
- const emitter = this.ensureEventEmitter();
755
- if (!emitter) {
756
- console.error('❌ Event emitter not available for onESignAuthenticateSuccess');
757
- return null;
758
- }
759
- const listener = emitter.addListener('onESignAuthenticateSuccess', callback);
760
- this.listeners.push(listener);
761
- return listener;
762
- }
763
- catch (error) {
764
- console.error('Failed to add onESignAuthenticateSuccess listener:', error);
765
- return null;
766
- }
767
- }
768
817
  onESignRegisterRemoteSigningSuccess(callback) {
769
818
  try {
770
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.8",
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
  *
@@ -46,6 +46,11 @@ export declare class FinosEKYCModule {
46
46
  * Check if SDK is initialized
47
47
  */
48
48
  isSDKReady(): boolean;
49
+ /**
50
+ * Set transaction ID
51
+ * @param transactionId Transaction ID string
52
+ */
53
+ setTransactionId(transactionId: string): Promise<boolean>;
49
54
  /**
50
55
  * Start NFC scanning for Vietnamese CCCD
51
56
  * @param config NFC configuration
@@ -60,10 +65,16 @@ export declare class FinosEKYCModule {
60
65
  * Start OCR document scanning
61
66
  * @param config OCR configuration
62
67
  */
63
- startOCR(config: OcrConfig): Promise<SDKEkycResultStringWithEvent>;
68
+ startOcr(config: OcrConfig): Promise<SDKEkycResultStringWithEvent>;
64
69
  /**
65
70
  * Start liveness detection
66
- * @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)
67
78
  */
68
79
  startLiveness(config: LivenessConfig): Promise<SDKEkycResultStringWithEvent>;
69
80
  /**
@@ -111,11 +122,11 @@ export declare class FinosEKYCModule {
111
122
  /**
112
123
  * Listen for OCR success events
113
124
  */
114
- onOCRSuccess(callback: (data: SDKEkycResultStringWithEvent) => void): import("react-native").EmitterSubscription | null;
125
+ onOcrSuccess(callback: (data: SDKEkycResultStringWithEvent) => void): import("react-native").EmitterSubscription | null;
115
126
  /**
116
127
  * Listen for OCR error events
117
128
  */
118
- onOCRError(callback: (error: any) => void): import("react-native").EmitterSubscription | null;
129
+ onOcrError(callback: (error: any) => void): import("react-native").EmitterSubscription | null;
119
130
  /**
120
131
  * Listen for liveness success events
121
132
  */
@@ -153,7 +164,6 @@ export declare class FinosEKYCModule {
153
164
  */
154
165
  resendOtp(config: SmsOtpConfig): Promise<SmsOtpResult>;
155
166
  onSmsOtpSendSuccess(callback: (data: SmsOtpResult) => void): import("react-native").EmitterSubscription | null;
156
- onSmsOtpVerifySuccess(callback: (data: SmsOtpResult) => void): import("react-native").EmitterSubscription | null;
157
167
  onSmsOtpResendSuccess(callback: (data: SmsOtpResult) => void): import("react-native").EmitterSubscription | null;
158
168
  onSmsOtpError(callback: (error: SmsOtpError) => void): import("react-native").EmitterSubscription | null;
159
169
  /**
@@ -215,18 +225,12 @@ export declare class FinosEKYCModule {
215
225
  code: string;
216
226
  message: string;
217
227
  }>;
218
- /**
219
- * Authenticate with eSign
220
- * @param username eSign username
221
- * @param password eSign password
222
- */
223
- authenticate(username: string, password: string): Promise<ESignAuthenticateResult>;
224
228
  /**
225
229
  * Register remote signing certificate
226
230
  * @param accessToken JWT access token
227
231
  * @param requestJson JSON request body
228
232
  */
229
- registerRemoteSigning(accessToken: string, requestJson: string): Promise<{
233
+ registerRemoteSigning(requestJson: string): Promise<{
230
234
  response: string;
231
235
  }>;
232
236
  /**
@@ -234,7 +238,7 @@ export declare class FinosEKYCModule {
234
238
  * @param accessToken JWT access token
235
239
  * @param requestJson JSON request body
236
240
  */
237
- signPdf(accessToken: string, requestJson: string): Promise<{
241
+ signPdf(requestJson: string): Promise<{
238
242
  response: string;
239
243
  }>;
240
244
  /**
@@ -242,7 +246,7 @@ export declare class FinosEKYCModule {
242
246
  * @param accessToken JWT access token
243
247
  * @param requestJson JSON string containing request data
244
248
  */
245
- sendConfirmationDocument(accessToken: string, requestJson: string): Promise<{
249
+ sendConfirmationDocument(requestJson: string): Promise<{
246
250
  response: string;
247
251
  }>;
248
252
  onESignInitSuccess(callback: (data: ESignInitResult) => void): import("react-native").EmitterSubscription | null;
@@ -265,7 +269,6 @@ export declare class FinosEKYCModule {
265
269
  code: string;
266
270
  message: string;
267
271
  }) => void): import("react-native").EmitterSubscription | null;
268
- onESignAuthenticateSuccess(callback: (data: ESignAuthenticateResult) => void): import("react-native").EmitterSubscription | null;
269
272
  onESignRegisterRemoteSigningSuccess(callback: (data: {
270
273
  response: string;
271
274
  }) => void): import("react-native").EmitterSubscription | null;
@@ -343,6 +346,7 @@ export type { NfcConfig, NfcError } from '../types/ekycNFCType';
343
346
  export type { C06Config } from '../types/ekycC06Type';
344
347
  export type { OcrConfig } from '../types/ekycOCRType';
345
348
  export type { LivenessConfig } from '../types/ekycLivenessType';
349
+ export { SDKFaceDetectStatus } from '../types/ekycLivenessType';
346
350
  export type { FaceServiceConfig } from '../types/ekycFaceType';
347
351
  export type { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent } from '../types/ekycType';
348
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; } });
@@ -109,6 +109,23 @@ class FinosEKYCModule {
109
109
  isSDKReady() {
110
110
  return this.isInitialized && this.sdk.isSDKInitialized();
111
111
  }
112
+ /**
113
+ * Set transaction ID
114
+ * @param transactionId Transaction ID string
115
+ */
116
+ async setTransactionId(transactionId) {
117
+ this.validateSDKReady();
118
+ try {
119
+ console.log('🆔 Setting transaction ID:', transactionId);
120
+ const result = await this.sdk.setTransactionId(transactionId);
121
+ console.log('✅ Transaction ID set successfully');
122
+ return result;
123
+ }
124
+ catch (error) {
125
+ console.error('❌ Failed to set transaction ID:', error);
126
+ throw error;
127
+ }
128
+ }
112
129
  /**
113
130
  * Start NFC scanning for Vietnamese CCCD
114
131
  * @param config NFC configuration
@@ -148,7 +165,7 @@ class FinosEKYCModule {
148
165
  * Start OCR document scanning
149
166
  * @param config OCR configuration
150
167
  */
151
- async startOCR(config) {
168
+ async startOcr(config) {
152
169
  this.validateSDKReady();
153
170
  try {
154
171
  console.log('📄 Starting OCR scan...');
@@ -163,12 +180,27 @@ class FinosEKYCModule {
163
180
  }
164
181
  /**
165
182
  * Start liveness detection
166
- * @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)
167
190
  */
168
191
  async startLiveness(config) {
169
192
  this.validateSDKReady();
170
193
  try {
171
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
+ }
172
204
  if (config.switchFrontCamera !== undefined) {
173
205
  console.log('📷 Front camera setting:', config.switchFrontCamera ? 'ON' : 'OFF');
174
206
  }
@@ -270,13 +302,13 @@ class FinosEKYCModule {
270
302
  /**
271
303
  * Listen for OCR success events
272
304
  */
273
- onOCRSuccess(callback) {
305
+ onOcrSuccess(callback) {
274
306
  return this.sdk.onOcrSuccess(callback);
275
307
  }
276
308
  /**
277
309
  * Listen for OCR error events
278
310
  */
279
- onOCRError(callback) {
311
+ onOcrError(callback) {
280
312
  return this.sdk.onOcrError(callback);
281
313
  }
282
314
  /**
@@ -371,13 +403,6 @@ class FinosEKYCModule {
371
403
  }
372
404
  return listener;
373
405
  }
374
- onSmsOtpVerifySuccess(callback) {
375
- const listener = this.sdk.onSmsOtpVerifySuccess(callback);
376
- if (!listener) {
377
- console.warn('⚠️ onSmsOtpVerifySuccess: Event emitter not ready.');
378
- }
379
- return listener;
380
- }
381
406
  onSmsOtpResendSuccess(callback) {
382
407
  const listener = this.sdk.onSmsOtpResendSuccess(callback);
383
408
  if (!listener) {
@@ -523,34 +548,16 @@ class FinosEKYCModule {
523
548
  throw error;
524
549
  }
525
550
  }
526
- /**
527
- * Authenticate with eSign
528
- * @param username eSign username
529
- * @param password eSign password
530
- */
531
- async authenticate(username, password) {
532
- this.validateSDKReady();
533
- try {
534
- console.log('🔐 Authenticating with eSign...');
535
- const result = await this.sdk.authenticate(username, password);
536
- console.log('✅ eSign authentication successful');
537
- return result;
538
- }
539
- catch (error) {
540
- console.error('❌ eSign authentication failed:', error);
541
- throw error;
542
- }
543
- }
544
551
  /**
545
552
  * Register remote signing certificate
546
553
  * @param accessToken JWT access token
547
554
  * @param requestJson JSON request body
548
555
  */
549
- async registerRemoteSigning(accessToken, requestJson) {
556
+ async registerRemoteSigning(requestJson) {
550
557
  this.validateSDKReady();
551
558
  try {
552
559
  console.log('📝 Registering remote signing certificate...');
553
- const result = await this.sdk.registerRemoteSigning(accessToken, requestJson);
560
+ const result = await this.sdk.registerRemoteSigning(requestJson);
554
561
  console.log('✅ Remote signing certificate registered successfully');
555
562
  return result;
556
563
  }
@@ -564,11 +571,11 @@ class FinosEKYCModule {
564
571
  * @param accessToken JWT access token
565
572
  * @param requestJson JSON request body
566
573
  */
567
- async signPdf(accessToken, requestJson) {
574
+ async signPdf(requestJson) {
568
575
  this.validateSDKReady();
569
576
  try {
570
577
  console.log('📄 Signing PDF document...');
571
- const result = await this.sdk.signPdf(accessToken, requestJson);
578
+ const result = await this.sdk.signPdf(requestJson);
572
579
  console.log('✅ PDF document signed successfully');
573
580
  return result;
574
581
  }
@@ -582,11 +589,11 @@ class FinosEKYCModule {
582
589
  * @param accessToken JWT access token
583
590
  * @param requestJson JSON string containing request data
584
591
  */
585
- async sendConfirmationDocument(accessToken, requestJson) {
592
+ async sendConfirmationDocument(requestJson) {
586
593
  this.validateSDKReady();
587
594
  try {
588
595
  console.log('📧 Sending confirmation document...');
589
- const result = await this.sdk.sendConfirmationDocument(accessToken, requestJson);
596
+ const result = await this.sdk.sendConfirmationDocument(requestJson);
590
597
  console.log('✅ Confirmation document sent successfully');
591
598
  return result;
592
599
  }
@@ -617,9 +624,6 @@ class FinosEKYCModule {
617
624
  onESignConfirmSignSuccess(callback) {
618
625
  return this.sdk.onESignConfirmSignSuccess(callback);
619
626
  }
620
- onESignAuthenticateSuccess(callback) {
621
- return this.sdk.onESignAuthenticateSuccess(callback);
622
- }
623
627
  onESignRegisterRemoteSigningSuccess(callback) {
624
628
  return this.sdk.onESignRegisterRemoteSigningSuccess(callback);
625
629
  }
@@ -718,13 +722,13 @@ const createFinosEKYCStub = () => {
718
722
  const eventListenerMethods = [
719
723
  'onNfcScanStart', 'onNfcScanSuccess', 'onNfcError',
720
724
  'onC06Success', 'onC06Error',
721
- 'onOCRSuccess', 'onOCRError',
725
+ 'onOcrSuccess', 'onOcrError',
722
726
  'onLivenessSuccess', 'onLivenessError',
723
727
  'onFaceCompareSuccess', 'onFaceCompareError',
724
728
  'onSmsOtpSendSuccess', 'onSmsOtpVerifySuccess', 'onSmsOtpResendSuccess', 'onSmsOtpError',
725
729
  'onESignInitSuccess', 'onESignOpenSessionSuccess', 'onESignRegisterDeviceSuccess',
726
730
  'onESignListCertsSuccess', 'onESignVerifyCertSuccess', 'onESignListSignRequestSuccess',
727
- 'onESignConfirmSignSuccess', 'onESignAuthenticateSuccess', 'onESignRegisterRemoteSigningSuccess',
731
+ 'onESignConfirmSignSuccess', 'onESignRegisterRemoteSigningSuccess',
728
732
  'onESignSignPdfSuccess', 'onESignSendConfirmationDocumentSuccess', 'onESignError'
729
733
  ];
730
734
  eventListenerMethods.forEach(method => {
@@ -735,10 +739,10 @@ const createFinosEKYCStub = () => {
735
739
  });
736
740
  // Add all other methods
737
741
  const otherMethods = [
738
- 'initialize', 'startNfcScan', 'checkC06', 'startOCR', 'startLiveness', 'startFaceCompare',
742
+ 'initialize', 'startNfcScan', 'checkC06', 'startOcr', 'startLiveness', 'startFaceCompare',
739
743
  'startEkycUI', 'sendOtp', 'verifyOtp', 'resendOtp', 'initializeESign', 'openSessionId',
740
744
  'registerDevice', 'listCerts', 'verifyCert', 'listSignRequest', 'confirmSign',
741
- 'authenticate', 'registerRemoteSigning', 'signPdf', 'sendConfirmationDocument',
745
+ 'registerRemoteSigning', 'signPdf', 'sendConfirmationDocument',
742
746
  'onResume', 'onPause', 'isSDKReady', 'getSDKInfo'
743
747
  ];
744
748
  otherMethods.forEach(method => {
@@ -820,5 +824,7 @@ const createFinosEKYCWrapper = () => {
820
824
  };
821
825
  // Export - this ensures FinosEKYC is never undefined
822
826
  exports.FinosEKYC = createFinosEKYCWrapper();
827
+ var ekycLivenessType_1 = require("../types/ekycLivenessType");
828
+ Object.defineProperty(exports, "SDKFaceDetectStatus", { enumerable: true, get: function () { return ekycLivenessType_1.SDKFaceDetectStatus; } });
823
829
  // Default export
824
830
  exports.default = exports.FinosEKYC;