@finos_sdk/sdk-ekyc 0.0.28 → 0.0.29

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.
@@ -21,6 +21,12 @@ declare class SDKeKYC {
21
21
  onNfcError(callback: (error: NfcError) => void): EmitterSubscription | null;
22
22
  onC06Success(callback: (data: SDKEkycResultWithEvent) => void): EmitterSubscription | null;
23
23
  onC06Error(callback: (error: NfcError) => void): EmitterSubscription | null;
24
+ onOcrSuccess(callback: (data: SDKEkycResultStringWithEvent) => void): EmitterSubscription | null;
25
+ onOcrError(callback: (error: any) => void): EmitterSubscription | null;
26
+ onLivenessSuccess(callback: (data: SDKEkycResultStringWithEvent) => void): EmitterSubscription | null;
27
+ onLivenessError(callback: (error: any) => void): EmitterSubscription | null;
28
+ onFaceCompareSuccess(callback: (data: SDKEkycResultWithEvent) => void): EmitterSubscription | null;
29
+ onFaceCompareError(callback: (error: any) => void): EmitterSubscription | null;
24
30
  removeAllListeners(): void;
25
31
  }
26
32
  declare const sdkEKYC: SDKeKYC;
@@ -37,8 +37,8 @@ class SDKeKYC {
37
37
  }
38
38
  // Check C06 residence verification
39
39
  async checkC06(config) {
40
- return EKYCNativeModule.checkC06(config.appKey, config.sod, config.idCardNumber, config.recentLocation, undefined // transactionId is optional
41
- );
40
+ var _a, _b;
41
+ return EKYCNativeModule.checkC06(config.appKey, config.sod, config.idCardNumber, (_a = config.recentLocation) !== null && _a !== void 0 ? _a : '', (_b = config.transactionId) !== null && _b !== void 0 ? _b : '');
42
42
  }
43
43
  async startLiveness(config) {
44
44
  var _a;
@@ -91,6 +91,49 @@ class SDKeKYC {
91
91
  this.listeners.push(listener);
92
92
  return listener;
93
93
  }
94
+ // Additional listeners (native emits these):
95
+ onOcrSuccess(callback) {
96
+ if (!this.eventEmitter)
97
+ return null;
98
+ const listener = this.eventEmitter.addListener('onOcrSuccess', callback);
99
+ this.listeners.push(listener);
100
+ return listener;
101
+ }
102
+ onOcrError(callback) {
103
+ if (!this.eventEmitter)
104
+ return null;
105
+ const listener = this.eventEmitter.addListener('onOcrError', callback);
106
+ this.listeners.push(listener);
107
+ return listener;
108
+ }
109
+ onLivenessSuccess(callback) {
110
+ if (!this.eventEmitter)
111
+ return null;
112
+ const listener = this.eventEmitter.addListener('onLivenessSuccess', callback);
113
+ this.listeners.push(listener);
114
+ return listener;
115
+ }
116
+ onLivenessError(callback) {
117
+ if (!this.eventEmitter)
118
+ return null;
119
+ const listener = this.eventEmitter.addListener('onLivenessError', callback);
120
+ this.listeners.push(listener);
121
+ return listener;
122
+ }
123
+ onFaceCompareSuccess(callback) {
124
+ if (!this.eventEmitter)
125
+ return null;
126
+ const listener = this.eventEmitter.addListener('onFaceCompareSuccess', callback);
127
+ this.listeners.push(listener);
128
+ return listener;
129
+ }
130
+ onFaceCompareError(callback) {
131
+ if (!this.eventEmitter)
132
+ return null;
133
+ const listener = this.eventEmitter.addListener('onFaceCompareError', callback);
134
+ this.listeners.push(listener);
135
+ return listener;
136
+ }
94
137
  removeAllListeners() {
95
138
  this.listeners.forEach(listener => listener.remove());
96
139
  this.listeners = [];
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- export { default as sdkEKYC, SDKeKYC } from './EKYCModule';
1
+ import sdkEKYC, { SDKeKYC } from './EKYCModule';
2
+ export default sdkEKYC;
3
+ export { sdkEKYC, SDKeKYC };
2
4
  export type { NfcConfig, NFCData } from './src/types/ekycNFCType';
3
5
  export type { C06Config } from './src/types/ekycC06Type';
4
6
  export { parseNfcResponse } from './src/utils/utils';
package/dist/index.js CHANGED
@@ -1,11 +1,32 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.parseNfcResponse = exports.SDKeKYC = exports.sdkEKYC = void 0;
7
- var EKYCModule_1 = require("./EKYCModule");
8
- Object.defineProperty(exports, "sdkEKYC", { enumerable: true, get: function () { return __importDefault(EKYCModule_1).default; } });
27
+ const EKYCModule_1 = __importStar(require("./EKYCModule"));
28
+ exports.sdkEKYC = EKYCModule_1.default;
9
29
  Object.defineProperty(exports, "SDKeKYC", { enumerable: true, get: function () { return EKYCModule_1.SDKeKYC; } });
30
+ exports.default = EKYCModule_1.default;
10
31
  var utils_1 = require("./src/utils/utils");
11
32
  Object.defineProperty(exports, "parseNfcResponse", { enumerable: true, get: function () { return utils_1.parseNfcResponse; } });
@@ -12,6 +12,7 @@ export interface C06Config {
12
12
  appKey: string;
13
13
  sod: string;
14
14
  idCardNumber: string;
15
- recentLocation: string;
15
+ recentLocation?: string;
16
+ transactionId?: string;
16
17
  deviceType?: string;
17
18
  }
@@ -0,0 +1,34 @@
1
+ import type { EmitterSubscription } from 'react-native';
2
+ export type NfcConfig = {
3
+ appKey: string;
4
+ documentNumber: string;
5
+ birthDate: string;
6
+ expireDate: string;
7
+ transactionId?: string;
8
+ facePathStorage?: string;
9
+ };
10
+ export type NFCData = {
11
+ cardNumber?: string;
12
+ address?: string;
13
+ nfcInfo: {
14
+ sod?: string;
15
+ };
16
+ };
17
+ export type C06Config = {
18
+ appKey: string;
19
+ sod: string;
20
+ idCardNumber: string;
21
+ recentLocation?: string;
22
+ deviceType?: string;
23
+ transactionId?: string;
24
+ };
25
+ export interface SDKeKYC {
26
+ startNfcScan(cfg: NfcConfig): Promise<any>;
27
+ checkC06(cfg: C06Config): Promise<any>;
28
+ onNfcScanStart(cb: (e: any) => void): EmitterSubscription | null;
29
+ onNfcScanSuccess(cb: (e: any) => void): EmitterSubscription | null;
30
+ onNfcError(cb: (e: any) => void): EmitterSubscription | null;
31
+ onC06Success(cb: (e: any) => void): EmitterSubscription | null;
32
+ onC06Error(cb: (e: any) => void): EmitterSubscription | null;
33
+ removeAllListeners(): void;
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos_sdk/sdk-ekyc",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "SDK React Native EKYC",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,6 +14,7 @@ export interface C06Config {
14
14
  appKey: string;
15
15
  sod: string;
16
16
  idCardNumber: string;
17
- recentLocation: string;
17
+ recentLocation?: string;
18
+ transactionId?: string;
18
19
  deviceType?: string;
19
20
  }
@@ -0,0 +1,36 @@
1
+ import type { EmitterSubscription } from 'react-native';
2
+
3
+ export type NfcConfig = {
4
+ appKey: string;
5
+ documentNumber: string;
6
+ birthDate: string;
7
+ expireDate: string;
8
+ transactionId?: string;
9
+ facePathStorage?: string;
10
+ };
11
+
12
+ export type NFCData = {
13
+ cardNumber?: string;
14
+ address?: string;
15
+ nfcInfo: { sod?: string };
16
+ };
17
+
18
+ export type C06Config = {
19
+ appKey: string;
20
+ sod: string;
21
+ idCardNumber: string;
22
+ recentLocation?: string;
23
+ deviceType?: string;
24
+ transactionId?: string;
25
+ };
26
+
27
+ export interface SDKeKYC {
28
+ startNfcScan(cfg: NfcConfig): Promise<any>;
29
+ checkC06(cfg: C06Config): Promise<any>;
30
+ onNfcScanStart(cb: (e: any) => void): EmitterSubscription | null;
31
+ onNfcScanSuccess(cb: (e: any) => void): EmitterSubscription | null;
32
+ onNfcError(cb: (e: any) => void): EmitterSubscription | null;
33
+ onC06Success(cb: (e: any) => void): EmitterSubscription | null;
34
+ onC06Error(cb: (e: any) => void): EmitterSubscription | null;
35
+ removeAllListeners(): void;
36
+ }