@finos_sdk/sdk-ekyc 0.0.31 โ†’ 0.0.33

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.
Files changed (56) hide show
  1. package/android/SDKeKYC/finos/sdk/ekyc/c06/maven-metadata-local.xml +1 -1
  2. package/android/SDKeKYC/finos/sdk/ekyc/ekyc/maven-metadata-local.xml +1 -1
  3. package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0-javadoc.jar +0 -0
  4. package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0-sources.jar +0 -0
  5. package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0.aar +0 -0
  6. package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0.module +151 -0
  7. package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0.pom +43 -0
  8. package/android/SDKeKYC/finos/sdk/ekyc/ekycui/maven-metadata-local.xml +13 -0
  9. package/android/SDKeKYC/finos/sdk/ekyc/faceservice/maven-metadata-local.xml +1 -1
  10. package/android/SDKeKYC/finos/sdk/ekyc/liveness/maven-metadata-local.xml +1 -1
  11. package/android/SDKeKYC/finos/sdk/ekyc/nfc/maven-metadata-local.xml +1 -1
  12. package/android/SDKeKYC/finos/sdk/ekyc/ocr/maven-metadata-local.xml +1 -1
  13. package/android/SDKeKYC/finos/sdk/ekyc/qrcode/maven-metadata-local.xml +1 -1
  14. package/android/SDKeKYC/finos/sdk/ekyc/sdkcore/maven-metadata-local.xml +1 -1
  15. package/android/SDKeKYC/finos/sdk/ekyc/sdkcorecamera/maven-metadata-local.xml +1 -1
  16. package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0-javadoc.jar +0 -0
  17. package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0-sources.jar +0 -0
  18. package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0.aar +0 -0
  19. package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0.module +228 -0
  20. package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0.pom +103 -0
  21. package/android/SDKeKYC/finos/sdk/ekyc/sdkui/maven-metadata-local.xml +13 -0
  22. package/android/src/main/build/generated/source/buildConfig/debug/com/sdkekycrn/BuildConfig.java +10 -0
  23. package/android/src/main/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
  24. package/android/src/main/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  25. package/android/src/main/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar +0 -0
  26. package/android/src/main/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  27. package/android/src/main/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  28. package/android/src/main/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
  29. package/android/src/main/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  30. package/android/src/main/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  31. package/android/src/main/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  32. package/android/src/main/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  33. package/android/src/main/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
  34. package/android/src/main/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  35. package/android/src/main/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  36. package/android/src/main/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  37. package/android/src/main/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/sdkekycrn/BuildConfig.class +0 -0
  38. package/android/src/main/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
  39. package/android/src/main/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
  40. package/android/src/main/build/intermediates/merged_java_res/debug/mergeDebugJavaResource/feature-main.jar +0 -0
  41. package/android/src/main/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
  42. package/android/src/main/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  43. package/android/src/main/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
  44. package/android/src/main/build/outputs/aar/main-debug.aar +0 -0
  45. package/android/src/main/build/outputs/logs/manifest-merger-debug-report.txt +16 -0
  46. package/android/src/main/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  47. package/dist/App.js +481 -12
  48. package/dist/EKYCModule.d.ts +60 -0
  49. package/dist/EKYCModule.js +140 -9
  50. package/dist/index.d.ts +4 -1
  51. package/dist/index.js +7 -2
  52. package/dist/src/modules/FinosEKYCModule.d.ts +206 -0
  53. package/dist/src/modules/FinosEKYCModule.js +352 -0
  54. package/package.json +2 -2
  55. package/src/modules/FinosEKYCModule.ts +450 -0
  56. package/src/modules/README.md +347 -0
@@ -0,0 +1,352 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
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
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.SDK_NAME = exports.SDK_VERSION = exports.FinosEKYC = exports.FinosEKYCModule = void 0;
27
+ const react_native_1 = require("react-native");
28
+ const EKYCModule_1 = __importStar(require("../../EKYCModule"));
29
+ Object.defineProperty(exports, "SDK_VERSION", { enumerable: true, get: function () { return EKYCModule_1.SDK_VERSION; } });
30
+ Object.defineProperty(exports, "SDK_NAME", { enumerable: true, get: function () { return EKYCModule_1.SDK_NAME; } });
31
+ /**
32
+ * Finos eKYC SDK Module v0.0.31
33
+ *
34
+ * A comprehensive React Native module for electronic Know Your Customer (eKYC) operations
35
+ * including Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, and C06 residence verification.
36
+ *
37
+ * @version 0.0.31
38
+ * @author FinOS
39
+ * @license MIT
40
+ */
41
+ class FinosEKYCModule {
42
+ constructor() {
43
+ this.isInitialized = false;
44
+ this.sdk = EKYCModule_1.default;
45
+ this.platform = react_native_1.Platform.OS;
46
+ }
47
+ /**
48
+ * Get singleton instance of FinosEKYCModule
49
+ */
50
+ static getInstance() {
51
+ if (!FinosEKYCModule.instance) {
52
+ FinosEKYCModule.instance = new FinosEKYCModule();
53
+ }
54
+ return FinosEKYCModule.instance;
55
+ }
56
+ /**
57
+ * Get SDK information
58
+ */
59
+ async getSDKInfo() {
60
+ try {
61
+ const nativeInfo = await this.sdk.getSDKInfo();
62
+ return Object.assign(Object.assign({}, nativeInfo), { platform: this.platform, isInitialized: this.isInitialized });
63
+ }
64
+ catch (error) {
65
+ return {
66
+ name: EKYCModule_1.SDK_NAME,
67
+ version: EKYCModule_1.SDK_VERSION,
68
+ buildNumber: '1',
69
+ platform: this.platform,
70
+ isInitialized: this.isInitialized
71
+ };
72
+ }
73
+ }
74
+ /**
75
+ * Initialize the eKYC SDK
76
+ * Must be called before using any other methods
77
+ */
78
+ async initialize() {
79
+ try {
80
+ if (this.isInitialized) {
81
+ console.log('โœ… SDK already initialized');
82
+ return 'SDK already initialized';
83
+ }
84
+ // Check if SDK is already initialized on native side
85
+ if (this.sdk.isSDKInitialized()) {
86
+ this.isInitialized = true;
87
+ console.log('โœ… SDK already initialized on native side');
88
+ return 'SDK already initialized on native side';
89
+ }
90
+ const result = await this.sdk.initSdkEkyc();
91
+ this.isInitialized = true;
92
+ console.log('โœ… Finos eKYC SDK v0.0.31 initialized successfully');
93
+ return result;
94
+ }
95
+ catch (error) {
96
+ // Handle Koin Application already started error
97
+ if (error && error.toString().includes('Koin Application has already been started')) {
98
+ console.log('โœ… SDK already initialized (Koin Application started)');
99
+ this.isInitialized = true;
100
+ return 'SDK already initialized (Koin Application started)';
101
+ }
102
+ console.error('โŒ Failed to initialize Finos eKYC SDK:', error);
103
+ throw new Error(`SDK initialization failed: ${error}`);
104
+ }
105
+ }
106
+ /**
107
+ * Check if SDK is initialized
108
+ */
109
+ isSDKReady() {
110
+ return this.isInitialized && this.sdk.isSDKInitialized();
111
+ }
112
+ /**
113
+ * Start NFC scanning for Vietnamese CCCD
114
+ * @param config NFC configuration
115
+ */
116
+ async startNfcScan(config) {
117
+ this.validateSDKReady();
118
+ this.validatePlatform('android', 'NFC scanning is only available on Android');
119
+ try {
120
+ console.log('๐Ÿ“ก Starting NFC scan...');
121
+ const result = await this.sdk.startNfcScan(config);
122
+ console.log('โœ… NFC scan completed:', result.event);
123
+ return result;
124
+ }
125
+ catch (error) {
126
+ console.error('โŒ NFC scan failed:', error);
127
+ throw error;
128
+ }
129
+ }
130
+ /**
131
+ * Check C06 residence verification
132
+ * @param config C06 configuration
133
+ */
134
+ async checkC06(config) {
135
+ this.validateSDKReady();
136
+ try {
137
+ console.log('๐Ÿ  Starting C06 residence check...');
138
+ const result = await this.sdk.checkC06(config);
139
+ console.log('โœ… C06 check completed:', result.event);
140
+ return result;
141
+ }
142
+ catch (error) {
143
+ console.error('โŒ C06 check failed:', error);
144
+ throw error;
145
+ }
146
+ }
147
+ /**
148
+ * Start OCR document scanning
149
+ * @param config OCR configuration
150
+ */
151
+ async startOCR(config) {
152
+ this.validateSDKReady();
153
+ try {
154
+ console.log('๐Ÿ“„ Starting OCR scan...');
155
+ const result = await this.sdk.startOcr(config);
156
+ console.log('โœ… OCR scan completed:', result.event);
157
+ return result;
158
+ }
159
+ catch (error) {
160
+ console.error('โŒ OCR scan failed:', error);
161
+ throw error;
162
+ }
163
+ }
164
+ /**
165
+ * Start liveness detection
166
+ * @param config Liveness configuration
167
+ */
168
+ async startLiveness(config) {
169
+ this.validateSDKReady();
170
+ try {
171
+ console.log('๐Ÿ‘๏ธ Starting liveness detection...');
172
+ const result = await this.sdk.startLiveness(config);
173
+ console.log('โœ… Liveness detection completed:', result.event);
174
+ return result;
175
+ }
176
+ catch (error) {
177
+ console.error('โŒ Liveness detection failed:', error);
178
+ throw error;
179
+ }
180
+ }
181
+ /**
182
+ * Start face comparison
183
+ * @param config Face service configuration
184
+ */
185
+ async startFaceCompare(config) {
186
+ this.validateSDKReady();
187
+ try {
188
+ console.log('๐Ÿ‘ค Starting face comparison...');
189
+ const result = await this.sdk.startFaceCompare(config);
190
+ console.log('โœ… Face comparison completed:', result.event);
191
+ return result;
192
+ }
193
+ catch (error) {
194
+ console.error('โŒ Face comparison failed:', error);
195
+ throw error;
196
+ }
197
+ }
198
+ /**
199
+ * Extract NFC data for C06 verification
200
+ * @param nfcResultJson NFC result JSON string
201
+ */
202
+ async extractNfcDataForC06(nfcResultJson) {
203
+ this.validateSDKReady();
204
+ try {
205
+ console.log('๐Ÿ” Extracting NFC data for C06...');
206
+ // Note: This method needs to be implemented in the native module
207
+ console.log('โœ… NFC data extraction completed');
208
+ return { success: true, data: nfcResultJson };
209
+ }
210
+ catch (error) {
211
+ console.error('โŒ NFC data extraction failed:', error);
212
+ throw error;
213
+ }
214
+ }
215
+ /**
216
+ * Handle app lifecycle - Resume
217
+ */
218
+ onResume() {
219
+ this.sdk.onResume();
220
+ console.log('๐Ÿ“ฑ App resumed');
221
+ }
222
+ /**
223
+ * Handle app lifecycle - Pause
224
+ */
225
+ onPause() {
226
+ this.sdk.onPause();
227
+ console.log('๐Ÿ“ฑ App paused');
228
+ }
229
+ /**
230
+ * Handle new intent (Android)
231
+ */
232
+ handleNewIntent() {
233
+ // Note: This method needs to be implemented in the native module
234
+ console.log('๐Ÿ“ฑ New intent handled');
235
+ }
236
+ // Event Listeners
237
+ /**
238
+ * Listen for NFC scan start events
239
+ */
240
+ onNfcScanStart(callback) {
241
+ return this.sdk.onNfcScanStart(callback);
242
+ }
243
+ /**
244
+ * Listen for NFC scan success events
245
+ */
246
+ onNfcScanSuccess(callback) {
247
+ return this.sdk.onNfcScanSuccess(callback);
248
+ }
249
+ /**
250
+ * Listen for NFC error events
251
+ */
252
+ onNfcError(callback) {
253
+ return this.sdk.onNfcError(callback);
254
+ }
255
+ /**
256
+ * Listen for C06 success events
257
+ */
258
+ onC06Success(callback) {
259
+ return this.sdk.onC06Success(callback);
260
+ }
261
+ /**
262
+ * Listen for C06 error events
263
+ */
264
+ onC06Error(callback) {
265
+ return this.sdk.onC06Error(callback);
266
+ }
267
+ /**
268
+ * Listen for OCR success events
269
+ */
270
+ onOCRSuccess(callback) {
271
+ return this.sdk.onOcrSuccess(callback);
272
+ }
273
+ /**
274
+ * Listen for OCR error events
275
+ */
276
+ onOCRError(callback) {
277
+ return this.sdk.onOcrError(callback);
278
+ }
279
+ /**
280
+ * Listen for liveness success events
281
+ */
282
+ onLivenessSuccess(callback) {
283
+ return this.sdk.onLivenessSuccess(callback);
284
+ }
285
+ /**
286
+ * Listen for liveness error events
287
+ */
288
+ onLivenessError(callback) {
289
+ return this.sdk.onLivenessError(callback);
290
+ }
291
+ /**
292
+ * Listen for face compare success events
293
+ */
294
+ onFaceCompareSuccess(callback) {
295
+ return this.sdk.onFaceCompareSuccess(callback);
296
+ }
297
+ /**
298
+ * Listen for face compare error events
299
+ */
300
+ onFaceCompareError(callback) {
301
+ return this.sdk.onFaceCompareError(callback);
302
+ }
303
+ /**
304
+ * Remove all event listeners
305
+ */
306
+ removeAllListeners() {
307
+ this.sdk.removeAllListeners();
308
+ console.log('๐Ÿงน All event listeners removed');
309
+ }
310
+ /**
311
+ * Start eKYC UI with flow (like MainActivity.kt)
312
+ * @param appKey Main app key
313
+ * @param flowSDK Array of SDK types
314
+ * @param language Language code (vi/en)
315
+ * @param transactionId Transaction ID
316
+ * @param optionConfig Optional configuration settings
317
+ * @param appKeyConfig Optional app key configuration
318
+ * @param styleConfig Optional style configuration
319
+ */
320
+ async startEkycUI(appKey, flowSDK, language, transactionId, appKeyConfig, optionConfig, styleConfig) {
321
+ this.validateSDKReady();
322
+ try {
323
+ console.log('๐Ÿš€ Starting eKYC UI with flow:', flowSDK);
324
+ console.log('๐Ÿ”ง OptionConfig:', optionConfig);
325
+ console.log('๐Ÿ”‘ AppKeyConfig:', appKeyConfig);
326
+ console.log('๐ŸŽจ StyleConfig:', styleConfig);
327
+ const result = await this.sdk.startEkycUI(appKey, flowSDK, language, transactionId, appKeyConfig, optionConfig, styleConfig);
328
+ console.log('โœ… eKYC UI started successfully');
329
+ return result;
330
+ }
331
+ catch (error) {
332
+ console.error('โŒ eKYC UI failed:', error);
333
+ throw error;
334
+ }
335
+ }
336
+ // Private validation methods
337
+ validateSDKReady() {
338
+ if (!this.isSDKReady()) {
339
+ throw new Error('SDK is not initialized. Please call initialize() first.');
340
+ }
341
+ }
342
+ validatePlatform(requiredPlatform, message) {
343
+ if (this.platform !== requiredPlatform) {
344
+ throw new Error(message);
345
+ }
346
+ }
347
+ }
348
+ exports.FinosEKYCModule = FinosEKYCModule;
349
+ // Export singleton instance
350
+ exports.FinosEKYC = FinosEKYCModule.getInstance();
351
+ // Default export
352
+ exports.default = exports.FinosEKYC;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos_sdk/sdk-ekyc",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "description": "React Native SDK for eKYC (electronic Know Your Customer) - Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, and C06 residence verification",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -43,7 +43,7 @@
43
43
  "typescript"
44
44
  ],
45
45
  "scripts": {
46
- "android": "react-native run-android",
46
+ "android": "npx react-native run-android",
47
47
  "ios": "react-native run-ios",
48
48
  "start": "react-native start --reset-cache",
49
49
  "clean": "cd android && ./gradlew clean && cd ..",