@trustchex/react-native-sdk 1.478.7 → 1.483.4
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/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +57 -3
- package/ios/Camera/TrustchexCameraView.swift +20 -15
- package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +0 -3
- package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +21 -0
- package/lib/module/Screens/Dynamic/VideoCallScreen.js +1 -1
- package/lib/module/Screens/Static/ResultScreen.js +75 -16
- package/lib/module/Shared/Components/DiagnosticReportButton.js +64 -0
- package/lib/module/Shared/Components/EIDScanner.js +52 -19
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +132 -8
- package/lib/module/Shared/Components/NavigationManager.js +7 -9
- package/lib/module/Shared/Contexts/AppContext.js +3 -0
- package/lib/module/Shared/EIDReader/eidReader.js +167 -30
- package/lib/module/Shared/EIDReader/lds/icao/dg11File.js +77 -0
- package/lib/module/Shared/Libs/MRZ_KNOWN_ISSUES.md +7 -0
- package/lib/module/Shared/Libs/diagnosticReport.js +133 -0
- package/lib/module/Shared/Libs/diagnostics.js +171 -0
- package/lib/module/Shared/Libs/documentDataNormalizer.js +104 -0
- package/lib/module/Shared/Libs/mrz.utils.js +0 -5
- package/lib/module/Shared/Libs/mrzFrameAggregator.js +32 -5
- package/lib/module/Shared/Libs/mrzTransliteration.js +80 -0
- package/lib/module/Shared/Libs/native-device-info.utils.js +67 -0
- package/lib/module/Shared/Libs/sendDiagnosticReport.js +130 -0
- package/lib/module/Shared/Services/DataUploadService.js +6 -3
- package/lib/module/Shared/Types/documentData.js +1 -0
- package/lib/module/Shared/Types/documentReadResult.js +3 -0
- package/lib/module/Translation/Resources/en.js +5 -0
- package/lib/module/Translation/Resources/tr.js +5 -0
- package/lib/module/Trustchex.js +31 -4
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Dynamic/VideoCallScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/DiagnosticReportButton.d.ts +20 -0
- package/lib/typescript/src/Shared/Components/DiagnosticReportButton.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.types.d.ts +10 -0
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.types.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/NavigationManager.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts +10 -0
- package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Contexts/AppContext.d.ts +5 -0
- package/lib/typescript/src/Shared/Contexts/AppContext.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts +2 -0
- package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/lds/icao/dg11File.d.ts +35 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/dg11File.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/diagnosticReport.d.ts +48 -0
- package/lib/typescript/src/Shared/Libs/diagnosticReport.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/diagnostics.d.ts +145 -0
- package/lib/typescript/src/Shared/Libs/diagnostics.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/documentDataNormalizer.d.ts +12 -0
- package/lib/typescript/src/Shared/Libs/documentDataNormalizer.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/mrzFrameAggregator.d.ts +33 -0
- package/lib/typescript/src/Shared/Libs/mrzFrameAggregator.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/mrzTransliteration.d.ts +3 -0
- package/lib/typescript/src/Shared/Libs/mrzTransliteration.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts +33 -0
- package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/sendDiagnosticReport.d.ts +30 -0
- package/lib/typescript/src/Shared/Libs/sendDiagnosticReport.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Services/DataUploadService.d.ts +3 -2
- package/lib/typescript/src/Shared/Services/DataUploadService.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Types/documentData.d.ts +44 -0
- package/lib/typescript/src/Shared/Types/documentData.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Types/documentReadResult.d.ts +44 -0
- package/lib/typescript/src/Shared/Types/documentReadResult.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Types/mrzFields.d.ts +1 -1
- package/lib/typescript/src/Shared/Types/mrzFields.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/en.d.ts +5 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/tr.d.ts +5 -0
- package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
- package/lib/typescript/src/Trustchex.d.ts +9 -0
- package/lib/typescript/src/Trustchex.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +5 -1
- package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +0 -4
- package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +23 -0
- package/src/Screens/Dynamic/VideoCallScreen.tsx +5 -1
- package/src/Screens/Static/ResultScreen.tsx +85 -16
- package/src/Shared/Components/DiagnosticReportButton.tsx +77 -0
- package/src/Shared/Components/EIDScanner.tsx +67 -18
- package/src/Shared/Components/IdentityDocumentCamera.tsx +145 -7
- package/src/Shared/Components/IdentityDocumentCamera.types.ts +6 -0
- package/src/Shared/Components/NavigationManager.tsx +7 -7
- package/src/Shared/Components/TrustchexCamera.tsx +6 -0
- package/src/Shared/Contexts/AppContext.ts +8 -0
- package/src/Shared/EIDReader/eidReader.ts +193 -47
- package/src/Shared/EIDReader/lds/icao/dg11File.ts +94 -0
- package/src/Shared/Libs/MRZ_KNOWN_ISSUES.md +7 -0
- package/src/Shared/Libs/diagnosticReport.ts +206 -0
- package/src/Shared/Libs/diagnostics.ts +251 -0
- package/src/Shared/Libs/documentDataNormalizer.ts +108 -0
- package/src/Shared/Libs/mrz.utils.ts +0 -5
- package/src/Shared/Libs/mrzFrameAggregator.ts +61 -3
- package/src/Shared/Libs/mrzTransliteration.ts +131 -0
- package/src/Shared/Libs/native-device-info.utils.ts +116 -0
- package/src/Shared/Libs/sendDiagnosticReport.ts +165 -0
- package/src/Shared/Services/DataUploadService.ts +9 -3
- package/src/Shared/Types/documentData.ts +52 -0
- package/src/Shared/Types/documentReadResult.ts +47 -0
- package/src/Shared/Types/mrzFields.ts +0 -5
- package/src/Translation/Resources/en.ts +6 -0
- package/src/Translation/Resources/tr.ts +6 -0
- package/src/Trustchex.tsx +48 -3
- package/src/index.tsx +7 -0
- package/src/version.ts +1 -1
|
@@ -2,6 +2,73 @@
|
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import DeviceInfo from 'react-native-device-info';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Full, non-PII device details for the support diagnostic report. Device-
|
|
8
|
+
* specific scanning/NFC issues correlate with hardware, OS level, memory and
|
|
9
|
+
* NFC capability, so we capture a broad-but-safe set. Excludes anything that
|
|
10
|
+
* identifies a person (uniqueId is a per-install vendor id, not PII, and is kept
|
|
11
|
+
* only for correlating repeat reports from the same device).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** Resolve an async getter to a number, tolerating failure. */
|
|
15
|
+
const num = async p => {
|
|
16
|
+
try {
|
|
17
|
+
const v = await p;
|
|
18
|
+
return typeof v === 'number' && isFinite(v) ? v : undefined;
|
|
19
|
+
} catch {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** Resolve an async getter, falling back on failure. */
|
|
25
|
+
const safe = async (p, fallback) => {
|
|
26
|
+
try {
|
|
27
|
+
return await p;
|
|
28
|
+
} catch {
|
|
29
|
+
return fallback;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** Read a synchronous getter, tolerating failure. */
|
|
34
|
+
const sync = (fn, fallback) => {
|
|
35
|
+
try {
|
|
36
|
+
return fn();
|
|
37
|
+
} catch {
|
|
38
|
+
return fallback;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** Gather the full non-PII device profile for a diagnostic report. */
|
|
43
|
+
export const gatherDeviceDetails = async () => {
|
|
44
|
+
const bytesToMB = b => b === undefined ? undefined : Math.round(b / (1024 * 1024));
|
|
45
|
+
const isAndroid = Platform.OS === 'android';
|
|
46
|
+
const [manufacturer, isEmulator, apiLevel, installerPackage, totalMemory, usedMemory, totalDisk, freeDisk, batteryLevel, fontScale] = await Promise.all([safe(DeviceInfo.getManufacturer(), 'unknown'), safe(DeviceInfo.isEmulator(), false), isAndroid ? num(DeviceInfo.getApiLevel()) : Promise.resolve(undefined), safe(DeviceInfo.getInstallerPackageName(), 'unknown'), num(DeviceInfo.getTotalMemory()), num(DeviceInfo.getUsedMemory()), num(DeviceInfo.getTotalDiskCapacity()), num(DeviceInfo.getFreeDiskStorage()), num(DeviceInfo.getBatteryLevel()), num(DeviceInfo.getFontScale())]);
|
|
47
|
+
return {
|
|
48
|
+
platform: Platform.OS,
|
|
49
|
+
systemName: isAndroid ? 'Android' : 'iOS',
|
|
50
|
+
systemVersion: sync(() => DeviceInfo.getSystemVersion(), 'unknown'),
|
|
51
|
+
apiLevel,
|
|
52
|
+
brand: sync(() => DeviceInfo.getBrand(), 'unknown'),
|
|
53
|
+
manufacturer,
|
|
54
|
+
model: sync(() => DeviceInfo.getModel(), 'unknown'),
|
|
55
|
+
deviceId: sync(() => DeviceInfo.getDeviceId(), 'unknown'),
|
|
56
|
+
deviceType: sync(() => DeviceInfo.getDeviceType(), 'unknown'),
|
|
57
|
+
isTablet: sync(() => DeviceInfo.isTablet(), false),
|
|
58
|
+
isEmulator,
|
|
59
|
+
hasNotch: sync(() => DeviceInfo.hasNotch(), false),
|
|
60
|
+
totalMemoryMB: bytesToMB(totalMemory),
|
|
61
|
+
usedMemoryMB: bytesToMB(usedMemory),
|
|
62
|
+
totalDiskMB: bytesToMB(totalDisk),
|
|
63
|
+
freeDiskMB: bytesToMB(freeDisk),
|
|
64
|
+
batteryLevel,
|
|
65
|
+
appVersion: sync(() => DeviceInfo.getVersion(), 'unknown'),
|
|
66
|
+
buildNumber: sync(() => DeviceInfo.getBuildNumber(), 'unknown'),
|
|
67
|
+
bundleId: sync(() => DeviceInfo.getBundleId(), 'unknown'),
|
|
68
|
+
fontScale,
|
|
69
|
+
installerPackage
|
|
70
|
+
};
|
|
71
|
+
};
|
|
5
72
|
export const NativeDeviceInfo = {
|
|
6
73
|
generateHumanReadableIdentifier: async () => {
|
|
7
74
|
try {
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Assembles and shares the support diagnostic report.
|
|
5
|
+
*
|
|
6
|
+
* `react-native-share` is an OPTIONAL dependency: the host app opts into the
|
|
7
|
+
* diagnostic feature by installing it. When it's present we open the OS share
|
|
8
|
+
* sheet with the full report (the user picks email / WhatsApp / Drive / etc. and
|
|
9
|
+
* reviews before sending); when it's absent the feature is silently unavailable
|
|
10
|
+
* — `isDiagnosticSharingAvailable()` returns false and the result-screen button
|
|
11
|
+
* renders nothing, so apps that don't want it incur no dependency.
|
|
12
|
+
*
|
|
13
|
+
* Attached files (staged to a temp dir via react-native-fs, already an SDK dep):
|
|
14
|
+
* - `diagnostics.json` — technical signals (device, camera, MRZ, NFC steps),
|
|
15
|
+
* - `scan-data.json` — the scanned identity data (PII; user reviews it),
|
|
16
|
+
* - the captured document/face images.
|
|
17
|
+
*
|
|
18
|
+
* The readable summary rides as the share `message` so it's visible in the
|
|
19
|
+
* draft regardless of the chosen app.
|
|
20
|
+
*/
|
|
21
|
+
import RNFS from 'react-native-fs';
|
|
22
|
+
import { diagnostics } from "./diagnostics.js";
|
|
23
|
+
import { gatherDeviceDetails } from "./native-device-info.utils.js";
|
|
24
|
+
import { buildDiagnosticReport } from "./diagnosticReport.js";
|
|
25
|
+
import { logError } from "./debug.utils.js";
|
|
26
|
+
|
|
27
|
+
// `react-native-share` is OPTIONAL. Load it softly so the SDK bundles and runs
|
|
28
|
+
// without it; only host apps that installed it get the diagnostic feature. A
|
|
29
|
+
// static `import` would make Metro fail to resolve the module when it's absent,
|
|
30
|
+
// so we use a guarded require and keep the reference typed loosely.
|
|
31
|
+
|
|
32
|
+
let shareModule;
|
|
33
|
+
const loadShare = () => {
|
|
34
|
+
if (shareModule !== undefined) return shareModule;
|
|
35
|
+
try {
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
37
|
+
const mod = require('react-native-share');
|
|
38
|
+
shareModule = mod?.default ?? mod;
|
|
39
|
+
} catch {
|
|
40
|
+
shareModule = null; // not installed — feature unavailable
|
|
41
|
+
}
|
|
42
|
+
return shareModule;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Whether diagnostic sharing is available (i.e. `react-native-share` is
|
|
47
|
+
* installed in the host app). The result-screen button hides itself when false.
|
|
48
|
+
*/
|
|
49
|
+
export const isDiagnosticSharingAvailable = () => loadShare() != null;
|
|
50
|
+
const writeTemp = async (dir, name, data, encoding) => {
|
|
51
|
+
const path = `${dir}/${name}`;
|
|
52
|
+
await RNFS.writeFile(path, data, encoding);
|
|
53
|
+
return path.startsWith('file://') ? path : `file://${path}`;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Build the report, stage attachments, and present the share sheet. Returns
|
|
57
|
+
* { shared } — false on error, with `dismissed` set when the user cancelled.
|
|
58
|
+
*/
|
|
59
|
+
export const sendDiagnosticReport = async params => {
|
|
60
|
+
const share = loadShare();
|
|
61
|
+
if (!share) {
|
|
62
|
+
// Optional dependency not installed — nothing to do.
|
|
63
|
+
return {
|
|
64
|
+
shared: false
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const {
|
|
68
|
+
scan,
|
|
69
|
+
sdkVersion,
|
|
70
|
+
sessionId,
|
|
71
|
+
images = []
|
|
72
|
+
} = params;
|
|
73
|
+
const now = Date.now();
|
|
74
|
+
const iso = new Date(now).toISOString();
|
|
75
|
+
const device = await gatherDeviceDetails();
|
|
76
|
+
const report = buildDiagnosticReport({
|
|
77
|
+
diag: diagnostics.snapshot(now, iso),
|
|
78
|
+
device,
|
|
79
|
+
scan,
|
|
80
|
+
sdkVersion,
|
|
81
|
+
sessionId
|
|
82
|
+
});
|
|
83
|
+
const dir = `${RNFS.TemporaryDirectoryPath}/trustchex-diagnostics-${now}`;
|
|
84
|
+
try {
|
|
85
|
+
await RNFS.mkdir(dir);
|
|
86
|
+
const urls = [];
|
|
87
|
+
urls.push(await writeTemp(dir, 'diagnostics.json', report.diagnosticsJson, 'utf8'));
|
|
88
|
+
urls.push(await writeTemp(dir, 'scan-data.json', report.scanDataJson, 'utf8'));
|
|
89
|
+
for (const img of images) {
|
|
90
|
+
if (!img.base64) continue;
|
|
91
|
+
urls.push(await writeTemp(dir, `${img.name}.${img.mime}`, img.base64, 'base64'));
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
await share.open({
|
|
95
|
+
title: report.subject,
|
|
96
|
+
subject: report.subject,
|
|
97
|
+
// used by email targets
|
|
98
|
+
message: report.body,
|
|
99
|
+
urls,
|
|
100
|
+
// Per-file MIME types so targets render attachments correctly.
|
|
101
|
+
filenames: urls.map(u => u.split('/').pop() ?? 'attachment'),
|
|
102
|
+
failOnCancel: false
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
shared: true
|
|
106
|
+
};
|
|
107
|
+
} catch (shareErr) {
|
|
108
|
+
// react-native-share throws on user cancel unless failOnCancel:false; treat
|
|
109
|
+
// a cancel as a non-error dismissal.
|
|
110
|
+
const msg = shareErr instanceof Error ? shareErr.message : String(shareErr);
|
|
111
|
+
if (/cancel|dismiss|user did not share/i.test(msg)) {
|
|
112
|
+
return {
|
|
113
|
+
shared: false,
|
|
114
|
+
dismissed: true
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
throw shareErr;
|
|
118
|
+
}
|
|
119
|
+
} catch (e) {
|
|
120
|
+
logError('Diagnostics', 'Failed to share diagnostic report', e instanceof Error ? e.message : String(e));
|
|
121
|
+
return {
|
|
122
|
+
shared: false
|
|
123
|
+
};
|
|
124
|
+
} finally {
|
|
125
|
+
// Best-effort cleanup — temp files are short-lived.
|
|
126
|
+
setTimeout(() => {
|
|
127
|
+
RNFS.unlink(dir).catch(() => {});
|
|
128
|
+
}, 60_000);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
@@ -27,7 +27,7 @@ export class DataUploadService {
|
|
|
27
27
|
/**
|
|
28
28
|
* Submit document data to the backend (same approach as ResultScreen)
|
|
29
29
|
*/
|
|
30
|
-
async submitDocumentData(identificationId, scannedDocument, sessionKey) {
|
|
30
|
+
async submitDocumentData(identificationId, scannedDocument, sessionKey, documentName) {
|
|
31
31
|
if (!scannedDocument || scannedDocument.documentType === 'UNKNOWN') {
|
|
32
32
|
debugLog('DataUploadService', 'No document data to submit');
|
|
33
33
|
return;
|
|
@@ -41,6 +41,9 @@ export class DataUploadService {
|
|
|
41
41
|
type: mrzFields.documentCode,
|
|
42
42
|
name: mrzFields.firstName,
|
|
43
43
|
surname: mrzFields.lastName,
|
|
44
|
+
displayName: documentName?.source === 'dg11' ? documentName.displayFirst : undefined,
|
|
45
|
+
displaySurname: documentName?.source === 'dg11' ? documentName.displayLast : undefined,
|
|
46
|
+
nameSource: documentName?.source === 'dg11' ? documentName.source : undefined,
|
|
44
47
|
gender: this.getGenderEnumType(mrzFields.sex),
|
|
45
48
|
number: mrzFields.documentNumber,
|
|
46
49
|
country: mrzFields.issuingState,
|
|
@@ -193,7 +196,7 @@ export class DataUploadService {
|
|
|
193
196
|
/**
|
|
194
197
|
* Upload all collected data (document + media) before video call
|
|
195
198
|
*/
|
|
196
|
-
async uploadCollectedData(identificationInfo, onProgress) {
|
|
199
|
+
async uploadCollectedData(identificationInfo, onProgress, documentName) {
|
|
197
200
|
const {
|
|
198
201
|
identificationId,
|
|
199
202
|
sessionId,
|
|
@@ -239,7 +242,7 @@ export class DataUploadService {
|
|
|
239
242
|
// Step 1: Submit document data (using same encryption as ResultScreen)
|
|
240
243
|
if (scannedDocument) {
|
|
241
244
|
onProgress?.(0.1);
|
|
242
|
-
await runWithRetry(() => this.submitDocumentData(identificationId, scannedDocument, authToken));
|
|
245
|
+
await runWithRetry(() => this.submitDocumentData(identificationId, scannedDocument, authToken, documentName));
|
|
243
246
|
onProgress?.(0.3);
|
|
244
247
|
}
|
|
245
248
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -45,6 +45,11 @@ export default {
|
|
|
45
45
|
'resultScreen.demoVerbalConsentTitle': 'Title',
|
|
46
46
|
'resultScreen.demoVerbalConsentText': 'Text',
|
|
47
47
|
'resultScreen.demoStartOver': 'Start Over',
|
|
48
|
+
'diagnosticReport.button': 'Report a scanning issue',
|
|
49
|
+
'diagnosticReport.noticeTitle': 'Share diagnostic report',
|
|
50
|
+
'diagnosticReport.noticeBody': 'This opens a draft with your scan data, document images and technical details so support can help resolve a scanning issue. Review it before sending.',
|
|
51
|
+
'diagnosticReport.continue': 'Continue',
|
|
52
|
+
'diagnosticReport.cancel': 'Cancel',
|
|
48
53
|
'livenessDetectionScreen.guideHeader': 'Face Verification',
|
|
49
54
|
'livenessDetectionScreen.guideText': 'Please ensure the following for best results:',
|
|
50
55
|
'livenessDetectionScreen.guidePoint1': 'Remove glasses, hats, or face coverings',
|
|
@@ -45,6 +45,11 @@ export default {
|
|
|
45
45
|
'resultScreen.demoVerbalConsentTitle': 'Başlık',
|
|
46
46
|
'resultScreen.demoVerbalConsentText': 'Metin',
|
|
47
47
|
'resultScreen.demoStartOver': 'Baştan Başla',
|
|
48
|
+
'diagnosticReport.button': 'Tarama sorununu bildir',
|
|
49
|
+
'diagnosticReport.noticeTitle': 'Tanılama raporu paylaş',
|
|
50
|
+
'diagnosticReport.noticeBody': 'Bu işlem; tarama verilerinizi, belge görüntülerinizi ve teknik ayrıntıları içeren bir taslak açar; böylece destek ekibi tarama sorununu çözebilir. Göndermeden önce gözden geçirin.',
|
|
51
|
+
'diagnosticReport.continue': 'Devam et',
|
|
52
|
+
'diagnosticReport.cancel': 'İptal',
|
|
48
53
|
'livenessDetectionScreen.guideHeader': 'Yüz Doğrulaması',
|
|
49
54
|
'livenessDetectionScreen.guideText': 'En iyi sonuç için lütfen şunları sağlayın:',
|
|
50
55
|
'livenessDetectionScreen.guidePoint1': 'Gözlük, şapka veya yüz aksesuarlarını çıkarın',
|
package/lib/module/Trustchex.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useEffect, useState, useMemo, useRef } from 'react';
|
|
3
|
+
import React, { useEffect, useState, useMemo, useRef, useCallback } from 'react';
|
|
4
4
|
import { NavigationContainer } from '@react-navigation/native';
|
|
5
5
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
6
6
|
import { View, ActivityIndicator, StyleSheet } from 'react-native';
|
|
@@ -44,6 +44,7 @@ const Trustchex = ({
|
|
|
44
44
|
locale: propLocale,
|
|
45
45
|
onCompleted,
|
|
46
46
|
onError,
|
|
47
|
+
onDocumentRead,
|
|
47
48
|
enableAnalytics = true,
|
|
48
49
|
debug = false,
|
|
49
50
|
logLevel = 'trace'
|
|
@@ -54,6 +55,7 @@ const Trustchex = ({
|
|
|
54
55
|
const [isInitialized, setIsInitialized] = useState(false);
|
|
55
56
|
const [analyticsInitialized, setAnalyticsInitialized] = useState(false);
|
|
56
57
|
const [isDemoSession, setIsDemoSession] = useState(false);
|
|
58
|
+
const [lastDocumentRead, setLastDocumentReadState] = useState(undefined);
|
|
57
59
|
const branding = useMemo(() => ({
|
|
58
60
|
...DEFAULT_BRANDING,
|
|
59
61
|
...propBranding
|
|
@@ -65,10 +67,32 @@ const Trustchex = ({
|
|
|
65
67
|
// A plain useMemo would create a new object on every dependency change,
|
|
66
68
|
// discarding those mutations and causing screens to see undefined values.
|
|
67
69
|
const contextRef = useRef(null);
|
|
70
|
+
|
|
71
|
+
// Wrap the demo-session setter so it ALSO mutates the persistent context
|
|
72
|
+
// object synchronously. The React state update is async, but the verification
|
|
73
|
+
// flow navigates to the next step in the same tick and advances thereafter by
|
|
74
|
+
// direct mutation (never re-rendering Trustchex). If isDemoSession lived only
|
|
75
|
+
// as a state-derived memo field, downstream screens (e.g. ResultScreen, which
|
|
76
|
+
// gates the diagnostics button on it) could read a stale `false`. Mutating the
|
|
77
|
+
// ref makes the flag travel with the object every screen holds.
|
|
78
|
+
const setIsDemoSessionAndPersist = useCallback(value => {
|
|
79
|
+
if (contextRef.current) {
|
|
80
|
+
contextRef.current.isDemoSession = value;
|
|
81
|
+
}
|
|
82
|
+
setIsDemoSession(value);
|
|
83
|
+
}, []);
|
|
84
|
+
const setLastDocumentRead = useCallback(result => {
|
|
85
|
+
if (contextRef.current) {
|
|
86
|
+
contextRef.current.lastDocumentRead = result;
|
|
87
|
+
}
|
|
88
|
+
setLastDocumentReadState(result);
|
|
89
|
+
}, []);
|
|
68
90
|
const contextValue = useMemo(() => {
|
|
69
91
|
const prev = contextRef.current;
|
|
70
92
|
const value = {
|
|
71
|
-
|
|
93
|
+
// Prefer a direct mutation carried on the persistent object over the
|
|
94
|
+
// (possibly not-yet-flushed) state, so the demo flag can't desync.
|
|
95
|
+
isDemoSession: prev?.isDemoSession || isDemoSession,
|
|
72
96
|
baseUrl: baseUrl || '',
|
|
73
97
|
locale,
|
|
74
98
|
branding,
|
|
@@ -88,11 +112,14 @@ const Trustchex = ({
|
|
|
88
112
|
currentWorkflowStep: prev?.currentWorkflowStep,
|
|
89
113
|
isDebugNavigated: prev?.isDebugNavigated,
|
|
90
114
|
isTestVideoSession: prev?.isTestVideoSession,
|
|
115
|
+
lastDocumentRead,
|
|
91
116
|
onCompleted,
|
|
92
117
|
onError,
|
|
118
|
+
onDocumentRead,
|
|
119
|
+
setLastDocumentRead,
|
|
93
120
|
setSessionId,
|
|
94
121
|
setBaseUrl,
|
|
95
|
-
setIsDemoSession
|
|
122
|
+
setIsDemoSession: setIsDemoSessionAndPersist
|
|
96
123
|
};
|
|
97
124
|
|
|
98
125
|
// Update state-derived identificationInfo fields without replacing
|
|
@@ -103,7 +130,7 @@ const Trustchex = ({
|
|
|
103
130
|
value.identificationInfo.locale = propLocale || i18n.language;
|
|
104
131
|
contextRef.current = value;
|
|
105
132
|
return value;
|
|
106
|
-
}, [baseUrl, locale, branding, sessionId, propLocale, onCompleted, onError, isDemoSession]);
|
|
133
|
+
}, [baseUrl, locale, branding, sessionId, propLocale, onCompleted, onError, isDemoSession, lastDocumentRead, setIsDemoSessionAndPersist]);
|
|
107
134
|
|
|
108
135
|
// Initialize analytics when SDK mounts with valid session
|
|
109
136
|
useEffect(() => {
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityDocumentEIDScanningScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx"],"names":[],"mappings":"AAqBA,QAAA,MAAM,iCAAiC,+
|
|
1
|
+
{"version":3,"file":"IdentityDocumentEIDScanningScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx"],"names":[],"mappings":"AAqBA,QAAA,MAAM,iCAAiC,+CAwNtC,CAAC;AAoBF,eAAe,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityDocumentScanningScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdentityDocumentScanningScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx"],"names":[],"mappings":"AAuBA,QAAA,MAAM,8BAA8B,+CA4KnC,CAAC;AAgBF,eAAe,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoCallScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Dynamic/VideoCallScreen.tsx"],"names":[],"mappings":"AAiCA,QAAA,MAAM,eAAe,GAAI,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"VideoCallScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Dynamic/VideoCallScreen.tsx"],"names":[],"mappings":"AAiCA,QAAA,MAAM,eAAe,GAAI,gBAAgB,GAAG,4CA4hB3C,CAAC;AAyLF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Static/ResultScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResultScreen.d.ts","sourceRoot":"","sources":["../../../../../src/Screens/Static/ResultScreen.tsx"],"names":[],"mappings":"AA8EA,QAAA,MAAM,YAAY,+CAoiCjB,CAAC;AA+IF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DiagnosticImage } from '../Libs/sendDiagnosticReport';
|
|
3
|
+
import type { ScanDataForReport } from '../Libs/diagnosticReport';
|
|
4
|
+
export interface DiagnosticReportButtonProps {
|
|
5
|
+
scan: ScanDataForReport;
|
|
6
|
+
sessionId?: string;
|
|
7
|
+
images?: DiagnosticImage[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* "Report a scanning issue" button for the result screen.
|
|
11
|
+
*
|
|
12
|
+
* Shows a brief notice describing what will be shared (the draft itself is the
|
|
13
|
+
* user's review/consent step), then opens the OS share sheet — the user picks
|
|
14
|
+
* email / WhatsApp / Drive / etc. and sends the diagnostic bundle to support.
|
|
15
|
+
* Self-contained so the result screen only needs to render it with the scan
|
|
16
|
+
* data + captured images.
|
|
17
|
+
*/
|
|
18
|
+
declare const DiagnosticReportButton: React.FC<DiagnosticReportButtonProps>;
|
|
19
|
+
export default DiagnosticReportButton;
|
|
20
|
+
//# sourceMappingURL=DiagnosticReportButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiagnosticReportButton.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/DiagnosticReportButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA+CjE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EIDScanner.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/EIDScanner.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"EIDScanner.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/EIDScanner.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAgBpD,UAAU,eAAe;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CACd,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,KACtB,IAAI,CAAC;IACV,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,UAAU,GAAI,6FAOjB,eAAe,4CAkrBjB,CAAC;AA4NF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityDocumentCamera.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/IdentityDocumentCamera.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdentityDocumentCamera.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/IdentityDocumentCamera.tsx"],"names":[],"mappings":"AAyEA,OAAO,KAAK,EACV,mBAAmB,EACnB,SAAS,EACT,2BAA2B,EAK5B,MAAM,gCAAgC,CAAC;AAGxC,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,2BAA2B,EAAE,CAAC;AAC5E,YAAY,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAMnE,QAAA,MAAM,sBAAsB,GAAI,uDAI7B,2BAA2B,4CAojF7B,CAAC;AAiIF,eAAe,sBAAsB,CAAC"}
|
|
@@ -18,6 +18,16 @@ export type BlockText = {
|
|
|
18
18
|
blocks: BlocksData[];
|
|
19
19
|
resultText: string;
|
|
20
20
|
mrzOnlyText?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Per-frame OCR confidence over MRZ characters from ML Kit per-symbol
|
|
23
|
+
* confidence (Android bundled library only; undefined on iOS). Feeds the
|
|
24
|
+
* multi-frame vote weight so low-confidence frames count less.
|
|
25
|
+
*/
|
|
26
|
+
textConfidence?: {
|
|
27
|
+
mean: number;
|
|
28
|
+
min: number;
|
|
29
|
+
count: number;
|
|
30
|
+
};
|
|
21
31
|
};
|
|
22
32
|
export type BlocksData = {
|
|
23
33
|
blockFrame: FrameType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityDocumentCamera.types.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/IdentityDocumentCamera.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,YAAY,GACZ,SAAS,GACT,UAAU,GACV,eAAe,GACf,WAAW,GACX,eAAe,GACf,KAAK,GACL,cAAc,GACd,WAAW,CAAC;AAEhB,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,wBAAwB,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"IdentityDocumentCamera.types.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/IdentityDocumentCamera.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,YAAY,GACZ,SAAS,GACT,UAAU,GACV,eAAe,GACf,WAAW,GACX,eAAe,GACf,KAAK,GACL,cAAc,GACd,WAAW,CAAC;AAEhB,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,wBAAwB,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,cAAc,CAAC,EAAE;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eAAe,GACf,IAAI,CAAC;AAET,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationManager.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/NavigationManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NavigationManager.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/NavigationManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAmBf,MAAM,MAAM,oBAAoB,GAAG;IACjC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,iBAAiB,wFAyPtB,CAAC;AAaF,eAAe,iBAAiB,CAAC"}
|
|
@@ -10,6 +10,16 @@ export interface Frame {
|
|
|
10
10
|
faces?: NativeFace[];
|
|
11
11
|
textBlocks?: NativeTextBlock[];
|
|
12
12
|
resultText?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Per-frame OCR confidence over MRZ characters, from ML Kit per-symbol
|
|
15
|
+
* confidence. Android (bundled ML Kit library) only — iOS ML Kit exposes no
|
|
16
|
+
* symbol-level confidence, so this is undefined there.
|
|
17
|
+
*/
|
|
18
|
+
textConfidence?: {
|
|
19
|
+
mean: number;
|
|
20
|
+
min: number;
|
|
21
|
+
count: number;
|
|
22
|
+
};
|
|
13
23
|
barcodes?: NativeBarcode[];
|
|
14
24
|
}
|
|
15
25
|
export interface NativeFace {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrustchexCamera.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Components/TrustchexCamera.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AA8CtB,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,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IAAI,CAAC;KACvD,KAAK,IAAI,CAAC;IACX,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,eAAe,oGA+H1B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IdentificationInfo, WorkflowStep } from '../Types/identificationInfo';
|
|
2
|
+
import type { DocumentReadResult } from '../Types/documentReadResult';
|
|
2
3
|
export type AppContextType = {
|
|
3
4
|
isDemoSession: boolean;
|
|
4
5
|
baseUrl: string;
|
|
@@ -14,8 +15,12 @@ export type AppContextType = {
|
|
|
14
15
|
currentWorkflowStep?: WorkflowStep;
|
|
15
16
|
isDebugNavigated?: boolean;
|
|
16
17
|
isTestVideoSession?: boolean;
|
|
18
|
+
/** Last document read result — available to upload services for real-name fields. */
|
|
19
|
+
lastDocumentRead?: DocumentReadResult;
|
|
17
20
|
onCompleted?: () => void;
|
|
18
21
|
onError?: (error: string) => void;
|
|
22
|
+
onDocumentRead?: (result: DocumentReadResult) => void;
|
|
23
|
+
setLastDocumentRead?: (result: DocumentReadResult) => void;
|
|
19
24
|
setSessionId?: (id: string) => void;
|
|
20
25
|
setBaseUrl?: (url: string) => void;
|
|
21
26
|
setIsDemoSession?: (isDemoSession: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppContext.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Contexts/AppContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACb,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"AppContext.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Contexts/AppContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EAC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string;
|
|
6
|
+
dg11FirstName: string | null;
|
|
7
|
+
dg11LastName: string | null;
|
|
6
8
|
} | undefined>;
|
|
7
9
|
export { eidReader };
|
|
8
10
|
//# sourceMappingURL=eidReader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eidReader.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/EIDReader/eidReader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eidReader.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/EIDReader/eidReader.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAsT7C,QAAA,MAAM,SAAS,GACb,gBAAgB,MAAM,EACtB,aAAa,MAAM,EACnB,cAAc,MAAM,EACpB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,KAC5C,OAAO,CACN;IACE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,GACD,SAAS,CA+TZ,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InputStream } from '../../java/inputStream';
|
|
2
|
+
import { DataGroup } from '../dataGroup';
|
|
3
|
+
/**
|
|
4
|
+
* DG11 — Additional Personal Data (ICAO 9303-10 §4.6.6).
|
|
5
|
+
*
|
|
6
|
+
* We only extract tag 0x5F0E (Name of Holder), which contains the full name
|
|
7
|
+
* exactly as printed on the document, in UTF-8, using the same `<<` primary/
|
|
8
|
+
* secondary delimiter as the MRZ (but with native Unicode characters).
|
|
9
|
+
*
|
|
10
|
+
* Example: "ÖZTÜRK<<GÖKHAN MEHMET" → lastName="ÖZTÜRK", firstName="GÖKHAN MEHMET"
|
|
11
|
+
*
|
|
12
|
+
* The file is optional on the chip — if absent or unreadable we return null
|
|
13
|
+
* so the caller can fall back to reverse transliteration.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DG11File extends DataGroup {
|
|
16
|
+
private static readonly DG11_TAG;
|
|
17
|
+
private static readonly TAG_LIST_TAG;
|
|
18
|
+
private static readonly NAME_OF_HOLDER_TAG;
|
|
19
|
+
private firstName;
|
|
20
|
+
private lastName;
|
|
21
|
+
constructor(is?: InputStream);
|
|
22
|
+
/** Returns the first name from DG11, or null if not present. */
|
|
23
|
+
getFirstName(): string | null;
|
|
24
|
+
/** Returns the last name from DG11, or null if not present. */
|
|
25
|
+
getLastName(): string | null;
|
|
26
|
+
read(): Promise<void>;
|
|
27
|
+
protected readContent(inputStream: InputStream): Promise<void>;
|
|
28
|
+
protected writeContent(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Split "PRIMARY<<SECONDARY" into last/first name components.
|
|
31
|
+
* Strips trailing filler `<` within each segment.
|
|
32
|
+
*/
|
|
33
|
+
private parseName;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=dg11File.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dg11File.d.ts","sourceRoot":"","sources":["../../../../../../../src/Shared/EIDReader/lds/icao/dg11File.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACxC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAQ;IAC5C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAU;IAEpD,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,QAAQ,CAAuB;gBAE3B,EAAE,CAAC,EAAE,WAAW;IAI5B,gEAAgE;IAChE,YAAY,IAAI,MAAM,GAAG,IAAI;IAI7B,+DAA+D;IAC/D,WAAW,IAAI,MAAM,GAAG,IAAI;IAItB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;cAIX,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBpE,SAAS,CAAC,YAAY,IAAI,IAAI;IAI9B;;;OAGG;IACH,OAAO,CAAC,SAAS;CAiBlB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the support diagnostic report from a scan session.
|
|
3
|
+
*
|
|
4
|
+
* Produces three things the result screen turns into a reviewable email:
|
|
5
|
+
* - `diagnostics.json` — technical signals (device, camera, MRZ, NFC steps).
|
|
6
|
+
* - `scan-data.json` — the scanned identity data + raw MRZ (PII; the user
|
|
7
|
+
* reviews it in the draft and chooses to send).
|
|
8
|
+
* - a short, size-bounded plain-text BODY summary that always fits an email.
|
|
9
|
+
*
|
|
10
|
+
* The full detail lives in the JSON attachments; the email body is intentionally
|
|
11
|
+
* compact so the draft opens reliably on every mail client.
|
|
12
|
+
*/
|
|
13
|
+
import type { DiagnosticsSnapshot } from './diagnostics';
|
|
14
|
+
import type { DeviceDetails } from './native-device-info.utils';
|
|
15
|
+
import type { MRZFields } from '../Types/mrzFields';
|
|
16
|
+
export interface ScanDataForReport {
|
|
17
|
+
documentType?: string;
|
|
18
|
+
dataSource?: string;
|
|
19
|
+
mrzText?: string | null;
|
|
20
|
+
mrzFields?: MRZFields | null;
|
|
21
|
+
barcodeValue?: string | null;
|
|
22
|
+
/** Which images were captured (presence only, used for the body summary). */
|
|
23
|
+
images?: {
|
|
24
|
+
mrzSide?: boolean;
|
|
25
|
+
front?: boolean;
|
|
26
|
+
face?: boolean;
|
|
27
|
+
nfcFace?: boolean;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface DiagnosticReportBundle {
|
|
31
|
+
/** Pretty-printed technical report. */
|
|
32
|
+
diagnosticsJson: string;
|
|
33
|
+
/** Pretty-printed scanned identity data (PII). */
|
|
34
|
+
scanDataJson: string;
|
|
35
|
+
/** Compact, size-bounded plain-text email body. */
|
|
36
|
+
body: string;
|
|
37
|
+
/** Suggested email subject. */
|
|
38
|
+
subject: string;
|
|
39
|
+
}
|
|
40
|
+
/** Assemble the full report bundle. Pure — no I/O, no native calls. */
|
|
41
|
+
export declare const buildDiagnosticReport: (params: {
|
|
42
|
+
diag: DiagnosticsSnapshot;
|
|
43
|
+
device: DeviceDetails;
|
|
44
|
+
scan: ScanDataForReport;
|
|
45
|
+
sdkVersion: string;
|
|
46
|
+
sessionId?: string;
|
|
47
|
+
}) => DiagnosticReportBundle;
|
|
48
|
+
//# sourceMappingURL=diagnosticReport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnosticReport.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/diagnosticReport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAmBpD,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,6EAA6E;IAC7E,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,CAAC;QAC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