@trustchex/react-native-sdk 1.478.7 → 1.481.1
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/Static/ResultScreen.js +42 -6
- package/lib/module/Shared/Components/DiagnosticReportButton.js +64 -0
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +132 -8
- package/lib/module/Shared/Components/NavigationManager.js +7 -9
- package/lib/module/Shared/EIDReader/eidReader.js +149 -29
- 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/mrzFrameAggregator.js +32 -5
- package/lib/module/Shared/Libs/native-device-info.utils.js +67 -0
- package/lib/module/Shared/Libs/sendDiagnosticReport.js +130 -0
- package/lib/module/Translation/Resources/en.js +5 -0
- package/lib/module/Translation/Resources/tr.js +5 -0
- package/lib/module/Trustchex.js +20 -4
- package/lib/module/version.js +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/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/EIDReader/eidReader.d.ts.map +1 -1
- 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/mrzFrameAggregator.d.ts +33 -0
- package/lib/typescript/src/Shared/Libs/mrzFrameAggregator.d.ts.map +1 -1
- 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/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.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +5 -1
- package/src/Screens/Static/ResultScreen.tsx +46 -1
- package/src/Shared/Components/DiagnosticReportButton.tsx +77 -0
- 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/EIDReader/eidReader.ts +166 -46
- 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/mrzFrameAggregator.ts +61 -3
- package/src/Shared/Libs/native-device-info.utils.ts +116 -0
- package/src/Shared/Libs/sendDiagnosticReport.ts +165 -0
- package/src/Translation/Resources/en.ts +6 -0
- package/src/Translation/Resources/tr.ts +6 -0
- package/src/Trustchex.tsx +26 -3
- package/src/version.ts +1 -1
|
@@ -9,6 +9,20 @@ export interface MRZFrameInput {
|
|
|
9
9
|
* focus-weighted voting beats unweighted.
|
|
10
10
|
*/
|
|
11
11
|
weight?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Optional OCR confidence for this frame, in [0, 1] — e.g. ML Kit's mean
|
|
14
|
+
* per-symbol confidence over the MRZ characters (Android bundled library only;
|
|
15
|
+
* iOS ML Kit exposes no symbol confidence). When present it MULTIPLIES `weight`,
|
|
16
|
+
* so a frame the recognizer was unsure about contributes proportionally fewer
|
|
17
|
+
* votes than a confident one of the same sharpness. This is the per-frame form
|
|
18
|
+
* of confidence-weighted voting: it can't misalign cells (unlike threading
|
|
19
|
+
* per-column confidence through the column-shifting line reconstruction), yet
|
|
20
|
+
* still lets confident frames dominate look-alike ties (A↔4, S↔5, B↔8).
|
|
21
|
+
*
|
|
22
|
+
* A confidence floor is applied so a single near-zero frame is down-weighted
|
|
23
|
+
* but never fully silenced (it may still hold the only vote for some cell).
|
|
24
|
+
*/
|
|
25
|
+
confidence?: number;
|
|
12
26
|
}
|
|
13
27
|
export interface MRZConsensus {
|
|
14
28
|
/** Best consensus MRZ (newline-joined fixed-width lines), or null if none yet. */
|
|
@@ -22,6 +36,18 @@ export interface MRZConsensus {
|
|
|
22
36
|
* last `stabilityTarget` contributing frames. Callers should advance only then.
|
|
23
37
|
*/
|
|
24
38
|
stable: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* How many consecutive contributing frames the current (valid) consensus has
|
|
41
|
+
* stayed unchanged. Diagnostic: convergence speed across devices.
|
|
42
|
+
*/
|
|
43
|
+
stableStreak: number;
|
|
44
|
+
/**
|
|
45
|
+
* Smallest winning vote margin across all CONTESTED cells of the best format
|
|
46
|
+
* (cells where >1 distinct char was voted). Higher = more confident reading;
|
|
47
|
+
* a low value at acceptance means a look-alike was barely resolved. Infinity
|
|
48
|
+
* when no cell is contested (a perfectly clean read). Diagnostic only.
|
|
49
|
+
*/
|
|
50
|
+
minContestedMargin: number;
|
|
25
51
|
}
|
|
26
52
|
export interface MRZFrameAggregatorOptions {
|
|
27
53
|
/**
|
|
@@ -89,6 +115,13 @@ export declare class MRZFrameAggregator {
|
|
|
89
115
|
* is what turns "looks valid this frame" into "the camera agrees across frames".
|
|
90
116
|
*/
|
|
91
117
|
private consensusIsConfident;
|
|
118
|
+
/**
|
|
119
|
+
* Smallest winning vote margin across all CONTESTED cells (where >1 distinct
|
|
120
|
+
* char was voted). Returns Infinity when no cell is contested. Used both to
|
|
121
|
+
* gate confidence and to surface a diagnostic of how narrowly a look-alike was
|
|
122
|
+
* resolved at acceptance.
|
|
123
|
+
*/
|
|
124
|
+
private minContestedMargin;
|
|
92
125
|
/** Read out the winning character per cell for a format. */
|
|
93
126
|
private consensusLines;
|
|
94
127
|
/** Best consensus across all formats seen, validated with check digits. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mrzFrameAggregator.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/mrzFrameAggregator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAkCvD,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"mrzFrameAggregator.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/mrzFrameAggregator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAkCvD,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AASD,MAAM,WAAW,YAAY;IAC3B,kFAAkF;IAClF,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,+EAA+E;IAC/E,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvC,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkFD;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAInC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,YAAY,CAAK;IAEzB,OAAO,CAAC,cAAc,CAAK;gBAEf,OAAO,GAAE,yBAA8B;IAMnD,KAAK,IAAI,IAAI;IAQb;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB;IA0B5B,iCAAiC;IACjC,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,WAAW;IAUnB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY;IA+C5C,+EAA+E;IAC/E,OAAO,CAAC,KAAK;IAab;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAiB1B,4DAA4D;IAC5D,OAAO,CAAC,cAAc;IA8BtB,2EAA2E;IAC3E,gBAAgB,IAAI,YAAY;CAiEjC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full, non-PII device details for the support diagnostic report. Device-
|
|
3
|
+
* specific scanning/NFC issues correlate with hardware, OS level, memory and
|
|
4
|
+
* NFC capability, so we capture a broad-but-safe set. Excludes anything that
|
|
5
|
+
* identifies a person (uniqueId is a per-install vendor id, not PII, and is kept
|
|
6
|
+
* only for correlating repeat reports from the same device).
|
|
7
|
+
*/
|
|
8
|
+
export interface DeviceDetails {
|
|
9
|
+
platform: string;
|
|
10
|
+
systemName: string;
|
|
11
|
+
systemVersion: string;
|
|
12
|
+
apiLevel?: number;
|
|
13
|
+
brand: string;
|
|
14
|
+
manufacturer: string;
|
|
15
|
+
model: string;
|
|
16
|
+
deviceId: string;
|
|
17
|
+
deviceType: string;
|
|
18
|
+
isTablet: boolean;
|
|
19
|
+
isEmulator: boolean;
|
|
20
|
+
hasNotch: boolean;
|
|
21
|
+
totalMemoryMB?: number;
|
|
22
|
+
usedMemoryMB?: number;
|
|
23
|
+
totalDiskMB?: number;
|
|
24
|
+
freeDiskMB?: number;
|
|
25
|
+
batteryLevel?: number;
|
|
26
|
+
appVersion: string;
|
|
27
|
+
buildNumber: string;
|
|
28
|
+
bundleId: string;
|
|
29
|
+
fontScale?: number;
|
|
30
|
+
installerPackage?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Gather the full non-PII device profile for a diagnostic report. */
|
|
33
|
+
export declare const gatherDeviceDetails: () => Promise<DeviceDetails>;
|
|
1
34
|
export declare const NativeDeviceInfo: {
|
|
2
35
|
generateHumanReadableIdentifier: () => Promise<string>;
|
|
3
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-device-info.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/native-device-info.utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;2CACgB,OAAO,CAAC,MAAM,CAAC;CAe3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"native-device-info.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/native-device-info.utils.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AA8BD,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,QAAa,OAAO,CAAC,aAAa,CAqDjE,CAAC;AAEF,eAAO,MAAM,gBAAgB;2CACgB,OAAO,CAAC,MAAM,CAAC;CAe3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ScanDataForReport } from './diagnosticReport';
|
|
2
|
+
/**
|
|
3
|
+
* Whether diagnostic sharing is available (i.e. `react-native-share` is
|
|
4
|
+
* installed in the host app). The result-screen button hides itself when false.
|
|
5
|
+
*/
|
|
6
|
+
export declare const isDiagnosticSharingAvailable: () => boolean;
|
|
7
|
+
export interface DiagnosticImage {
|
|
8
|
+
/** Stable file name without extension, e.g. "mrz-side". */
|
|
9
|
+
name: string;
|
|
10
|
+
base64: string;
|
|
11
|
+
mime: 'jpg' | 'png';
|
|
12
|
+
}
|
|
13
|
+
export interface SendDiagnosticParams {
|
|
14
|
+
scan: ScanDataForReport;
|
|
15
|
+
sdkVersion: string;
|
|
16
|
+
sessionId?: string;
|
|
17
|
+
/** base64 images to attach (MRZ side / front / face / NFC chip face). */
|
|
18
|
+
images?: DiagnosticImage[];
|
|
19
|
+
}
|
|
20
|
+
export interface SendResult {
|
|
21
|
+
shared: boolean;
|
|
22
|
+
/** True when the user dismissed the share sheet (not an error). */
|
|
23
|
+
dismissed?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build the report, stage attachments, and present the share sheet. Returns
|
|
27
|
+
* { shared } — false on error, with `dismissed` set when the user cancelled.
|
|
28
|
+
*/
|
|
29
|
+
export declare const sendDiagnosticReport: (params: SendDiagnosticParams) => Promise<SendResult>;
|
|
30
|
+
//# sourceMappingURL=sendDiagnosticReport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendDiagnosticReport.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/sendDiagnosticReport.ts"],"names":[],"mappings":"AAqBA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAyB5B;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAO,OAA8B,CAAC;AAE/E,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;CAC5B;AAcD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,oBAAoB,KAC3B,OAAO,CAAC,UAAU,CAsEpB,CAAC"}
|
|
@@ -43,6 +43,11 @@ declare const _default: {
|
|
|
43
43
|
'resultScreen.demoVerbalConsentTitle': string;
|
|
44
44
|
'resultScreen.demoVerbalConsentText': string;
|
|
45
45
|
'resultScreen.demoStartOver': string;
|
|
46
|
+
'diagnosticReport.button': string;
|
|
47
|
+
'diagnosticReport.noticeTitle': string;
|
|
48
|
+
'diagnosticReport.noticeBody': string;
|
|
49
|
+
'diagnosticReport.continue': string;
|
|
50
|
+
'diagnosticReport.cancel': string;
|
|
46
51
|
'livenessDetectionScreen.guideHeader': string;
|
|
47
52
|
'livenessDetectionScreen.guideText': string;
|
|
48
53
|
'livenessDetectionScreen.guidePoint1': string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/en.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/en.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAgQE"}
|
|
@@ -43,6 +43,11 @@ declare const _default: {
|
|
|
43
43
|
'resultScreen.demoVerbalConsentTitle': string;
|
|
44
44
|
'resultScreen.demoVerbalConsentText': string;
|
|
45
45
|
'resultScreen.demoStartOver': string;
|
|
46
|
+
'diagnosticReport.button': string;
|
|
47
|
+
'diagnosticReport.noticeTitle': string;
|
|
48
|
+
'diagnosticReport.noticeBody': string;
|
|
49
|
+
'diagnosticReport.continue': string;
|
|
50
|
+
'diagnosticReport.cancel': string;
|
|
46
51
|
'livenessDetectionScreen.guideHeader': string;
|
|
47
52
|
'livenessDetectionScreen.guideText': string;
|
|
48
53
|
'livenessDetectionScreen.guidePoint1': string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/tr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/tr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAmQE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trustchex.d.ts","sourceRoot":"","sources":["../../../src/Trustchex.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Trustchex.d.ts","sourceRoot":"","sources":["../../../src/Trustchex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAKf,OAAO,gCAAgC,CAAC;AAgCxC,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CACrE;AASD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAiPvC,CAAC;AAWF,eAAe,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.481.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustchex/react-native-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.481.1",
|
|
4
4
|
"description": "Trustchex mobile app react native SDK for android or ios devices",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -169,6 +169,7 @@
|
|
|
169
169
|
"react-native-nfc-manager": ">=3.16.2",
|
|
170
170
|
"react-native-safe-area-context": ">=5.5.2",
|
|
171
171
|
"react-native-screens": ">=4.18.0",
|
|
172
|
+
"react-native-share": ">=12.0.0",
|
|
172
173
|
"react-native-sse": ">=1.1.0",
|
|
173
174
|
"react-native-svg": ">=15.12.0",
|
|
174
175
|
"react-native-tts": ">=4.1.1",
|
|
@@ -216,6 +217,9 @@
|
|
|
216
217
|
"react-native-screens": {
|
|
217
218
|
"optional": false
|
|
218
219
|
},
|
|
220
|
+
"react-native-share": {
|
|
221
|
+
"optional": true
|
|
222
|
+
},
|
|
219
223
|
"react-native-sse": {
|
|
220
224
|
"optional": false
|
|
221
225
|
},
|
|
@@ -39,7 +39,32 @@ import { Video as VideoCompressor } from 'react-native-compressor';
|
|
|
39
39
|
import { encryptWithAes, getSessionKey } from '../../Shared/Libs/crypto.utils';
|
|
40
40
|
import Video from 'react-native-video';
|
|
41
41
|
import StyledButton from '../../Shared/Components/StyledButton';
|
|
42
|
+
import DiagnosticReportButton from '../../Shared/Components/DiagnosticReportButton';
|
|
43
|
+
import type { DiagnosticImage } from '../../Shared/Libs/sendDiagnosticReport';
|
|
42
44
|
import NativeDeviceInfo from '../../Shared/Libs/native-device-info.utils';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Collect the captured document/face images (base64) as attachments for a
|
|
48
|
+
* diagnostic report. On an ID card the BACK image is the MRZ side; on a passport
|
|
49
|
+
* the front carries the MRZ. The NFC chip face arrives as `faceImage` with its
|
|
50
|
+
* own mime type, which may be png.
|
|
51
|
+
*/
|
|
52
|
+
const collectDiagnosticImages = (
|
|
53
|
+
doc?: ScannedIdentityDocument
|
|
54
|
+
): DiagnosticImage[] => {
|
|
55
|
+
if (!doc) return [];
|
|
56
|
+
const out: DiagnosticImage[] = [];
|
|
57
|
+
const push = (name: string, b64?: string, mime: 'jpg' | 'png' = 'jpg') => {
|
|
58
|
+
if (b64 && b64 !== '') out.push({ name, base64: b64, mime });
|
|
59
|
+
};
|
|
60
|
+
push('mrz-side', doc.backImage);
|
|
61
|
+
push('front', doc.frontImage);
|
|
62
|
+
const faceMime = doc.faceImageMimeType === 'image/png' ? 'png' : 'jpg';
|
|
63
|
+
push('face', doc.faceImage, faceMime);
|
|
64
|
+
push('secondary-face', doc.secondaryFaceImage);
|
|
65
|
+
push('hologram', doc.hologramImage);
|
|
66
|
+
return out;
|
|
67
|
+
};
|
|
43
68
|
import {
|
|
44
69
|
trackError,
|
|
45
70
|
trackFunnelStep,
|
|
@@ -1045,7 +1070,7 @@ const ResultScreen = () => {
|
|
|
1045
1070
|
)}
|
|
1046
1071
|
</View>
|
|
1047
1072
|
</ScrollView>
|
|
1048
|
-
<View style={{ paddingBottom: insets.bottom }}>
|
|
1073
|
+
<View style={[styles.footer, { paddingBottom: insets.bottom + 20 }]}>
|
|
1049
1074
|
<StyledButton
|
|
1050
1075
|
mode="contained"
|
|
1051
1076
|
onPress={() => {
|
|
@@ -1055,6 +1080,26 @@ const ResultScreen = () => {
|
|
|
1055
1080
|
>
|
|
1056
1081
|
{t('resultScreen.demoStartOver')}
|
|
1057
1082
|
</StyledButton>
|
|
1083
|
+
<DiagnosticReportButton
|
|
1084
|
+
sessionId={appContext.identificationInfo?.sessionId}
|
|
1085
|
+
scan={{
|
|
1086
|
+
documentType:
|
|
1087
|
+
appContext.identificationInfo?.scannedDocument
|
|
1088
|
+
?.documentType,
|
|
1089
|
+
dataSource:
|
|
1090
|
+
appContext.identificationInfo?.scannedDocument?.dataSource,
|
|
1091
|
+
mrzText:
|
|
1092
|
+
appContext.identificationInfo?.scannedDocument?.mrzText,
|
|
1093
|
+
mrzFields:
|
|
1094
|
+
appContext.identificationInfo?.scannedDocument?.mrzFields,
|
|
1095
|
+
barcodeValue:
|
|
1096
|
+
appContext.identificationInfo?.scannedDocument
|
|
1097
|
+
?.barcodeValue,
|
|
1098
|
+
}}
|
|
1099
|
+
images={collectDiagnosticImages(
|
|
1100
|
+
appContext.identificationInfo?.scannedDocument
|
|
1101
|
+
)}
|
|
1102
|
+
/>
|
|
1058
1103
|
</View>
|
|
1059
1104
|
</>
|
|
1060
1105
|
) : (
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Alert } from 'react-native';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import StyledButton from './StyledButton';
|
|
5
|
+
import {
|
|
6
|
+
sendDiagnosticReport,
|
|
7
|
+
isDiagnosticSharingAvailable,
|
|
8
|
+
type DiagnosticImage,
|
|
9
|
+
} from '../Libs/sendDiagnosticReport';
|
|
10
|
+
import type { ScanDataForReport } from '../Libs/diagnosticReport';
|
|
11
|
+
import { SDK_VERSION } from '../../version';
|
|
12
|
+
|
|
13
|
+
export interface DiagnosticReportButtonProps {
|
|
14
|
+
scan: ScanDataForReport;
|
|
15
|
+
sessionId?: string;
|
|
16
|
+
images?: DiagnosticImage[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* "Report a scanning issue" button for the result screen.
|
|
21
|
+
*
|
|
22
|
+
* Shows a brief notice describing what will be shared (the draft itself is the
|
|
23
|
+
* user's review/consent step), then opens the OS share sheet — the user picks
|
|
24
|
+
* email / WhatsApp / Drive / etc. and sends the diagnostic bundle to support.
|
|
25
|
+
* Self-contained so the result screen only needs to render it with the scan
|
|
26
|
+
* data + captured images.
|
|
27
|
+
*/
|
|
28
|
+
const DiagnosticReportButton: React.FC<DiagnosticReportButtonProps> = ({
|
|
29
|
+
scan,
|
|
30
|
+
sessionId,
|
|
31
|
+
images,
|
|
32
|
+
}) => {
|
|
33
|
+
const { t } = useTranslation();
|
|
34
|
+
const [sending, setSending] = useState(false);
|
|
35
|
+
|
|
36
|
+
// `react-native-share` is optional — hide the button entirely when the host
|
|
37
|
+
// app hasn't installed it, so apps that don't want diagnostics see no UI.
|
|
38
|
+
if (!isDiagnosticSharingAvailable()) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const onPress = () => {
|
|
43
|
+
if (sending) return;
|
|
44
|
+
// Brief notice — the share draft is the actual review/consent step.
|
|
45
|
+
Alert.alert(
|
|
46
|
+
t('diagnosticReport.noticeTitle'),
|
|
47
|
+
t('diagnosticReport.noticeBody'),
|
|
48
|
+
[
|
|
49
|
+
{ text: t('diagnosticReport.cancel'), style: 'cancel' },
|
|
50
|
+
{
|
|
51
|
+
text: t('diagnosticReport.continue'),
|
|
52
|
+
onPress: async () => {
|
|
53
|
+
setSending(true);
|
|
54
|
+
try {
|
|
55
|
+
await sendDiagnosticReport({
|
|
56
|
+
scan,
|
|
57
|
+
sdkVersion: SDK_VERSION,
|
|
58
|
+
sessionId,
|
|
59
|
+
images,
|
|
60
|
+
});
|
|
61
|
+
} finally {
|
|
62
|
+
setSending(false);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
]
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<StyledButton mode="outlined" onPress={onPress} disabled={sending}>
|
|
72
|
+
{t('diagnosticReport.button')}
|
|
73
|
+
</StyledButton>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default DiagnosticReportButton;
|