@finos_sdk/sdk-ekyc 1.3.9 → 1.3.10
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.
- package/android/src/main/java/finos/sdk/ekyc/EKYCModule.kt +169 -27
- package/dist/EKYCModule.d.ts +3 -5
- package/dist/EKYCModule.js +1 -15
- package/dist/index.d.ts +1 -1
- package/dist/package.json +2 -1
- package/dist/src/modules/FinosEKYCModule.d.ts +3 -4
- package/dist/src/modules/FinosEKYCModule.js +1 -0
- package/dist/src/modules/FinosESignModule.d.ts +5 -7
- package/dist/src/modules/FinosESignModule.js +2 -0
- package/dist/src/types/ekycESignType.d.ts +13 -0
- package/package.json +2 -1
- package/src/modules/FinosEKYCModule.ts +3 -2
- package/src/modules/FinosESignModule.ts +5 -3
- package/src/types/ekycESignType.ts +15 -0
|
@@ -1848,12 +1848,49 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1848
1848
|
Log.d(TAG, "✅ signPdfMultiplePositions() callbackSuccess - rawResponse: $rawResponse")
|
|
1849
1849
|
Log.d(TAG, " 📦 Response length: ${rawResponse.length}")
|
|
1850
1850
|
|
|
1851
|
-
//
|
|
1852
|
-
|
|
1853
|
-
|
|
1851
|
+
// Parse JSON response và trả về object thay vì string
|
|
1852
|
+
try {
|
|
1853
|
+
val jsonObject = org.json.JSONObject(rawResponse)
|
|
1854
|
+
val promiseMap = Arguments.createMap().apply {
|
|
1855
|
+
putInt("status", jsonObject.optInt("status", 0))
|
|
1856
|
+
putString("msg", jsonObject.optString("msg", ""))
|
|
1857
|
+
|
|
1858
|
+
// Parse data object nếu có
|
|
1859
|
+
if (jsonObject.has("data") && !jsonObject.isNull("data")) {
|
|
1860
|
+
val dataJson = jsonObject.getJSONObject("data")
|
|
1861
|
+
val dataMap = Arguments.createMap().apply {
|
|
1862
|
+
putString("transactionId", dataJson.optString("transactionId", ""))
|
|
1863
|
+
val keys = dataJson.keys()
|
|
1864
|
+
while (keys.hasNext()) {
|
|
1865
|
+
val key = keys.next()
|
|
1866
|
+
if (key != "transactionId") {
|
|
1867
|
+
when (val value = dataJson.get(key)) {
|
|
1868
|
+
is String -> putString(key, value)
|
|
1869
|
+
is Int -> putInt(key, value)
|
|
1870
|
+
is Boolean -> putBoolean(key, value)
|
|
1871
|
+
is Double -> putDouble(key, value)
|
|
1872
|
+
else -> putString(key, value.toString())
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
putMap("data", dataMap)
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
val eventMap = Arguments.createMap().apply {
|
|
1882
|
+
putString("response", rawResponse)
|
|
1883
|
+
}
|
|
1884
|
+
sendEvent("onESignSignPdfMultiplePositionsSuccess", eventMap)
|
|
1885
|
+
promise.resolve(promiseMap)
|
|
1886
|
+
} catch (e: Exception) {
|
|
1887
|
+
Log.e(TAG, "❌ signPdfMultiplePositions() JSON parse error: ${e.message}")
|
|
1888
|
+
val (eventMap, promiseMap) = createSeparateMaps { map ->
|
|
1889
|
+
map.putString("response", rawResponse)
|
|
1890
|
+
}
|
|
1891
|
+
sendEvent("onESignSignPdfMultiplePositionsSuccess", eventMap)
|
|
1892
|
+
promise.resolve(promiseMap)
|
|
1854
1893
|
}
|
|
1855
|
-
sendEvent("onESignSignPdfMultiplePositionsSuccess", eventMap)
|
|
1856
|
-
promise.resolve(promiseMap)
|
|
1857
1894
|
},
|
|
1858
1895
|
callbackError = { event, error ->
|
|
1859
1896
|
val errorMessage = error.message ?: ""
|
|
@@ -1862,27 +1899,59 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1862
1899
|
Log.d(TAG, "🔍 signPdfMultiplePositions() callbackError - Code: $errorCode, Message: $errorMessage")
|
|
1863
1900
|
|
|
1864
1901
|
// Check if message contains "thành công" or code == "0" -> treat as success
|
|
1865
|
-
// NOTE: error.message có thể chứa full JSON response trong một số trường hợp
|
|
1866
1902
|
if (errorMessage.contains("thành công", ignoreCase = true) || errorCode == "0") {
|
|
1867
1903
|
Log.d(TAG, "✅ signPdfMultiplePositions() success (via error callback) - Message: $errorMessage")
|
|
1868
1904
|
|
|
1869
|
-
// Kiểm tra xem errorMessage có phải là JSON response đầy đủ không
|
|
1870
1905
|
val responseJson = if (errorMessage.trim().startsWith("{") && errorMessage.contains("\"data\"")) {
|
|
1871
|
-
// errorMessage chứa full JSON response
|
|
1872
1906
|
Log.d(TAG, " 📦 Using full JSON from errorMessage")
|
|
1873
1907
|
errorMessage
|
|
1874
1908
|
} else {
|
|
1875
|
-
// Tạo synthetic response (fallback)
|
|
1876
1909
|
Log.d(TAG, " ⚠️ Creating synthetic response (no data available)")
|
|
1877
1910
|
"{\"status\":0,\"msg\":\"$errorMessage\"}"
|
|
1878
1911
|
}
|
|
1879
1912
|
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1913
|
+
// Parse JSON và trả về object
|
|
1914
|
+
try {
|
|
1915
|
+
val jsonObject = org.json.JSONObject(responseJson)
|
|
1916
|
+
val promiseMap = Arguments.createMap().apply {
|
|
1917
|
+
putInt("status", jsonObject.optInt("status", 0))
|
|
1918
|
+
putString("msg", jsonObject.optString("msg", ""))
|
|
1919
|
+
|
|
1920
|
+
if (jsonObject.has("data") && !jsonObject.isNull("data")) {
|
|
1921
|
+
val dataJson = jsonObject.getJSONObject("data")
|
|
1922
|
+
val dataMap = Arguments.createMap().apply {
|
|
1923
|
+
putString("transactionId", dataJson.optString("transactionId", ""))
|
|
1924
|
+
val keys = dataJson.keys()
|
|
1925
|
+
while (keys.hasNext()) {
|
|
1926
|
+
val key = keys.next()
|
|
1927
|
+
if (key != "transactionId") {
|
|
1928
|
+
when (val value = dataJson.get(key)) {
|
|
1929
|
+
is String -> putString(key, value)
|
|
1930
|
+
is Int -> putInt(key, value)
|
|
1931
|
+
is Boolean -> putBoolean(key, value)
|
|
1932
|
+
is Double -> putDouble(key, value)
|
|
1933
|
+
else -> putString(key, value.toString())
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
putMap("data", dataMap)
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
val eventMap = Arguments.createMap().apply {
|
|
1943
|
+
putString("response", responseJson)
|
|
1944
|
+
}
|
|
1945
|
+
sendEvent("onESignSignPdfMultiplePositionsSuccess", eventMap)
|
|
1946
|
+
promise.resolve(promiseMap)
|
|
1947
|
+
} catch (e: Exception) {
|
|
1948
|
+
val (eventMap, promiseMap) = createSeparateMaps { map ->
|
|
1949
|
+
map.putString("response", responseJson)
|
|
1950
|
+
map.putString("message", errorMessage)
|
|
1951
|
+
}
|
|
1952
|
+
sendEvent("onESignSignPdfMultiplePositionsSuccess", eventMap)
|
|
1953
|
+
promise.resolve(promiseMap)
|
|
1883
1954
|
}
|
|
1884
|
-
sendEvent("onESignSignPdfMultiplePositionsSuccess", eventMap)
|
|
1885
|
-
promise.resolve(promiseMap)
|
|
1886
1955
|
} else {
|
|
1887
1956
|
Log.e(TAG, "❌ signPdfMultiplePositions() failed - Event: $event, Code: $errorCode, Message: $errorMessage")
|
|
1888
1957
|
val errorMap = Arguments.createMap().apply {
|
|
@@ -2006,12 +2075,52 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2006
2075
|
Log.d(TAG, "✅ signPdf() callbackSuccess - rawResponse: $rawResponse")
|
|
2007
2076
|
Log.d(TAG, " 📦 Response length: ${rawResponse.length}")
|
|
2008
2077
|
|
|
2009
|
-
//
|
|
2010
|
-
|
|
2011
|
-
|
|
2078
|
+
// Parse JSON response và trả về object thay vì string
|
|
2079
|
+
try {
|
|
2080
|
+
val jsonObject = org.json.JSONObject(rawResponse)
|
|
2081
|
+
val promiseMap = Arguments.createMap().apply {
|
|
2082
|
+
putInt("status", jsonObject.optInt("status", 0))
|
|
2083
|
+
putString("msg", jsonObject.optString("msg", ""))
|
|
2084
|
+
|
|
2085
|
+
// Parse data object nếu có
|
|
2086
|
+
if (jsonObject.has("data") && !jsonObject.isNull("data")) {
|
|
2087
|
+
val dataJson = jsonObject.getJSONObject("data")
|
|
2088
|
+
val dataMap = Arguments.createMap().apply {
|
|
2089
|
+
putString("transactionId", dataJson.optString("transactionId", ""))
|
|
2090
|
+
// Thêm các field khác nếu có
|
|
2091
|
+
val keys = dataJson.keys()
|
|
2092
|
+
while (keys.hasNext()) {
|
|
2093
|
+
val key = keys.next()
|
|
2094
|
+
if (key != "transactionId") {
|
|
2095
|
+
when (val value = dataJson.get(key)) {
|
|
2096
|
+
is String -> putString(key, value)
|
|
2097
|
+
is Int -> putInt(key, value)
|
|
2098
|
+
is Boolean -> putBoolean(key, value)
|
|
2099
|
+
is Double -> putDouble(key, value)
|
|
2100
|
+
else -> putString(key, value.toString())
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
putMap("data", dataMap)
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
// Event vẫn gửi raw response để backward compatible
|
|
2110
|
+
val eventMap = Arguments.createMap().apply {
|
|
2111
|
+
putString("response", rawResponse)
|
|
2112
|
+
}
|
|
2113
|
+
sendEvent("onESignSignPdfSuccess", eventMap)
|
|
2114
|
+
promise.resolve(promiseMap)
|
|
2115
|
+
} catch (e: Exception) {
|
|
2116
|
+
Log.e(TAG, "❌ signPdf() JSON parse error: ${e.message}")
|
|
2117
|
+
// Fallback: trả về raw response nếu không parse được
|
|
2118
|
+
val (eventMap, promiseMap) = createSeparateMaps { map ->
|
|
2119
|
+
map.putString("response", rawResponse)
|
|
2120
|
+
}
|
|
2121
|
+
sendEvent("onESignSignPdfSuccess", eventMap)
|
|
2122
|
+
promise.resolve(promiseMap)
|
|
2012
2123
|
}
|
|
2013
|
-
sendEvent("onESignSignPdfSuccess", eventMap)
|
|
2014
|
-
promise.resolve(promiseMap)
|
|
2015
2124
|
},
|
|
2016
2125
|
callbackError = { event, error ->
|
|
2017
2126
|
val errorMessage = error.message ?: ""
|
|
@@ -2020,27 +2129,60 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2020
2129
|
Log.d(TAG, "🔍 signPdf() callbackError - Code: $errorCode, Message: $errorMessage")
|
|
2021
2130
|
|
|
2022
2131
|
// Check if message contains "thành công" or code == "0" -> treat as success
|
|
2023
|
-
// NOTE: error.message có thể chứa full JSON response trong một số trường hợp
|
|
2024
2132
|
if (errorMessage.contains("thành công", ignoreCase = true) || errorCode == "0") {
|
|
2025
2133
|
Log.d(TAG, "✅ signPdf() success (via error callback) - Message: $errorMessage")
|
|
2026
2134
|
|
|
2027
2135
|
// Kiểm tra xem errorMessage có phải là JSON response đầy đủ không
|
|
2028
2136
|
val responseJson = if (errorMessage.trim().startsWith("{") && errorMessage.contains("\"data\"")) {
|
|
2029
|
-
// errorMessage chứa full JSON response
|
|
2030
2137
|
Log.d(TAG, " 📦 Using full JSON from errorMessage")
|
|
2031
2138
|
errorMessage
|
|
2032
2139
|
} else {
|
|
2033
|
-
// Tạo synthetic response (fallback)
|
|
2034
2140
|
Log.d(TAG, " ⚠️ Creating synthetic response (no data available)")
|
|
2035
2141
|
"{\"status\":0,\"msg\":\"$errorMessage\"}"
|
|
2036
2142
|
}
|
|
2037
2143
|
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2144
|
+
// Parse JSON và trả về object
|
|
2145
|
+
try {
|
|
2146
|
+
val jsonObject = org.json.JSONObject(responseJson)
|
|
2147
|
+
val promiseMap = Arguments.createMap().apply {
|
|
2148
|
+
putInt("status", jsonObject.optInt("status", 0))
|
|
2149
|
+
putString("msg", jsonObject.optString("msg", ""))
|
|
2150
|
+
|
|
2151
|
+
if (jsonObject.has("data") && !jsonObject.isNull("data")) {
|
|
2152
|
+
val dataJson = jsonObject.getJSONObject("data")
|
|
2153
|
+
val dataMap = Arguments.createMap().apply {
|
|
2154
|
+
putString("transactionId", dataJson.optString("transactionId", ""))
|
|
2155
|
+
val keys = dataJson.keys()
|
|
2156
|
+
while (keys.hasNext()) {
|
|
2157
|
+
val key = keys.next()
|
|
2158
|
+
if (key != "transactionId") {
|
|
2159
|
+
when (val value = dataJson.get(key)) {
|
|
2160
|
+
is String -> putString(key, value)
|
|
2161
|
+
is Int -> putInt(key, value)
|
|
2162
|
+
is Boolean -> putBoolean(key, value)
|
|
2163
|
+
is Double -> putDouble(key, value)
|
|
2164
|
+
else -> putString(key, value.toString())
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
putMap("data", dataMap)
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
val eventMap = Arguments.createMap().apply {
|
|
2174
|
+
putString("response", responseJson)
|
|
2175
|
+
}
|
|
2176
|
+
sendEvent("onESignSignPdfSuccess", eventMap)
|
|
2177
|
+
promise.resolve(promiseMap)
|
|
2178
|
+
} catch (e: Exception) {
|
|
2179
|
+
val (eventMap, promiseMap) = createSeparateMaps { map ->
|
|
2180
|
+
map.putString("response", responseJson)
|
|
2181
|
+
map.putString("message", errorMessage)
|
|
2182
|
+
}
|
|
2183
|
+
sendEvent("onESignSignPdfSuccess", eventMap)
|
|
2184
|
+
promise.resolve(promiseMap)
|
|
2041
2185
|
}
|
|
2042
|
-
sendEvent("onESignSignPdfSuccess", eventMap)
|
|
2043
|
-
promise.resolve(promiseMap)
|
|
2044
2186
|
} else {
|
|
2045
2187
|
Log.e(TAG, "❌ signPdf() failed - Event: $event, Code: $errorCode, Message: $errorMessage")
|
|
2046
2188
|
val errorMap = Arguments.createMap().apply {
|
package/dist/EKYCModule.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { OcrConfig } from './src/types/ekycOCRType';
|
|
|
6
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 { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, AuthorizeInfo } from './src/types/ekycESignType';
|
|
9
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, AuthorizeInfo, ESignPdfResult } 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 {
|
|
@@ -76,9 +76,7 @@ declare class SDKeKYC {
|
|
|
76
76
|
registerRemoteSigning(requestJson: string): Promise<{
|
|
77
77
|
response: string;
|
|
78
78
|
}>;
|
|
79
|
-
signPdf(requestJson: string): Promise<
|
|
80
|
-
response: string;
|
|
81
|
-
}>;
|
|
79
|
+
signPdf(requestJson: string): Promise<ESignPdfResult>;
|
|
82
80
|
sendConfirmationDocument(requestJson: string): Promise<{
|
|
83
81
|
response: string;
|
|
84
82
|
}>;
|
|
@@ -92,7 +90,7 @@ declare class SDKeKYC {
|
|
|
92
90
|
initAuthorize(serial: string, quantity: number, time: number, message: string): Promise<any>;
|
|
93
91
|
listAuthorize(pageNumber: number, pageSize: number, status: string): Promise<any>;
|
|
94
92
|
registerAuthorize(authId: string, authData: string, authorizeRequestId: string, userPin: string, confirm: boolean): Promise<any>;
|
|
95
|
-
signPdfMultiplePositions(requestJson: string): Promise<
|
|
93
|
+
signPdfMultiplePositions(requestJson: string): Promise<ESignPdfResult>;
|
|
96
94
|
onESignInitAuthorizeSuccess(callback: (data: {
|
|
97
95
|
code: string;
|
|
98
96
|
message: string;
|
package/dist/EKYCModule.js
CHANGED
|
@@ -665,25 +665,11 @@ class SDKeKYC {
|
|
|
665
665
|
console.log('📄 signPdf called with requestJson length:', (requestJson === null || requestJson === void 0 ? void 0 : requestJson.length) || 0);
|
|
666
666
|
const result = await nativeModule.signPdf(requestJson);
|
|
667
667
|
console.log('📄 signPdf result:', JSON.stringify(result));
|
|
668
|
-
//
|
|
668
|
+
// Native module now returns parsed JSON object with status, msg, data
|
|
669
669
|
if (!result) {
|
|
670
670
|
console.warn('⚠️ signPdf: result is null/undefined');
|
|
671
671
|
throw new Error('signPdf returned null/undefined result');
|
|
672
672
|
}
|
|
673
|
-
// Ensure response field exists
|
|
674
|
-
if (!result.response) {
|
|
675
|
-
console.warn('⚠️ signPdf: result.response is missing:', result);
|
|
676
|
-
// Try to create a valid response from what we have
|
|
677
|
-
// Check if result itself is a string
|
|
678
|
-
if (typeof result === 'string') {
|
|
679
|
-
return { response: result };
|
|
680
|
-
}
|
|
681
|
-
// Check if result has message field
|
|
682
|
-
if (result.message) {
|
|
683
|
-
return { response: result.message };
|
|
684
|
-
}
|
|
685
|
-
throw new Error('signPdf result missing response field');
|
|
686
|
-
}
|
|
687
673
|
return result;
|
|
688
674
|
}
|
|
689
675
|
catch (error) {
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type { LivenessError } from './src/types/ekycLivenessType';
|
|
|
20
20
|
export type { FaceCompareError } from './src/types/ekycFaceType';
|
|
21
21
|
export type { SDKTransactionResponse } from './src/types/ekycTransactionType';
|
|
22
22
|
export type { SmsOtpConfig, SmsOtpResult, SmsOtpError } from './src/types/ekycSmsOtpType';
|
|
23
|
-
export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult, UserEsignModel, AuthorizeInfo, } from './src/types/ekycESignType';
|
|
23
|
+
export type { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult, UserEsignModel, AuthorizeInfo, ESignPdfResult, } from './src/types/ekycESignType';
|
|
24
24
|
export { AuthorizationStatus } from './src/types/ekycESignType';
|
|
25
25
|
export { parseNfcResponse } from './src/utils/utils';
|
|
26
26
|
export type { EKYCErrorResultLanguage, EKYCErrorResultLike } from './src/types/EKYCErrorResult';
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos_sdk/sdk-ekyc",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
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",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"scripts": {
|
|
45
45
|
"clear": "cd android && if [ -d \"../node_modules\" ]; then ./gradlew clean; else rm -rf build app/build; fi && cd .. && rm -rf node_modules && npm cache clean --force",
|
|
46
46
|
"npm-install": "npm install",
|
|
47
|
+
"npm-install-legacy": "npm install --legacy-peer-deps",
|
|
47
48
|
"build": "tsc && mkdir -p dist && cp package.json dist/",
|
|
48
49
|
"publish-sdk-local": "npm run build && npm pack",
|
|
49
50
|
"publish-sdk": "npm run build && npm publish --access public",
|
|
@@ -6,7 +6,7 @@ import { OcrConfig } from '../types/ekycOCRType';
|
|
|
6
6
|
import { LivenessConfig, SDKFaceDetectStatus } from '../types/ekycLivenessType';
|
|
7
7
|
import { FaceServiceConfig } from '../types/ekycFaceType';
|
|
8
8
|
import { SmsOtpConfig, SmsOtpResult } from '../types/ekycSmsOtpType';
|
|
9
|
-
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest } from '../types/ekycESignType';
|
|
9
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignPdfResult } from '../types/ekycESignType';
|
|
10
10
|
import { SDKFlowType } from '../types/ekycFlowType';
|
|
11
11
|
/**
|
|
12
12
|
* Finos eKYC SDK Module
|
|
@@ -241,10 +241,9 @@ export declare class FinosEKYCModule {
|
|
|
241
241
|
* Sign PDF document
|
|
242
242
|
* @param accessToken JWT access token
|
|
243
243
|
* @param requestJson JSON request body
|
|
244
|
+
* @returns ESignPdfResult with status, msg, and data.transactionId
|
|
244
245
|
*/
|
|
245
|
-
signPdf(requestJson: string): Promise<
|
|
246
|
-
response: string;
|
|
247
|
-
}>;
|
|
246
|
+
signPdf(requestJson: string): Promise<ESignPdfResult>;
|
|
248
247
|
/**
|
|
249
248
|
* Send confirmation document
|
|
250
249
|
* @param accessToken JWT access token
|
|
@@ -566,6 +566,7 @@ class FinosEKYCModule {
|
|
|
566
566
|
* Sign PDF document
|
|
567
567
|
* @param accessToken JWT access token
|
|
568
568
|
* @param requestJson JSON request body
|
|
569
|
+
* @returns ESignPdfResult with status, msg, and data.transactionId
|
|
569
570
|
*/
|
|
570
571
|
async signPdf(requestJson) {
|
|
571
572
|
this.validateSDKReady();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SDK_VERSION, SDK_NAME } from '../../EKYCModule';
|
|
2
2
|
import { SmsOtpConfig, SmsOtpResult } from '../types/ekycSmsOtpType';
|
|
3
|
-
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, AuthorizeInfo } from '../types/ekycESignType';
|
|
3
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, AuthorizeInfo, ESignPdfResult } from '../types/ekycESignType';
|
|
4
4
|
import { LivenessConfig } from '../types/ekycLivenessType';
|
|
5
5
|
import { FaceServiceConfig } from '../types/ekycFaceType';
|
|
6
6
|
import { SDKEkycResultStringWithEvent, SDKEkycResultWithEvent, EKYCError } from '../types/ekycType';
|
|
@@ -167,10 +167,9 @@ export declare class FinosESignModule {
|
|
|
167
167
|
/**
|
|
168
168
|
* Sign PDF Multiple Positions
|
|
169
169
|
* @param requestJson Request JSON
|
|
170
|
+
* @returns ESignPdfResult with status, msg, and data.transactionId
|
|
170
171
|
*/
|
|
171
|
-
signPdfMultiplePositions(requestJson: string): Promise<
|
|
172
|
-
response: string;
|
|
173
|
-
}>;
|
|
172
|
+
signPdfMultiplePositions(requestJson: string): Promise<ESignPdfResult>;
|
|
174
173
|
/**
|
|
175
174
|
* Register remote signing certificate
|
|
176
175
|
* @param requestJson JSON request body
|
|
@@ -181,10 +180,9 @@ export declare class FinosESignModule {
|
|
|
181
180
|
/**
|
|
182
181
|
* Sign PDF document
|
|
183
182
|
* @param requestJson JSON request body
|
|
183
|
+
* @returns ESignPdfResult with status, msg, and data.transactionId
|
|
184
184
|
*/
|
|
185
|
-
signPdf(requestJson: string): Promise<
|
|
186
|
-
response: string;
|
|
187
|
-
}>;
|
|
185
|
+
signPdf(requestJson: string): Promise<ESignPdfResult>;
|
|
188
186
|
/**
|
|
189
187
|
* Send confirmation document
|
|
190
188
|
* @param requestJson JSON string containing request data
|
|
@@ -292,6 +292,7 @@ class FinosESignModule {
|
|
|
292
292
|
/**
|
|
293
293
|
* Sign PDF Multiple Positions
|
|
294
294
|
* @param requestJson Request JSON
|
|
295
|
+
* @returns ESignPdfResult with status, msg, and data.transactionId
|
|
295
296
|
*/
|
|
296
297
|
async signPdfMultiplePositions(requestJson) {
|
|
297
298
|
this.validateSDKReady();
|
|
@@ -309,6 +310,7 @@ class FinosESignModule {
|
|
|
309
310
|
/**
|
|
310
311
|
* Sign PDF document
|
|
311
312
|
* @param requestJson JSON request body
|
|
313
|
+
* @returns ESignPdfResult with status, msg, and data.transactionId
|
|
312
314
|
*/
|
|
313
315
|
async signPdf(requestJson) {
|
|
314
316
|
this.validateSDKReady();
|
|
@@ -46,6 +46,19 @@ export interface ESignSignRequestConfirm {
|
|
|
46
46
|
authId?: string;
|
|
47
47
|
authData?: string;
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* eSign Sign PDF Result
|
|
51
|
+
* Response from signPdf and signPdfMultiplePositions
|
|
52
|
+
*/
|
|
53
|
+
export interface ESignPdfResult {
|
|
54
|
+
status: number;
|
|
55
|
+
msg: string;
|
|
56
|
+
data?: {
|
|
57
|
+
transactionId: string;
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
};
|
|
60
|
+
response?: string;
|
|
61
|
+
}
|
|
49
62
|
/** eSign error – dùng chung EKYCError (event, code, message). */
|
|
50
63
|
export type ESignError = import('./ekycType').EKYCError;
|
|
51
64
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos_sdk/sdk-ekyc",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
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",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"scripts": {
|
|
45
45
|
"clear": "cd android && if [ -d \"../node_modules\" ]; then ./gradlew clean; else rm -rf build app/build; fi && cd .. && rm -rf node_modules && npm cache clean --force",
|
|
46
46
|
"npm-install": "npm install",
|
|
47
|
+
"npm-install-legacy": "npm install --legacy-peer-deps",
|
|
47
48
|
"build": "tsc && mkdir -p dist && cp package.json dist/",
|
|
48
49
|
"publish-sdk-local": "npm run build && npm pack",
|
|
49
50
|
"publish-sdk": "npm run build && npm publish --access public",
|
|
@@ -7,7 +7,7 @@ import { OcrConfig, OcrError } from '../types/ekycOCRType';
|
|
|
7
7
|
import { LivenessConfig, SDKFaceDetectStatus, LivenessError } from '../types/ekycLivenessType';
|
|
8
8
|
import { FaceServiceConfig, FaceCompareError } from '../types/ekycFaceType';
|
|
9
9
|
import { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
10
|
-
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult } from '../types/ekycESignType';
|
|
10
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult, ESignPdfResult } from '../types/ekycESignType';
|
|
11
11
|
import { SDKFlowType, flowToStrings } from '../types/ekycFlowType';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -641,10 +641,11 @@ export class FinosEKYCModule {
|
|
|
641
641
|
* Sign PDF document
|
|
642
642
|
* @param accessToken JWT access token
|
|
643
643
|
* @param requestJson JSON request body
|
|
644
|
+
* @returns ESignPdfResult with status, msg, and data.transactionId
|
|
644
645
|
*/
|
|
645
646
|
public async signPdf(
|
|
646
647
|
requestJson: string
|
|
647
|
-
): Promise<
|
|
648
|
+
): Promise<ESignPdfResult> {
|
|
648
649
|
this.validateSDKReady();
|
|
649
650
|
|
|
650
651
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import sdkEKYC, { SDKeKYC, SDK_VERSION, SDK_NAME } from '../../EKYCModule';
|
|
3
3
|
import { SmsOtpConfig, SmsOtpResult, SmsOtpError } from '../types/ekycSmsOtpType';
|
|
4
|
-
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult, AuthorizeInfo } from '../types/ekycESignType';
|
|
4
|
+
import { ESignInitResult, ESignOpenSessionResult, ESignCertificate, ESignSignRequest, ESignError, ESignAuthenticateResult, AuthorizeInfo, ESignPdfResult } from '../types/ekycESignType';
|
|
5
5
|
import { LivenessConfig, LivenessError } from '../types/ekycLivenessType';
|
|
6
6
|
import { FaceServiceConfig, FaceCompareError } from '../types/ekycFaceType';
|
|
7
7
|
import { SDKEkycResultStringWithEvent, SDKEkycResultWithEvent, EKYCError, getEkycError } from '../types/ekycType';
|
|
@@ -352,10 +352,11 @@ export class FinosESignModule {
|
|
|
352
352
|
/**
|
|
353
353
|
* Sign PDF Multiple Positions
|
|
354
354
|
* @param requestJson Request JSON
|
|
355
|
+
* @returns ESignPdfResult with status, msg, and data.transactionId
|
|
355
356
|
*/
|
|
356
357
|
public async signPdfMultiplePositions(
|
|
357
358
|
requestJson: string
|
|
358
|
-
): Promise<
|
|
359
|
+
): Promise<ESignPdfResult> {
|
|
359
360
|
this.validateSDKReady();
|
|
360
361
|
return await this.sdk.signPdfMultiplePositions(requestJson);
|
|
361
362
|
}
|
|
@@ -375,10 +376,11 @@ export class FinosESignModule {
|
|
|
375
376
|
/**
|
|
376
377
|
* Sign PDF document
|
|
377
378
|
* @param requestJson JSON request body
|
|
379
|
+
* @returns ESignPdfResult with status, msg, and data.transactionId
|
|
378
380
|
*/
|
|
379
381
|
public async signPdf(
|
|
380
382
|
requestJson: string
|
|
381
|
-
): Promise<
|
|
383
|
+
): Promise<ESignPdfResult> {
|
|
382
384
|
this.validateSDKReady();
|
|
383
385
|
// Pass through to SDK - error handling is done in EKYCModule.ts
|
|
384
386
|
return await this.sdk.signPdf(requestJson);
|
|
@@ -54,6 +54,21 @@ export interface ESignSignRequestConfirm {
|
|
|
54
54
|
authData?: string;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* eSign Sign PDF Result
|
|
59
|
+
* Response from signPdf and signPdfMultiplePositions
|
|
60
|
+
*/
|
|
61
|
+
export interface ESignPdfResult {
|
|
62
|
+
status: number;
|
|
63
|
+
msg: string;
|
|
64
|
+
data?: {
|
|
65
|
+
transactionId: string;
|
|
66
|
+
[key: string]: any; // Cho phép các field động khác
|
|
67
|
+
};
|
|
68
|
+
// Fallback field khi không parse được JSON
|
|
69
|
+
response?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
57
72
|
/** eSign error – dùng chung EKYCError (event, code, message). */
|
|
58
73
|
export type ESignError = import('./ekycType').EKYCError;
|
|
59
74
|
|