@finos_sdk/sdk-ekyc 1.4.2 → 1.4.5

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.
@@ -213,7 +213,7 @@ class SDKeKYC {
213
213
  try {
214
214
  // Convert SDKFaceDetectStatus enum array to string array
215
215
  const customActionsStrings = (_b = (_a = config.customActions) === null || _a === void 0 ? void 0 : _a.map(action => String(action))) !== null && _b !== void 0 ? _b : undefined;
216
- 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);
216
+ return await nativeModule.startLiveness(config.appKey, config.selfieImage, (_c = config.transactionId) !== null && _c !== void 0 ? _c : '', config.isActiveLiveness, config.isShowCameraFont, customActionsStrings, config.activeActionCount, config.forceCaptureTimeout, config.isActiveLivenessColor);
217
217
  }
218
218
  catch (error) {
219
219
  console.error('Liveness Error:', error);
@@ -420,6 +420,38 @@ class SDKeKYC {
420
420
  return null;
421
421
  }
422
422
  }
423
+ onEkycUISuccess(callback) {
424
+ try {
425
+ const emitter = this.ensureEventEmitter();
426
+ if (!emitter) {
427
+ console.error('❌ Event emitter not available for onEkycUISuccess');
428
+ return null;
429
+ }
430
+ const listener = emitter.addListener('onEkycUISuccess', callback);
431
+ this.listeners.push(listener);
432
+ return listener;
433
+ }
434
+ catch (error) {
435
+ console.error('Failed to add onEkycUISuccess listener:', error);
436
+ return null;
437
+ }
438
+ }
439
+ onEkycUIError(callback) {
440
+ try {
441
+ const emitter = this.ensureEventEmitter();
442
+ if (!emitter) {
443
+ console.error('❌ Event emitter not available for onEkycUIError');
444
+ return null;
445
+ }
446
+ const listener = emitter.addListener('onEkycUIError', callback);
447
+ this.listeners.push(listener);
448
+ return listener;
449
+ }
450
+ catch (error) {
451
+ console.error('Failed to add onEkycUIError listener:', error);
452
+ return null;
453
+ }
454
+ }
423
455
  removeAllListeners() {
424
456
  this.listeners.forEach(listener => listener.remove());
425
457
  this.listeners = [];
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export type { OcrConfig } from './src/types/ekycOCRType';
12
12
  export type { LivenessConfig } from './src/types/ekycLivenessType';
13
13
  export { SDKFaceDetectStatus, SDK_LIVENESS_ACTIONS, customActionsToStrings } from './src/types/ekycLivenessType';
14
14
  export type { FaceServiceConfig } from './src/types/ekycFaceType';
15
+ export { EKYCEvent, EKYCErrorEvent } from './src/types/EKYCEvent';
15
16
  export type { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent, StartEkycUIResult, EKYCError } from './src/types/ekycType';
16
17
  export { getEkycError, AppIDType } from './src/types/ekycType';
17
18
  export type { NfcError } from './src/types/ekycNFCType';
package/dist/index.js CHANGED
@@ -15,17 +15,27 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.OCR_FAKE_PORTRAIT_DETECTED_CMND = exports.OCR_FAKE_CHARACTERS_DETECTED_CMND = exports.OCR_USE_NEW_ID_DOCUMENT_2 = exports.OCR_USE_NEW_ID_DOCUMENT_1 = exports.OCR_FAKE_MRZ = exports.OCR_INVALID_GENDER_CODE = exports.OCR_INVALID_ID_CARD = exports.OCR_GLARE_ID_CARD = exports.OCR_BLURRY_ID_CARD = exports.OCR_CUT_CORNER_ID_CARD = exports.OCR_CANNOT_RECOGNIZE_PORTRAIT = exports.OCR_ID_CARD_FROM_OTHER_DEVICE = exports.OCR_NOT_ORIGINAL_ID_CARD = exports.OCR_MISSING_ID_CARD_PART = exports.OCR_CANNOT_GET_ISSUE_PLACE = exports.OCR_CANNOT_GET_GENDER = exports.OCR_CANNOT_GET_HOMETOWN = exports.OCR_CANNOT_GET_RESIDENCE = exports.OCR_CANNOT_GET_ISSUE_DATE = exports.OCR_CANNOT_GET_EXPIRY_DATE = exports.OCR_CANNOT_GET_BIRTH_YEAR = exports.OCR_CANNOT_GET_NAME = exports.OCR_CANNOT_GET_ID_NUMBER = exports.OCR_WRONG_ID_CARD_SIDE = exports.OCR_UNRECOGNIZED_ID_CARD = exports.SDK_MISS_KEY = exports.ERROR_UNKNOWN = exports.SDK_START_ERROR = exports.SDK_START_FLOW_ERROR = exports.getMessage = exports.getErrorResultFromDetails = exports.createCustom = exports.fromCode = exports.getLocalizedMessage = exports.parseNfcResponse = exports.AuthorizationStatus = exports.AppIDType = exports.getEkycError = exports.customActionsToStrings = exports.SDK_LIVENESS_ACTIONS = exports.SDKFaceDetectStatus = exports.flowToStrings = exports.SDK_FLOW_OPTIONS = exports.SDKFlowType = exports.FinosESignModule = exports.FinosESign = exports.FinosEKYCModule = exports.FinosEKYC = exports.SDKeKYC = exports.sdkEKYC = void 0;
27
- exports.ESIGN_INVALID_RECOVERY_OR_PIN = exports.ESIGN_SESSION_INVALID_REGISTER = exports.ESIGN_INVALID_USER_ACCOUNT = exports.ESIGN_APP_LIMITED = exports.ESIGN_DEVICE_NOT_INIT = exports.ESIGN_INVALID_LICENSE_CONTENT = exports.ESIGN_INVALID_LICENSE = exports.ESIGN_DEVICE_ALREADY_INIT = exports.ESIGN_SESSION_INVALID = exports.FETCH_HISTORY_ERROR = exports.QRCODE_ERROR = exports.SMS_OTP_RATE_LIMIT = exports.SMS_OTP_NOT_FOUND = exports.SMS_OTP_MAX_ATTEMPTS = exports.SMS_OTP_INVALID_PHONE = exports.SMS_OTP_ERROR = exports.NFC_CHIP_AUTH_FAILED = exports.NFC_USER_CANCEL = exports.NFC_UNKNOWN_ERROR = exports.NFC_IO_ERROR = exports.NFC_INVALID_MRZ_KEY = exports.NFC_CONNECTION_LOST = exports.NFC_MUTUAL_AUTH_FAILED = exports.C06_ERROR = exports.SCAN_NFC_ENABLE = exports.SCAN_NFC_CHECK = exports.SCAN_NFC_ERROR = exports.HEAD_IS_TURNED_IN_SELFIE = exports.NUDITY_DETECTED_IN_SELFIE = exports.READING_GLASSES_DETECTED_IN_SELFIE = exports.EYEWEAR_DETECTED_IN_SELFIE = exports.FACE_OCCLUDED_IN_SELFIE = exports.FACE_IS_BLURRED = exports.MASK_PRESENT_IN_SELFIE = exports.EYES_CLOSED_IN_SELFIE = exports.MULTIPLE_FACES_IN_SELFIE = exports.LIVENESS_FAIL = exports.LIVENESS_ERROR = exports.FACE_ERROR = exports.FACE_HAT_ERROR = exports.OCR_ERROR = exports.OCR_FONT_BACK_NOT_MATCH = exports.OCR_PHOTOCOPY_ID_CARD = exports.OCR_FAKE_PORTRAIT_DETECTED = exports.OCR_FAKE_CHARACTERS_DETECTED_2 = exports.OCR_FAKE_CHARACTERS_DETECTED_1 = exports.OCR_UNKNOWN_ID_NUMBER_LENGTH = exports.OCR_MODIFIED_BIRTH_DATE_DETECTED_CMND = exports.OCR_MODIFIED_SYMBOL_DETECTED_CMND = exports.OCR_FAKE_BIRTH_DATE_DETECTED_CMND = void 0;
28
- exports.SDK_NAME = exports.SDK_VERSION = exports.USER_CANCEL = exports.ESIGN_INVALID_PIN_CODE = exports.ESIGN_INVALID_RECOVERY_CODE = exports.ESIGN_INVALID_LICENSE_CODE = exports.ESIGN_INVALID_CONTEXT = exports.ESIGN_MISSING_REQUEST_ID = exports.ESIGN_MISSING_SERIAL = exports.ESIGN_MISSING_IDENTITY = exports.ESIGN_MISSING_ACCESS_TOKEN = exports.ESIGN_NO_SESSION_ID = exports.ESIGN_MISSING_CONFIRMATION_DOC = exports.ESIGN_MISSING_REQUEST_JSON = exports.ESIGN_MISSING_CCCD = exports.ESIGN_MISSING_TOKEN = exports.ESIGN_ERROR_UNKNOWN = exports.ESIGN_AUTH_REQUEST_EXISTS = exports.ESIGN_INVALID_CERT_FOR_AUTH = exports.ESIGN_INVALID_SIGN_COUNT_OR_TIME = exports.ESIGN_AUTH_EXISTS = exports.ESIGN_SESSION_INVALID_LIST_CERT = void 0;
36
+ exports.OCR_USE_NEW_ID_DOCUMENT_2 = exports.OCR_USE_NEW_ID_DOCUMENT_1 = exports.OCR_FAKE_MRZ = exports.OCR_INVALID_GENDER_CODE = exports.OCR_INVALID_ID_CARD = exports.OCR_GLARE_ID_CARD = exports.OCR_BLURRY_ID_CARD = exports.OCR_CUT_CORNER_ID_CARD = exports.OCR_CANNOT_RECOGNIZE_PORTRAIT = exports.OCR_ID_CARD_FROM_OTHER_DEVICE = exports.OCR_NOT_ORIGINAL_ID_CARD = exports.OCR_MISSING_ID_CARD_PART = exports.OCR_CANNOT_GET_ISSUE_PLACE = exports.OCR_CANNOT_GET_GENDER = exports.OCR_CANNOT_GET_HOMETOWN = exports.OCR_CANNOT_GET_RESIDENCE = exports.OCR_CANNOT_GET_ISSUE_DATE = exports.OCR_CANNOT_GET_EXPIRY_DATE = exports.OCR_CANNOT_GET_BIRTH_YEAR = exports.OCR_CANNOT_GET_NAME = exports.OCR_CANNOT_GET_ID_NUMBER = exports.OCR_WRONG_ID_CARD_SIDE = exports.OCR_UNRECOGNIZED_ID_CARD = exports.SDK_MISS_KEY = exports.ERROR_UNKNOWN = exports.SDK_START_ERROR = exports.SDK_START_FLOW_ERROR = exports.getMessage = exports.getErrorResultFromDetails = exports.createCustom = exports.fromCode = exports.getLocalizedMessage = exports.parseNfcResponse = exports.AuthorizationStatus = exports.AppIDType = exports.getEkycError = exports.EKYCErrorEvent = exports.EKYCEvent = exports.customActionsToStrings = exports.SDK_LIVENESS_ACTIONS = exports.SDKFaceDetectStatus = exports.flowToStrings = exports.SDK_FLOW_OPTIONS = exports.SDKFlowType = exports.FinosESignModule = exports.FinosESign = exports.FinosEKYCModule = exports.FinosEKYC = exports.SDKeKYC = exports.sdkEKYC = void 0;
37
+ exports.ESIGN_INVALID_USER_ACCOUNT = exports.ESIGN_APP_LIMITED = exports.ESIGN_DEVICE_NOT_INIT = exports.ESIGN_INVALID_LICENSE_CONTENT = exports.ESIGN_INVALID_LICENSE = exports.ESIGN_DEVICE_ALREADY_INIT = exports.ESIGN_SESSION_INVALID = exports.FETCH_HISTORY_ERROR = exports.QRCODE_ERROR = exports.SMS_OTP_RATE_LIMIT = exports.SMS_OTP_NOT_FOUND = exports.SMS_OTP_MAX_ATTEMPTS = exports.SMS_OTP_INVALID_PHONE = exports.SMS_OTP_ERROR = exports.NFC_CHIP_AUTH_FAILED = exports.NFC_USER_CANCEL = exports.NFC_UNKNOWN_ERROR = exports.NFC_IO_ERROR = exports.NFC_INVALID_MRZ_KEY = exports.NFC_CONNECTION_LOST = exports.NFC_MUTUAL_AUTH_FAILED = exports.C06_ERROR = exports.SCAN_NFC_ENABLE = exports.SCAN_NFC_CHECK = exports.SCAN_NFC_ERROR = exports.HEAD_IS_TURNED_IN_SELFIE = exports.NUDITY_DETECTED_IN_SELFIE = exports.READING_GLASSES_DETECTED_IN_SELFIE = exports.EYEWEAR_DETECTED_IN_SELFIE = exports.FACE_OCCLUDED_IN_SELFIE = exports.FACE_IS_BLURRED = exports.MASK_PRESENT_IN_SELFIE = exports.EYES_CLOSED_IN_SELFIE = exports.MULTIPLE_FACES_IN_SELFIE = exports.LIVENESS_FAIL = exports.LIVENESS_ERROR = exports.FACE_ERROR = exports.FACE_HAT_ERROR = exports.OCR_ERROR = exports.OCR_FONT_BACK_NOT_MATCH = exports.OCR_PHOTOCOPY_ID_CARD = exports.OCR_FAKE_PORTRAIT_DETECTED = exports.OCR_FAKE_CHARACTERS_DETECTED_2 = exports.OCR_FAKE_CHARACTERS_DETECTED_1 = exports.OCR_UNKNOWN_ID_NUMBER_LENGTH = exports.OCR_MODIFIED_BIRTH_DATE_DETECTED_CMND = exports.OCR_MODIFIED_SYMBOL_DETECTED_CMND = exports.OCR_FAKE_BIRTH_DATE_DETECTED_CMND = exports.OCR_FAKE_PORTRAIT_DETECTED_CMND = exports.OCR_FAKE_CHARACTERS_DETECTED_CMND = void 0;
38
+ exports.SDK_NAME = exports.SDK_VERSION = exports.USER_CANCEL = exports.ESIGN_INVALID_PIN_CODE = exports.ESIGN_INVALID_RECOVERY_CODE = exports.ESIGN_INVALID_LICENSE_CODE = exports.ESIGN_INVALID_CONTEXT = exports.ESIGN_MISSING_REQUEST_ID = exports.ESIGN_MISSING_SERIAL = exports.ESIGN_MISSING_IDENTITY = exports.ESIGN_MISSING_ACCESS_TOKEN = exports.ESIGN_NO_SESSION_ID = exports.ESIGN_MISSING_CONFIRMATION_DOC = exports.ESIGN_MISSING_REQUEST_JSON = exports.ESIGN_MISSING_CCCD = exports.ESIGN_MISSING_TOKEN = exports.ESIGN_ERROR_UNKNOWN = exports.ESIGN_AUTH_REQUEST_EXISTS = exports.ESIGN_INVALID_CERT_FOR_AUTH = exports.ESIGN_INVALID_SIGN_COUNT_OR_TIME = exports.ESIGN_AUTH_EXISTS = exports.ESIGN_SESSION_INVALID_LIST_CERT = exports.ESIGN_INVALID_RECOVERY_OR_PIN = exports.ESIGN_SESSION_INVALID_REGISTER = void 0;
29
39
  const EKYCModule_1 = __importStar(require("./EKYCModule"));
30
40
  exports.sdkEKYC = EKYCModule_1.default;
31
41
  Object.defineProperty(exports, "SDKeKYC", { enumerable: true, get: function () { return EKYCModule_1.SDKeKYC; } });
@@ -49,6 +59,10 @@ var ekycLivenessType_1 = require("./src/types/ekycLivenessType");
49
59
  Object.defineProperty(exports, "SDKFaceDetectStatus", { enumerable: true, get: function () { return ekycLivenessType_1.SDKFaceDetectStatus; } });
50
60
  Object.defineProperty(exports, "SDK_LIVENESS_ACTIONS", { enumerable: true, get: function () { return ekycLivenessType_1.SDK_LIVENESS_ACTIONS; } });
51
61
  Object.defineProperty(exports, "customActionsToStrings", { enumerable: true, get: function () { return ekycLivenessType_1.customActionsToStrings; } });
62
+ // Export event enums (port of Android EKYCEvent.kt & EKYCErrorEvent.kt)
63
+ var EKYCEvent_1 = require("./src/types/EKYCEvent");
64
+ Object.defineProperty(exports, "EKYCEvent", { enumerable: true, get: function () { return EKYCEvent_1.EKYCEvent; } });
65
+ Object.defineProperty(exports, "EKYCErrorEvent", { enumerable: true, get: function () { return EKYCEvent_1.EKYCErrorEvent; } });
52
66
  var ekycType_1 = require("./src/types/ekycType");
53
67
  Object.defineProperty(exports, "getEkycError", { enumerable: true, get: function () { return ekycType_1.getEkycError; } });
54
68
  Object.defineProperty(exports, "AppIDType", { enumerable: true, get: function () { return ekycType_1.AppIDType; } });
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos_sdk/sdk-ekyc",
3
- "version": "1.4.2",
3
+ "version": "1.4.5",
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",
@@ -83,4 +83,4 @@
83
83
  "engines": {
84
84
  "node": ">=18"
85
85
  }
86
- }
86
+ }
@@ -146,6 +146,14 @@ export declare class FinosEKYCModule {
146
146
  onFaceCompareSuccess(callback: (data: SDKEkycResultWithEvent) => void): import("react-native").EmitterSubscription | null;
147
147
  /** Payload là EKYCError: { event, code, message }. */
148
148
  onFaceCompareError(callback: (error: EKYCError) => void): import("react-native").EmitterSubscription | null;
149
+ /**
150
+ * Listen for eKYC UI success events (including LOG_SUCCESS from Liveness/FaceService submit)
151
+ */
152
+ onEkycUISuccess(callback: (data: any) => void): import("react-native").EmitterSubscription | null;
153
+ /**
154
+ * Listen for eKYC UI error events
155
+ */
156
+ onEkycUIError(callback: (error: any) => void): import("react-native").EmitterSubscription | null;
149
157
  /**
150
158
  * Remove all event listeners
151
159
  */
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.SDK_NAME = exports.SDK_VERSION = exports.AppIDType = exports.getEkycError = exports.SDKFaceDetectStatus = exports.FinosEKYC = exports.FinosEKYCModule = void 0;
27
37
  const react_native_1 = require("react-native");
@@ -202,9 +212,6 @@ class FinosEKYCModule {
202
212
  else if (config.activeActionCount !== undefined) {
203
213
  console.log('🎲 Random actions count:', config.activeActionCount);
204
214
  }
205
- if (config.switchFrontCamera !== undefined) {
206
- console.log('📷 Front camera setting:', config.switchFrontCamera ? 'ON' : 'OFF');
207
- }
208
215
  const result = await this.sdk.startLiveness(config);
209
216
  console.log('✅ Liveness detection completed:', result.event);
210
217
  return result;
@@ -338,6 +345,18 @@ class FinosEKYCModule {
338
345
  onFaceCompareError(callback) {
339
346
  return this.sdk.onFaceCompareError(callback);
340
347
  }
348
+ /**
349
+ * Listen for eKYC UI success events (including LOG_SUCCESS from Liveness/FaceService submit)
350
+ */
351
+ onEkycUISuccess(callback) {
352
+ return this.sdk.onEkycUISuccess(callback);
353
+ }
354
+ /**
355
+ * Listen for eKYC UI error events
356
+ */
357
+ onEkycUIError(callback) {
358
+ return this.sdk.onEkycUIError(callback);
359
+ }
341
360
  /**
342
361
  * Remove all event listeners
343
362
  */
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.SDK_NAME = exports.SDK_VERSION = exports.getEkycError = exports.SDKFaceDetectStatus = exports.FinosESign = exports.FinosESignModule = void 0;
27
37
  const react_native_1 = require("react-native");
@@ -14,7 +14,7 @@ let SharingService = class SharingService {
14
14
  this.imageNFC = null;
15
15
  }
16
16
  };
17
- SharingService = __decorate([
17
+ exports.SharingService = SharingService;
18
+ exports.SharingService = SharingService = __decorate([
18
19
  (0, tsyringe_1.singleton)()
19
20
  ], SharingService);
20
- exports.SharingService = SharingService;
@@ -107,6 +107,40 @@ export declare const ESIGN_INVALID_CONTEXT: EKYCErrorResultLike;
107
107
  export declare const ESIGN_INVALID_LICENSE_CODE: EKYCErrorResultLike;
108
108
  export declare const ESIGN_INVALID_RECOVERY_CODE: EKYCErrorResultLike;
109
109
  export declare const ESIGN_INVALID_PIN_CODE: EKYCErrorResultLike;
110
+ export declare const ESIGN_MISSING_NAME: EKYCErrorResultLike;
111
+ export declare const ESIGN_MISSING_DEVICE_ID: EKYCErrorResultLike;
112
+ export declare const ESIGN_INVALID_REQUEST_JSON: EKYCErrorResultLike;
113
+ export declare const ESIGN_MISSING_PIN_CODE: EKYCErrorResultLike;
114
+ export declare const ESIGN_MISSING_USER_PIN: EKYCErrorResultLike;
115
+ export declare const ESIGN_INVALID_PAGE_PARAMS: EKYCErrorResultLike;
116
+ export declare const ESIGN_INVALID_QUANTITY: EKYCErrorResultLike;
117
+ export declare const ESIGN_INVALID_TIME: EKYCErrorResultLike;
118
+ export declare const ESIGN_INVALID_PIN_FORMAT: EKYCErrorResultLike;
119
+ export declare const ESIGN_INVALID_RECOVERY_FORMAT: EKYCErrorResultLike;
120
+ export declare const ESIGN_MISSING_USER_INFO: EKYCErrorResultLike;
121
+ export declare const ESIGN_MISSING_FIELD_IDENTITY: EKYCErrorResultLike;
122
+ export declare const ESIGN_MISSING_FIELD_SOD: EKYCErrorResultLike;
123
+ export declare const ESIGN_MISSING_FIELD_REGISTER_DATE: EKYCErrorResultLike;
124
+ export declare const ESIGN_MISSING_FIELD_EXPIRED_DATE: EKYCErrorResultLike;
125
+ export declare const ESIGN_MISSING_SIGNING_CONTENTS: EKYCErrorResultLike;
126
+ export declare const ESIGN_MISSING_FIELD_DATA: EKYCErrorResultLike;
127
+ export declare const ESIGN_MISSING_TOKEN_INFO: EKYCErrorResultLike;
128
+ export declare const ESIGN_MISSING_FIELD_USERNAME: EKYCErrorResultLike;
129
+ export declare const ESIGN_MISSING_FIELD_SERIAL_TOKEN: EKYCErrorResultLike;
130
+ export declare const ESIGN_MISSING_FIELD_SESSION_ID: EKYCErrorResultLike;
131
+ export declare const ESIGN_MISSING_FIELD_NAME: EKYCErrorResultLike;
132
+ export declare const ESIGN_MISSING_FIELD_ADDRESS: EKYCErrorResultLike;
133
+ export declare const ESIGN_MISSING_FIELD_SIGNATURE: EKYCErrorResultLike;
134
+ export declare const ESIGN_MISSING_EMAIL_OR_PHONE: EKYCErrorResultLike;
135
+ export declare const ESIGN_MISSING_POLICY_AGREEMENT: EKYCErrorResultLike;
136
+ export declare const ESIGN_MISSING_FIELD_POLICY_STATUS: EKYCErrorResultLike;
137
+ export declare const ESIGN_MISSING_FIELD_ACCEPT_TIME: EKYCErrorResultLike;
138
+ export declare const ESIGN_MISSING_FIELD_DEVICE: EKYCErrorResultLike;
139
+ export declare const ESIGN_MISSING_SIGN_POSITIONS: EKYCErrorResultLike;
140
+ export declare const ESIGN_MISSING_SIGN_POSITION_LOCATION: EKYCErrorResultLike;
141
+ export declare const ESIGN_MISSING_FIELD_DOCUMENT_NAME: EKYCErrorResultLike;
142
+ export declare const ESIGN_INVALID_REGISTER_DATE_FORMAT: EKYCErrorResultLike;
143
+ export declare const ESIGN_INVALID_EXPIRED_DATE_FORMAT: EKYCErrorResultLike;
110
144
  /**
111
145
  * Lấy message đã localize theo ngôn ngữ (giống Kotlin getLocalizedMessage).
112
146
  */
@@ -5,8 +5,13 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.READING_GLASSES_DETECTED_IN_SELFIE = exports.EYEWEAR_DETECTED_IN_SELFIE = exports.FACE_OCCLUDED_IN_SELFIE = exports.FACE_IS_BLURRED = exports.MASK_PRESENT_IN_SELFIE = exports.EYES_CLOSED_IN_SELFIE = exports.MULTIPLE_FACES_IN_SELFIE = exports.LIVENESS_FAIL = exports.LIVENESS_ERROR = exports.FACE_ERROR = exports.FACE_HAT_ERROR = exports.OCR_ERROR = exports.OCR_FONT_BACK_NOT_MATCH = exports.OCR_PHOTOCOPY_ID_CARD = exports.OCR_FAKE_PORTRAIT_DETECTED = exports.OCR_FAKE_CHARACTERS_DETECTED_2 = exports.OCR_FAKE_CHARACTERS_DETECTED_1 = exports.OCR_UNKNOWN_ID_NUMBER_LENGTH = exports.OCR_MODIFIED_BIRTH_DATE_DETECTED_CMND = exports.OCR_MODIFIED_SYMBOL_DETECTED_CMND = exports.OCR_FAKE_BIRTH_DATE_DETECTED_CMND = exports.OCR_FAKE_PORTRAIT_DETECTED_CMND = exports.OCR_FAKE_CHARACTERS_DETECTED_CMND = exports.OCR_USE_NEW_ID_DOCUMENT_2 = exports.OCR_USE_NEW_ID_DOCUMENT_1 = exports.OCR_FAKE_MRZ = exports.OCR_INVALID_GENDER_CODE = exports.OCR_INVALID_ID_CARD = exports.OCR_GLARE_ID_CARD = exports.OCR_BLURRY_ID_CARD = exports.OCR_CUT_CORNER_ID_CARD = exports.OCR_CANNOT_RECOGNIZE_PORTRAIT = exports.OCR_ID_CARD_FROM_OTHER_DEVICE = exports.OCR_NOT_ORIGINAL_ID_CARD = exports.OCR_MISSING_ID_CARD_PART = exports.OCR_CANNOT_GET_ISSUE_PLACE = exports.OCR_CANNOT_GET_GENDER = exports.OCR_CANNOT_GET_HOMETOWN = exports.OCR_CANNOT_GET_RESIDENCE = exports.OCR_CANNOT_GET_ISSUE_DATE = exports.OCR_CANNOT_GET_EXPIRY_DATE = exports.OCR_CANNOT_GET_BIRTH_YEAR = exports.OCR_CANNOT_GET_NAME = exports.OCR_CANNOT_GET_ID_NUMBER = exports.OCR_WRONG_ID_CARD_SIDE = exports.OCR_UNRECOGNIZED_ID_CARD = exports.SDK_MISS_KEY = exports.ERROR_UNKNOWN = exports.SDK_START_ERROR = exports.SDK_START_FLOW_ERROR = void 0;
8
- exports.getLocalizedMessage = exports.ESIGN_INVALID_PIN_CODE = exports.ESIGN_INVALID_RECOVERY_CODE = exports.ESIGN_INVALID_LICENSE_CODE = exports.ESIGN_INVALID_CONTEXT = exports.ESIGN_MISSING_REQUEST_ID = exports.ESIGN_MISSING_SERIAL = exports.ESIGN_MISSING_IDENTITY = exports.ESIGN_MISSING_ACCESS_TOKEN = exports.ESIGN_NO_SESSION_ID = exports.ESIGN_MISSING_CONFIRMATION_DOC = exports.ESIGN_MISSING_REQUEST_JSON = exports.ESIGN_MISSING_CCCD = exports.ESIGN_MISSING_TOKEN = exports.ESIGN_ERROR_UNKNOWN = exports.ESIGN_AUTH_REQUEST_EXISTS = exports.ESIGN_INVALID_CERT_FOR_AUTH = exports.ESIGN_INVALID_SIGN_COUNT_OR_TIME = exports.ESIGN_AUTH_EXISTS = exports.ESIGN_SESSION_INVALID_LIST_CERT = exports.ESIGN_INVALID_RECOVERY_OR_PIN = exports.ESIGN_SESSION_INVALID_REGISTER = exports.ESIGN_INVALID_USER_ACCOUNT = exports.ESIGN_APP_LIMITED = exports.ESIGN_DEVICE_NOT_INIT = exports.ESIGN_INVALID_LICENSE_CONTENT = exports.ESIGN_INVALID_LICENSE = exports.ESIGN_DEVICE_ALREADY_INIT = exports.ESIGN_SESSION_INVALID = exports.FETCH_HISTORY_ERROR = exports.QRCODE_ERROR = exports.USER_CANCEL = exports.SMS_OTP_RATE_LIMIT = exports.SMS_OTP_NOT_FOUND = exports.SMS_OTP_MAX_ATTEMPTS = exports.SMS_OTP_INVALID_PHONE = exports.SMS_OTP_ERROR = exports.NFC_CHIP_AUTH_FAILED = exports.NFC_USER_CANCEL = exports.NFC_UNKNOWN_ERROR = exports.NFC_IO_ERROR = exports.NFC_INVALID_MRZ_KEY = exports.NFC_CONNECTION_LOST = exports.NFC_MUTUAL_AUTH_FAILED = exports.C06_ERROR = exports.SCAN_NFC_ENABLE = exports.SCAN_NFC_CHECK = exports.SCAN_NFC_ERROR = exports.HEAD_IS_TURNED_IN_SELFIE = exports.NUDITY_DETECTED_IN_SELFIE = void 0;
9
- exports.getMessage = exports.getErrorResultFromDetails = exports.createCustom = exports.fromCode = void 0;
8
+ exports.ESIGN_MISSING_NAME = exports.ESIGN_INVALID_PIN_CODE = exports.ESIGN_INVALID_RECOVERY_CODE = exports.ESIGN_INVALID_LICENSE_CODE = exports.ESIGN_INVALID_CONTEXT = exports.ESIGN_MISSING_REQUEST_ID = exports.ESIGN_MISSING_SERIAL = exports.ESIGN_MISSING_IDENTITY = exports.ESIGN_MISSING_ACCESS_TOKEN = exports.ESIGN_NO_SESSION_ID = exports.ESIGN_MISSING_CONFIRMATION_DOC = exports.ESIGN_MISSING_REQUEST_JSON = exports.ESIGN_MISSING_CCCD = exports.ESIGN_MISSING_TOKEN = exports.ESIGN_ERROR_UNKNOWN = exports.ESIGN_AUTH_REQUEST_EXISTS = exports.ESIGN_INVALID_CERT_FOR_AUTH = exports.ESIGN_INVALID_SIGN_COUNT_OR_TIME = exports.ESIGN_AUTH_EXISTS = exports.ESIGN_SESSION_INVALID_LIST_CERT = exports.ESIGN_INVALID_RECOVERY_OR_PIN = exports.ESIGN_SESSION_INVALID_REGISTER = exports.ESIGN_INVALID_USER_ACCOUNT = exports.ESIGN_APP_LIMITED = exports.ESIGN_DEVICE_NOT_INIT = exports.ESIGN_INVALID_LICENSE_CONTENT = exports.ESIGN_INVALID_LICENSE = exports.ESIGN_DEVICE_ALREADY_INIT = exports.ESIGN_SESSION_INVALID = exports.FETCH_HISTORY_ERROR = exports.QRCODE_ERROR = exports.USER_CANCEL = exports.SMS_OTP_RATE_LIMIT = exports.SMS_OTP_NOT_FOUND = exports.SMS_OTP_MAX_ATTEMPTS = exports.SMS_OTP_INVALID_PHONE = exports.SMS_OTP_ERROR = exports.NFC_CHIP_AUTH_FAILED = exports.NFC_USER_CANCEL = exports.NFC_UNKNOWN_ERROR = exports.NFC_IO_ERROR = exports.NFC_INVALID_MRZ_KEY = exports.NFC_CONNECTION_LOST = exports.NFC_MUTUAL_AUTH_FAILED = exports.C06_ERROR = exports.SCAN_NFC_ENABLE = exports.SCAN_NFC_CHECK = exports.SCAN_NFC_ERROR = exports.HEAD_IS_TURNED_IN_SELFIE = exports.NUDITY_DETECTED_IN_SELFIE = void 0;
9
+ exports.ESIGN_INVALID_EXPIRED_DATE_FORMAT = exports.ESIGN_INVALID_REGISTER_DATE_FORMAT = exports.ESIGN_MISSING_FIELD_DOCUMENT_NAME = exports.ESIGN_MISSING_SIGN_POSITION_LOCATION = exports.ESIGN_MISSING_SIGN_POSITIONS = exports.ESIGN_MISSING_FIELD_DEVICE = exports.ESIGN_MISSING_FIELD_ACCEPT_TIME = exports.ESIGN_MISSING_FIELD_POLICY_STATUS = exports.ESIGN_MISSING_POLICY_AGREEMENT = exports.ESIGN_MISSING_EMAIL_OR_PHONE = exports.ESIGN_MISSING_FIELD_SIGNATURE = exports.ESIGN_MISSING_FIELD_ADDRESS = exports.ESIGN_MISSING_FIELD_NAME = exports.ESIGN_MISSING_FIELD_SESSION_ID = exports.ESIGN_MISSING_FIELD_SERIAL_TOKEN = exports.ESIGN_MISSING_FIELD_USERNAME = exports.ESIGN_MISSING_TOKEN_INFO = exports.ESIGN_MISSING_FIELD_DATA = exports.ESIGN_MISSING_SIGNING_CONTENTS = exports.ESIGN_MISSING_FIELD_EXPIRED_DATE = exports.ESIGN_MISSING_FIELD_REGISTER_DATE = exports.ESIGN_MISSING_FIELD_SOD = exports.ESIGN_MISSING_FIELD_IDENTITY = exports.ESIGN_MISSING_USER_INFO = exports.ESIGN_INVALID_RECOVERY_FORMAT = exports.ESIGN_INVALID_PIN_FORMAT = exports.ESIGN_INVALID_TIME = exports.ESIGN_INVALID_QUANTITY = exports.ESIGN_INVALID_PAGE_PARAMS = exports.ESIGN_MISSING_USER_PIN = exports.ESIGN_MISSING_PIN_CODE = exports.ESIGN_INVALID_REQUEST_JSON = exports.ESIGN_MISSING_DEVICE_ID = void 0;
10
+ exports.getLocalizedMessage = getLocalizedMessage;
11
+ exports.fromCode = fromCode;
12
+ exports.createCustom = createCustom;
13
+ exports.getErrorResultFromDetails = getErrorResultFromDetails;
14
+ exports.getMessage = getMessage;
10
15
  function def(code, viMessage, enMessage) {
11
16
  return { code, viMessage, enMessage };
12
17
  }
@@ -137,6 +142,43 @@ exports.ESIGN_INVALID_LICENSE_CODE = def('611', 'Mã license không được đ
137
142
  exports.ESIGN_INVALID_RECOVERY_CODE = def('612', 'Mã recovery không được để trống (8 chữ số)', 'Recovery code cannot be empty (8 digits required)');
138
143
  exports.ESIGN_INVALID_PIN_CODE = def('613', 'Mã PIN không được để trống (6 chữ số)', 'PIN code cannot be empty (6 digits required)');
139
144
  // ========================================
145
+ // ESIGN VALIDATION ERRORS (614 -> 649)
146
+ // ========================================
147
+ exports.ESIGN_MISSING_NAME = def('614', 'Thiếu tên người dùng', 'User name is required');
148
+ exports.ESIGN_MISSING_DEVICE_ID = def('615', 'Thiếu Device ID', 'Device ID is required');
149
+ exports.ESIGN_INVALID_REQUEST_JSON = def('616', 'Request JSON không hợp lệ (không parse được)', 'Request JSON is invalid (cannot parse)');
150
+ exports.ESIGN_MISSING_PIN_CODE = def('617', 'Thiếu mã PIN', 'PIN code is required');
151
+ exports.ESIGN_MISSING_USER_PIN = def('618', 'Thiếu mã PIN người dùng', 'User PIN is required');
152
+ exports.ESIGN_INVALID_PAGE_PARAMS = def('619', 'pageNumber và pageSize phải lớn hơn 0', 'pageNumber and pageSize must be greater than 0');
153
+ exports.ESIGN_INVALID_QUANTITY = def('620', 'Số lượng (quantity) phải lớn hơn 0', 'Quantity must be greater than 0');
154
+ exports.ESIGN_INVALID_TIME = def('621', 'Thời gian (time) phải lớn hơn 0', 'Time must be greater than 0');
155
+ exports.ESIGN_INVALID_PIN_FORMAT = def('622', 'Mã PIN phải đúng 6 chữ số', 'PIN code must be exactly 6 digits');
156
+ exports.ESIGN_INVALID_RECOVERY_FORMAT = def('623', 'Mã recovery phải đúng 8 chữ số', 'Recovery code must be exactly 8 digits');
157
+ exports.ESIGN_MISSING_USER_INFO = def('624', 'Thiếu object userInfo trong request JSON', 'userInfo object is required in request JSON');
158
+ exports.ESIGN_MISSING_FIELD_IDENTITY = def('625', 'Thiếu userInfo.identity trong request JSON', 'userInfo.identity is required in request JSON');
159
+ exports.ESIGN_MISSING_FIELD_SOD = def('626', 'Thiếu userInfo.sod trong request JSON', 'userInfo.sod is required in request JSON');
160
+ exports.ESIGN_MISSING_FIELD_REGISTER_DATE = def('627', 'Thiếu userInfo.registerDate trong request JSON', 'userInfo.registerDate is required in request JSON');
161
+ exports.ESIGN_MISSING_FIELD_EXPIRED_DATE = def('628', 'Thiếu userInfo.expiredDate trong request JSON', 'userInfo.expiredDate is required in request JSON');
162
+ exports.ESIGN_MISSING_SIGNING_CONTENTS = def('629', 'Thiếu signingRequestContents trong request JSON', 'signingRequestContents is required in request JSON');
163
+ exports.ESIGN_MISSING_FIELD_DATA = def('630', 'Thiếu data (PDF base64) trong signingRequestContents', 'data (PDF base64) is required in signingRequestContents');
164
+ exports.ESIGN_MISSING_TOKEN_INFO = def('631', 'Thiếu tokenInfo trong request JSON', 'tokenInfo object is required in request JSON');
165
+ exports.ESIGN_MISSING_FIELD_USERNAME = def('632', 'Thiếu tokenInfo.username trong request JSON', 'tokenInfo.username is required in request JSON');
166
+ exports.ESIGN_MISSING_FIELD_SERIAL_TOKEN = def('633', 'Thiếu tokenInfo.serial trong request JSON', 'tokenInfo.serial is required in request JSON');
167
+ exports.ESIGN_MISSING_FIELD_SESSION_ID = def('634', 'Thiếu sessionId trong request JSON', 'sessionId is required in request JSON');
168
+ exports.ESIGN_MISSING_FIELD_NAME = def('635', 'Thiếu userInfo.name trong request JSON', 'userInfo.name is required in request JSON');
169
+ exports.ESIGN_MISSING_FIELD_ADDRESS = def('636', 'Thiếu userInfo.address trong request JSON', 'userInfo.address is required in request JSON');
170
+ exports.ESIGN_MISSING_FIELD_SIGNATURE = def('637', 'Thiếu userInfo.signature trong request JSON', 'userInfo.signature is required in request JSON');
171
+ exports.ESIGN_MISSING_EMAIL_OR_PHONE = def('638', 'Phải có ít nhất email hoặc phone trong request JSON', 'At least email or phone is required in request JSON');
172
+ exports.ESIGN_MISSING_POLICY_AGREEMENT = def('639', 'Thiếu policyAgreement trong request JSON', 'policyAgreement object is required in request JSON');
173
+ exports.ESIGN_MISSING_FIELD_POLICY_STATUS = def('640', 'Thiếu policyAgreement.policyStatus trong request JSON', 'policyAgreement.policyStatus is required in request JSON');
174
+ exports.ESIGN_MISSING_FIELD_ACCEPT_TIME = def('641', 'Thiếu policyAgreement.acceptTime trong request JSON', 'policyAgreement.acceptTime is required in request JSON');
175
+ exports.ESIGN_MISSING_FIELD_DEVICE = def('642', 'Thiếu policyAgreement.device trong request JSON', 'policyAgreement.device is required in request JSON');
176
+ exports.ESIGN_MISSING_SIGN_POSITIONS = def('645', 'Thiếu signPositions trong signingRequestContents (API multiple positions)', 'signPositions array is required in signingRequestContents');
177
+ exports.ESIGN_MISSING_SIGN_POSITION_LOCATION = def('646', 'Thiếu location trong signPositions', 'location object is required in each signPosition');
178
+ exports.ESIGN_MISSING_FIELD_DOCUMENT_NAME = def('647', 'Thiếu documentName trong signingRequestContents', 'documentName is required in signingRequestContents');
179
+ exports.ESIGN_INVALID_REGISTER_DATE_FORMAT = def('648', 'userInfo.registerDate phải đúng định dạng dd/MM/yyyy', 'userInfo.registerDate must be in dd/MM/yyyy format');
180
+ exports.ESIGN_INVALID_EXPIRED_DATE_FORMAT = def('649', 'userInfo.expiredDate phải đúng định dạng dd/MM/yyyy', 'userInfo.expiredDate must be in dd/MM/yyyy format');
181
+ // ========================================
140
182
  // Predefined list & code map (companion object)
141
183
  // ========================================
142
184
  const PREDEFINED_ERRORS = [
@@ -165,6 +207,19 @@ const PREDEFINED_ERRORS = [
165
207
  exports.ESIGN_INVALID_USER_ACCOUNT, exports.ESIGN_SESSION_INVALID_REGISTER, exports.ESIGN_INVALID_RECOVERY_OR_PIN,
166
208
  exports.ESIGN_SESSION_INVALID_LIST_CERT, exports.ESIGN_AUTH_EXISTS, exports.ESIGN_INVALID_SIGN_COUNT_OR_TIME,
167
209
  exports.ESIGN_INVALID_CERT_FOR_AUTH, exports.ESIGN_AUTH_REQUEST_EXISTS,
210
+ exports.ESIGN_MISSING_NAME, exports.ESIGN_MISSING_DEVICE_ID, exports.ESIGN_INVALID_REQUEST_JSON,
211
+ exports.ESIGN_MISSING_PIN_CODE, exports.ESIGN_MISSING_USER_PIN, exports.ESIGN_INVALID_PAGE_PARAMS,
212
+ exports.ESIGN_INVALID_QUANTITY, exports.ESIGN_INVALID_TIME, exports.ESIGN_INVALID_PIN_FORMAT, exports.ESIGN_INVALID_RECOVERY_FORMAT,
213
+ exports.ESIGN_MISSING_USER_INFO, exports.ESIGN_MISSING_FIELD_IDENTITY, exports.ESIGN_MISSING_FIELD_SOD,
214
+ exports.ESIGN_MISSING_FIELD_REGISTER_DATE, exports.ESIGN_MISSING_FIELD_EXPIRED_DATE,
215
+ exports.ESIGN_MISSING_SIGNING_CONTENTS, exports.ESIGN_MISSING_FIELD_DATA, exports.ESIGN_MISSING_TOKEN_INFO,
216
+ exports.ESIGN_MISSING_FIELD_USERNAME, exports.ESIGN_MISSING_FIELD_SERIAL_TOKEN, exports.ESIGN_MISSING_FIELD_SESSION_ID,
217
+ exports.ESIGN_MISSING_FIELD_NAME, exports.ESIGN_MISSING_FIELD_ADDRESS, exports.ESIGN_MISSING_FIELD_SIGNATURE,
218
+ exports.ESIGN_MISSING_EMAIL_OR_PHONE, exports.ESIGN_MISSING_POLICY_AGREEMENT,
219
+ exports.ESIGN_MISSING_FIELD_POLICY_STATUS, exports.ESIGN_MISSING_FIELD_ACCEPT_TIME, exports.ESIGN_MISSING_FIELD_DEVICE,
220
+ exports.ESIGN_MISSING_SIGN_POSITIONS, exports.ESIGN_MISSING_SIGN_POSITION_LOCATION,
221
+ exports.ESIGN_MISSING_FIELD_DOCUMENT_NAME,
222
+ exports.ESIGN_INVALID_REGISTER_DATE_FORMAT, exports.ESIGN_INVALID_EXPIRED_DATE_FORMAT,
168
223
  exports.USER_CANCEL,
169
224
  ];
170
225
  const CODE_MAP = {};
@@ -179,7 +234,6 @@ function getLocalizedMessage(result, language) {
179
234
  }
180
235
  return (result.viMessage || result.enMessage).trim();
181
236
  }
182
- exports.getLocalizedMessage = getLocalizedMessage;
183
237
  /**
184
238
  * Tìm EKYCErrorResult theo code (giống Kotlin fromCode).
185
239
  */
@@ -187,14 +241,12 @@ function fromCode(code) {
187
241
  var _a;
188
242
  return (_a = CODE_MAP[code]) !== null && _a !== void 0 ? _a : null;
189
243
  }
190
- exports.fromCode = fromCode;
191
244
  /**
192
245
  * Tạo lỗi tùy biến (giống Kotlin createCustom / CustomError).
193
246
  */
194
247
  function createCustom(code, message) {
195
248
  return defSame(code, message);
196
249
  }
197
- exports.createCustom = createCustom;
198
250
  /**
199
251
  * Lấy error từ danh sách details (giống Kotlin getErrorResultFromDetails).
200
252
  * Chi tiết có thể có .code hoặc .getCode().
@@ -218,11 +270,9 @@ function getErrorResultFromDetails(details) {
218
270
  }
219
271
  return exports.ERROR_UNKNOWN;
220
272
  }
221
- exports.getErrorResultFromDetails = getErrorResultFromDetails;
222
273
  /**
223
274
  * Trả về message theo ngôn ngữ cho một result (alias tiện).
224
275
  */
225
276
  function getMessage(result, lang) {
226
277
  return getLocalizedMessage(result, lang);
227
278
  }
228
- exports.getMessage = getMessage;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * React Native port of EkycNativeAndroid EKYCEvent.kt
3
+ * Enum các sự kiện SDK trả về qua callback, đồng bộ 1:1 với Android enum.
4
+ *
5
+ * @see EkycNativeAndroid/Module/SDKCore/src/main/java/finos/sdk/core/define/EKYCEvent.kt
6
+ */
7
+ /**
8
+ * EKYCEvent – tên event trả về từ native callback success.
9
+ * Giá trị string map chính xác với Android enum name.
10
+ */
11
+ export declare enum EKYCEvent {
12
+ /** SDK khởi tạo thành công, activity/flow vừa mở. */
13
+ SDK_START_SUCCESS = "SDK_START_SUCCESS",
14
+ /** SDK flow hoàn thành, có data kết quả. */
15
+ SDK_END_SUCCESS = "SDK_END_SUCCESS",
16
+ /** Bắt đầu quét NFC (đang chờ thẻ). */
17
+ SCAN_NFC_START = "SCAN_NFC_START",
18
+ /** Quét NFC thành công, có dữ liệu thẻ. */
19
+ SCAN_NFC_SUCCESS = "SCAN_NFC_SUCCESS",
20
+ /** Xác minh C06 thành công. */
21
+ C06_SUCCESS = "C06_SUCCESS",
22
+ /** Liveness detection thành công. */
23
+ LIVENESS_SUCCESS = "LIVENESS_SUCCESS",
24
+ /** Face detection đang xử lý (progress). */
25
+ FACE_PROGRESS = "FACE_PROGRESS",
26
+ /** Face compare thành công. */
27
+ FACE_SUCCESS = "FACE_SUCCESS",
28
+ /** OCR xử lý thành công. */
29
+ OCR_SUCCESS = "OCR_SUCCESS",
30
+ /** QR Code quét thành công. */
31
+ QRCODE_SUCCESS = "QRCODE_SUCCESS",
32
+ /** Lấy lịch sử giao dịch thành công. */
33
+ FETCH_LATEST_TRANSACTION_SUCCESS = "FETCH_LATEST_TRANSACTION_SUCCESS",
34
+ /** Gửi SMS OTP thành công. */
35
+ SMS_OTP_SEND_SUCCESS = "SMS_OTP_SEND_SUCCESS",
36
+ /** Xác minh SMS OTP thành công. */
37
+ SMS_OTP_VERIFY_SUCCESS = "SMS_OTP_VERIFY_SUCCESS",
38
+ /** Gửi lại SMS OTP thành công. */
39
+ SMS_OTP_RESEND_SUCCESS = "SMS_OTP_RESEND_SUCCESS",
40
+ /** Kết quả NFC/Liveness/FaceService đã submit lên server thành công (v1.4.5). */
41
+ LOG_SUCCESS = "LOG_SUCCESS"
42
+ }
43
+ /**
44
+ * EKYCErrorEvent – tên event trả về từ native callback error.
45
+ * Đồng bộ với Android enum EKYCErrorEvent.
46
+ *
47
+ * @see EkycNativeAndroid/Module/SDKCore/src/main/java/finos/sdk/core/define/EKYCErrorEvent.kt
48
+ */
49
+ export declare enum EKYCErrorEvent {
50
+ SDK_START_ERROR = "SDK_START_ERROR",
51
+ OCR_ERROR = "OCR_ERROR",
52
+ LIVENESS_ERROR = "LIVENESS_ERROR",
53
+ FACE_ERROR = "FACE_ERROR",
54
+ NFC_ERROR = "NFC_ERROR",
55
+ C06_ERROR = "C06_ERROR",
56
+ SDK_DETAIL = "SDK_DETAIL",
57
+ SMS_OTP_ERROR = "SMS_OTP_ERROR",
58
+ ESIGN_ERROR = "ESIGN_ERROR",
59
+ USER_CANCEL = "USER_CANCEL"
60
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ /**
3
+ * React Native port of EkycNativeAndroid EKYCEvent.kt
4
+ * Enum các sự kiện SDK trả về qua callback, đồng bộ 1:1 với Android enum.
5
+ *
6
+ * @see EkycNativeAndroid/Module/SDKCore/src/main/java/finos/sdk/core/define/EKYCEvent.kt
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.EKYCErrorEvent = exports.EKYCEvent = void 0;
10
+ /**
11
+ * EKYCEvent – tên event trả về từ native callback success.
12
+ * Giá trị string map chính xác với Android enum name.
13
+ */
14
+ var EKYCEvent;
15
+ (function (EKYCEvent) {
16
+ /** SDK khởi tạo thành công, activity/flow vừa mở. */
17
+ EKYCEvent["SDK_START_SUCCESS"] = "SDK_START_SUCCESS";
18
+ /** SDK flow hoàn thành, có data kết quả. */
19
+ EKYCEvent["SDK_END_SUCCESS"] = "SDK_END_SUCCESS";
20
+ /** Bắt đầu quét NFC (đang chờ thẻ). */
21
+ EKYCEvent["SCAN_NFC_START"] = "SCAN_NFC_START";
22
+ /** Quét NFC thành công, có dữ liệu thẻ. */
23
+ EKYCEvent["SCAN_NFC_SUCCESS"] = "SCAN_NFC_SUCCESS";
24
+ /** Xác minh C06 thành công. */
25
+ EKYCEvent["C06_SUCCESS"] = "C06_SUCCESS";
26
+ /** Liveness detection thành công. */
27
+ EKYCEvent["LIVENESS_SUCCESS"] = "LIVENESS_SUCCESS";
28
+ /** Face detection đang xử lý (progress). */
29
+ EKYCEvent["FACE_PROGRESS"] = "FACE_PROGRESS";
30
+ /** Face compare thành công. */
31
+ EKYCEvent["FACE_SUCCESS"] = "FACE_SUCCESS";
32
+ /** OCR xử lý thành công. */
33
+ EKYCEvent["OCR_SUCCESS"] = "OCR_SUCCESS";
34
+ /** QR Code quét thành công. */
35
+ EKYCEvent["QRCODE_SUCCESS"] = "QRCODE_SUCCESS";
36
+ /** Lấy lịch sử giao dịch thành công. */
37
+ EKYCEvent["FETCH_LATEST_TRANSACTION_SUCCESS"] = "FETCH_LATEST_TRANSACTION_SUCCESS";
38
+ /** Gửi SMS OTP thành công. */
39
+ EKYCEvent["SMS_OTP_SEND_SUCCESS"] = "SMS_OTP_SEND_SUCCESS";
40
+ /** Xác minh SMS OTP thành công. */
41
+ EKYCEvent["SMS_OTP_VERIFY_SUCCESS"] = "SMS_OTP_VERIFY_SUCCESS";
42
+ /** Gửi lại SMS OTP thành công. */
43
+ EKYCEvent["SMS_OTP_RESEND_SUCCESS"] = "SMS_OTP_RESEND_SUCCESS";
44
+ /** Kết quả NFC/Liveness/FaceService đã submit lên server thành công (v1.4.5). */
45
+ EKYCEvent["LOG_SUCCESS"] = "LOG_SUCCESS";
46
+ })(EKYCEvent || (exports.EKYCEvent = EKYCEvent = {}));
47
+ /**
48
+ * EKYCErrorEvent – tên event trả về từ native callback error.
49
+ * Đồng bộ với Android enum EKYCErrorEvent.
50
+ *
51
+ * @see EkycNativeAndroid/Module/SDKCore/src/main/java/finos/sdk/core/define/EKYCErrorEvent.kt
52
+ */
53
+ var EKYCErrorEvent;
54
+ (function (EKYCErrorEvent) {
55
+ EKYCErrorEvent["SDK_START_ERROR"] = "SDK_START_ERROR";
56
+ EKYCErrorEvent["OCR_ERROR"] = "OCR_ERROR";
57
+ EKYCErrorEvent["LIVENESS_ERROR"] = "LIVENESS_ERROR";
58
+ EKYCErrorEvent["FACE_ERROR"] = "FACE_ERROR";
59
+ EKYCErrorEvent["NFC_ERROR"] = "NFC_ERROR";
60
+ EKYCErrorEvent["C06_ERROR"] = "C06_ERROR";
61
+ EKYCErrorEvent["SDK_DETAIL"] = "SDK_DETAIL";
62
+ EKYCErrorEvent["SMS_OTP_ERROR"] = "SMS_OTP_ERROR";
63
+ EKYCErrorEvent["ESIGN_ERROR"] = "ESIGN_ERROR";
64
+ EKYCErrorEvent["USER_CANCEL"] = "USER_CANCEL";
65
+ })(EKYCErrorEvent || (exports.EKYCErrorEvent = EKYCErrorEvent = {}));
@@ -56,6 +56,7 @@ export interface ESignSignRequestConfirm {
56
56
  export interface ESignApiResponse {
57
57
  status: number;
58
58
  msg: string;
59
+ errorCode?: string;
59
60
  data?: {
60
61
  sessionId?: string;
61
62
  [key: string]: any;
@@ -69,6 +70,7 @@ export interface ESignApiResponse {
69
70
  export interface ESignPdfResult {
70
71
  status: number;
71
72
  msg: string;
73
+ errorCode?: string;
72
74
  data?: {
73
75
  transactionId: string;
74
76
  [key: string]: any;
@@ -17,4 +17,4 @@ var AuthorizationStatus;
17
17
  AuthorizationStatus["INACTIVE"] = "INACTIVE";
18
18
  AuthorizationStatus["REJECTED"] = "REJECTED";
19
19
  AuthorizationStatus["ACTIVE"] = "ACTIVE";
20
- })(AuthorizationStatus = exports.AuthorizationStatus || (exports.AuthorizationStatus = {}));
20
+ })(AuthorizationStatus || (exports.AuthorizationStatus = AuthorizationStatus = {}));
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.flowToStrings = exports.SDK_FLOW_OPTIONS = exports.SDKFlowType = void 0;
3
+ exports.SDK_FLOW_OPTIONS = exports.SDKFlowType = void 0;
4
+ exports.flowToStrings = flowToStrings;
4
5
  /**
5
6
  * Các bước trong flow eKYC – map với Android SDKType (OCR, NFC, LIVENESS).
6
7
  * Bên sử dụng truyền enum vào SDK thay vì string.
@@ -14,7 +15,7 @@ var SDKFlowType;
14
15
  SDKFlowType["OCR"] = "OCR";
15
16
  SDKFlowType["NFC"] = "NFC";
16
17
  SDKFlowType["LIVENESS"] = "LIVENESS";
17
- })(SDKFlowType = exports.SDKFlowType || (exports.SDKFlowType = {}));
18
+ })(SDKFlowType || (exports.SDKFlowType = SDKFlowType = {}));
18
19
  /** Mảng đầy đủ các bước (dùng cho picker / default flow). */
19
20
  exports.SDK_FLOW_OPTIONS = [
20
21
  SDKFlowType.OCR,
@@ -25,4 +26,3 @@ exports.SDK_FLOW_OPTIONS = [
25
26
  function flowToStrings(flow) {
26
27
  return flow.map(f => f);
27
28
  }
28
- exports.flowToStrings = flowToStrings;
@@ -24,9 +24,8 @@ export interface LivenessConfig {
24
24
  appKey: string;
25
25
  transactionId?: string;
26
26
  selfieImage: string;
27
- switchFrontCamera?: boolean;
28
27
  isActiveLiveness?: boolean;
29
- autoCapture?: boolean;
28
+ isActiveLivenessColor?: boolean;
30
29
  isShowCameraFont?: boolean;
31
30
  customActions?: SDKFaceDetectStatus[];
32
31
  activeActionCount?: number;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.customActionsToStrings = exports.SDK_LIVENESS_ACTIONS = exports.SDKFaceDetectStatus = void 0;
3
+ exports.SDK_LIVENESS_ACTIONS = exports.SDKFaceDetectStatus = void 0;
4
+ exports.customActionsToStrings = customActionsToStrings;
4
5
  /**
5
6
  * Custom actions cho liveness – map Android SDKFaceDetectStatus.
6
7
  * Bên sử dụng truyền enum vào optionConfig.customActions thay vì string.
@@ -18,7 +19,7 @@ var SDKFaceDetectStatus;
18
19
  SDKFaceDetectStatus["WINK_LEFT"] = "WINK_LEFT";
19
20
  SDKFaceDetectStatus["WINK_RIGHT"] = "WINK_RIGHT";
20
21
  SDKFaceDetectStatus["STRAIGHT"] = "STRAIGHT";
21
- })(SDKFaceDetectStatus = exports.SDKFaceDetectStatus || (exports.SDKFaceDetectStatus = {}));
22
+ })(SDKFaceDetectStatus || (exports.SDKFaceDetectStatus = SDKFaceDetectStatus = {}));
22
23
  /** Mảng đầy đủ các action (trừ STRAIGHT thường được SDK tự thêm cuối) – dùng cho picker / default. */
23
24
  exports.SDK_LIVENESS_ACTIONS = [
24
25
  SDKFaceDetectStatus.LEFT,
@@ -37,4 +38,3 @@ exports.SDK_LIVENESS_ACTIONS = [
37
38
  function customActionsToStrings(actions) {
38
39
  return actions.map(a => a);
39
40
  }
40
- exports.customActionsToStrings = customActionsToStrings;