@trustchex/react-native-sdk 1.481.1 → 1.484.0
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/README.md +14 -5
- 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 +33 -10
- package/lib/module/Shared/Components/EIDScanner.js +52 -19
- package/lib/module/Shared/Contexts/AppContext.js +3 -0
- package/lib/module/Shared/EIDReader/eidReader.js +18 -1
- package/lib/module/Shared/EIDReader/lds/icao/dg11File.js +77 -0
- package/lib/module/Shared/EIDReader/lds/icao/mrzInfo.js +4 -4
- package/lib/module/Shared/Libs/documentDataNormalizer.js +104 -0
- package/lib/module/Shared/Libs/mrz.utils.js +0 -5
- package/lib/module/Shared/Libs/mrzTransliteration.js +80 -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/Trustchex.js +12 -1
- 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/EIDScanner.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/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/mrzTransliteration.d.ts +3 -0
- package/lib/typescript/src/Shared/Libs/mrzTransliteration.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/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 +1 -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 +39 -15
- package/src/Shared/Components/EIDScanner.tsx +67 -18
- package/src/Shared/Contexts/AppContext.ts +8 -0
- package/src/Shared/EIDReader/eidReader.ts +27 -1
- package/src/Shared/EIDReader/lds/icao/dg11File.ts +94 -0
- package/src/Shared/EIDReader/lds/icao/mrzInfo.ts +4 -4
- package/src/Shared/Libs/documentDataNormalizer.ts +108 -0
- package/src/Shared/Libs/mrz.utils.ts +0 -5
- package/src/Shared/Libs/mrzTransliteration.ts +131 -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/Trustchex.tsx +22 -0
- package/src/index.tsx +7 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// ICAO 9303 digraphs safe to apply universally — these appear across many
|
|
4
|
+
// national variants and are unlikely to collide with real letter sequences.
|
|
5
|
+
// SS→ß, TH→Þ etc. are excluded: too ambiguous (HASSAN, THOMAS).
|
|
6
|
+
const UNIVERSAL = [['OE', 'Ö'], ['UE', 'Ü']];
|
|
7
|
+
const GERMAN = [['AE', 'Ä'], ['OE', 'Ö'], ['UE', 'Ü'], ['SS', 'ß']];
|
|
8
|
+
const SWEDISH = [['AA', 'Å'], ['AE', 'Æ'], ['OE', 'Ø']];
|
|
9
|
+
const DANISH = [['AA', 'Å'], ['AE', 'Æ'], ['OE', 'Ø']];
|
|
10
|
+
const NORWEGIAN = [['AA', 'Å'], ['AE', 'Æ'], ['OE', 'Ø']];
|
|
11
|
+
const FRENCH = [['OE', 'Œ'], ['AE', 'Æ']];
|
|
12
|
+
const ICELANDIC = [['AE', 'Æ'], ['OE', 'Ö'], ['TH', 'Þ'], ['D', 'Ð']];
|
|
13
|
+
const COUNTRY_MAP = {
|
|
14
|
+
DEU: GERMAN,
|
|
15
|
+
AUT: GERMAN,
|
|
16
|
+
CHE: GERMAN,
|
|
17
|
+
SWE: SWEDISH,
|
|
18
|
+
DNK: DANISH,
|
|
19
|
+
NOR: NORWEGIAN,
|
|
20
|
+
FRA: FRENCH,
|
|
21
|
+
LUX: FRENCH,
|
|
22
|
+
ISL: ICELANDIC
|
|
23
|
+
};
|
|
24
|
+
function applyDigraphMap(token, map) {
|
|
25
|
+
let result = '';
|
|
26
|
+
let i = 0;
|
|
27
|
+
while (i < token.length) {
|
|
28
|
+
let matched = false;
|
|
29
|
+
for (const [digraph, unicode] of map) {
|
|
30
|
+
if (token.startsWith(digraph, i)) {
|
|
31
|
+
result += unicode;
|
|
32
|
+
i += digraph.length;
|
|
33
|
+
matched = true;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (!matched) {
|
|
38
|
+
result += token[i];
|
|
39
|
+
i++;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
function convertName(rawName, map) {
|
|
45
|
+
return rawName.split(' ').map(word => applyDigraphMap(word, map)).join(' ');
|
|
46
|
+
}
|
|
47
|
+
export function buildDocumentName(rawFirst, rawLast, issuingState, dg11First, dg11Last) {
|
|
48
|
+
if (dg11First != null && dg11Last != null && (dg11First || dg11Last)) {
|
|
49
|
+
return {
|
|
50
|
+
rawFirst,
|
|
51
|
+
rawLast,
|
|
52
|
+
displayFirst: dg11First,
|
|
53
|
+
displayLast: dg11Last,
|
|
54
|
+
source: 'dg11'
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const country = (issuingState ?? '').toUpperCase().trim();
|
|
58
|
+
const map = COUNTRY_MAP[country];
|
|
59
|
+
if (map) {
|
|
60
|
+
return {
|
|
61
|
+
rawFirst,
|
|
62
|
+
rawLast,
|
|
63
|
+
displayFirst: convertName(rawFirst, map),
|
|
64
|
+
displayLast: convertName(rawLast, map),
|
|
65
|
+
source: 'reverse_table'
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// No country-specific table: apply OE→Ö and UE→Ü universally.
|
|
70
|
+
const displayFirst = convertName(rawFirst, UNIVERSAL);
|
|
71
|
+
const displayLast = convertName(rawLast, UNIVERSAL);
|
|
72
|
+
const changed = displayFirst !== rawFirst || displayLast !== rawLast;
|
|
73
|
+
return {
|
|
74
|
+
rawFirst,
|
|
75
|
+
rawLast,
|
|
76
|
+
displayFirst,
|
|
77
|
+
displayLast,
|
|
78
|
+
source: changed ? 'reverse_table' : 'raw'
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -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";
|
package/lib/module/Trustchex.js
CHANGED
|
@@ -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
|
|
@@ -79,6 +81,12 @@ const Trustchex = ({
|
|
|
79
81
|
}
|
|
80
82
|
setIsDemoSession(value);
|
|
81
83
|
}, []);
|
|
84
|
+
const setLastDocumentRead = useCallback(result => {
|
|
85
|
+
if (contextRef.current) {
|
|
86
|
+
contextRef.current.lastDocumentRead = result;
|
|
87
|
+
}
|
|
88
|
+
setLastDocumentReadState(result);
|
|
89
|
+
}, []);
|
|
82
90
|
const contextValue = useMemo(() => {
|
|
83
91
|
const prev = contextRef.current;
|
|
84
92
|
const value = {
|
|
@@ -104,8 +112,11 @@ const Trustchex = ({
|
|
|
104
112
|
currentWorkflowStep: prev?.currentWorkflowStep,
|
|
105
113
|
isDebugNavigated: prev?.isDebugNavigated,
|
|
106
114
|
isTestVideoSession: prev?.isTestVideoSession,
|
|
115
|
+
lastDocumentRead,
|
|
107
116
|
onCompleted,
|
|
108
117
|
onError,
|
|
118
|
+
onDocumentRead,
|
|
119
|
+
setLastDocumentRead,
|
|
109
120
|
setSessionId,
|
|
110
121
|
setBaseUrl,
|
|
111
122
|
setIsDemoSession: setIsDemoSessionAndPersist
|
|
@@ -119,7 +130,7 @@ const Trustchex = ({
|
|
|
119
130
|
value.identificationInfo.locale = propLocale || i18n.language;
|
|
120
131
|
contextRef.current = value;
|
|
121
132
|
return value;
|
|
122
|
-
}, [baseUrl, locale, branding, sessionId, propLocale, onCompleted, onError, isDemoSession, setIsDemoSessionAndPersist]);
|
|
133
|
+
}, [baseUrl, locale, branding, sessionId, propLocale, onCompleted, onError, isDemoSession, lastDocumentRead, setIsDemoSessionAndPersist]);
|
|
123
134
|
|
|
124
135
|
// Initialize analytics when SDK mounts with valid session
|
|
125
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":"AA8EA,QAAA,MAAM,YAAY,+
|
|
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"}
|
|
@@ -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,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,EACb,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,mBAAmB,CAAC,EAAE,YAAY,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACtD,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC3D,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD,CAAC;;AAEF,wBA8BG"}
|
|
@@ -3,6 +3,8 @@ declare const eidReader: (documentNumber: string, dateOfBirth: string, dateOfExp
|
|
|
3
3
|
mrz?: MRZInfo;
|
|
4
4
|
faceImage: string;
|
|
5
5
|
mimeType: 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,12 @@
|
|
|
1
|
+
import type { MRZFields } from '../Types/mrzFields';
|
|
2
|
+
import type { DocumentData } from '../Types/documentData';
|
|
3
|
+
import type { MRZInfo } from '../EIDReader/lds/icao/mrzInfo';
|
|
4
|
+
/**
|
|
5
|
+
* Build a DocumentData from a chip-read MRZInfo object (NFC path).
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalizeFromMRZInfo(mrz: MRZInfo): DocumentData;
|
|
8
|
+
/**
|
|
9
|
+
* Build a DocumentData from an MRZFields object (camera OCR path).
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalizeFromMRZFields(fields: MRZFields): DocumentData;
|
|
12
|
+
//# sourceMappingURL=documentDataNormalizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentDataNormalizer.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/documentDataNormalizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAoE7D;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAgB/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,YAAY,CAatE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mrz.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/mrz.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA2CpD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;sBAOwB,MAAM,KAAG,MAAM;2BA8gC7B,MAAM,gBACF,OAAO,KACnB,mBAAmB;
|
|
1
|
+
{"version":3,"file":"mrz.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/mrz.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA2CpD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;sBAOwB,MAAM,KAAG,MAAM;2BA8gC7B,MAAM,gBACF,OAAO,KACnB,mBAAmB;0CAsKuB,MAAM,KAAG,mBAAmB;wCAj/B9B,MAAM,KAAG,MAAM,EAAE,EAAE;wCA2/BnB,MAAM,KAAG,MAAM;gCAmDvB,MAAM;;;;;+BAz1BP,MAAM,KAAG,OAAO;iCA4Bd,MAAM,KAAG,MAAM;wCA20BR,MAAM,GAAG,IAAI,KAAG,MAAM,GAAG,IAAI;;AAgBxE,wBAUE"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DocumentName } from '../Types/documentReadResult';
|
|
2
|
+
export declare function buildDocumentName(rawFirst: string, rawLast: string, issuingState: string | null | undefined, dg11First?: string | null, dg11Last?: string | null): DocumentName;
|
|
3
|
+
//# sourceMappingURL=mrzTransliteration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mrzTransliteration.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/mrzTransliteration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAyFhE,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACvC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,YAAY,CAmCd"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IdentificationInfo, ScannedIdentityDocument, LivenessDetection } from '../Types/identificationInfo';
|
|
2
|
+
import type { DocumentName } from '../Types/documentReadResult';
|
|
2
3
|
/**
|
|
3
4
|
* Service to upload collected identification data to the backend.
|
|
4
5
|
* This is used to send data before/during video call so agents can see it.
|
|
@@ -11,7 +12,7 @@ export declare class DataUploadService {
|
|
|
11
12
|
/**
|
|
12
13
|
* Submit document data to the backend (same approach as ResultScreen)
|
|
13
14
|
*/
|
|
14
|
-
submitDocumentData(identificationId: string, scannedDocument: ScannedIdentityDocument, sessionKey: string): Promise<void>;
|
|
15
|
+
submitDocumentData(identificationId: string, scannedDocument: ScannedIdentityDocument, sessionKey: string, documentName?: DocumentName): Promise<void>;
|
|
15
16
|
/**
|
|
16
17
|
* Upload media files (document images, selfies, etc.)
|
|
17
18
|
*/
|
|
@@ -19,7 +20,7 @@ export declare class DataUploadService {
|
|
|
19
20
|
/**
|
|
20
21
|
* Upload all collected data (document + media) before video call
|
|
21
22
|
*/
|
|
22
|
-
uploadCollectedData(identificationInfo: IdentificationInfo, onProgress?: (progress: number) => void): Promise<boolean>;
|
|
23
|
+
uploadCollectedData(identificationInfo: IdentificationInfo, onProgress?: (progress: number) => void, documentName?: DocumentName): Promise<boolean>;
|
|
23
24
|
private getGenderEnumType;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=DataUploadService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataUploadService.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Services/DataUploadService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"DataUploadService.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Services/DataUploadService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAQhE;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,MAAM;YAKb,0BAA0B;IAexC;;OAEG;IACG,kBAAkB,CACtB,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,uBAAuB,EACxC,UAAU,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,IAAI,CAAC;IA2DhB;;OAEG;IACG,WAAW,CACf,gBAAgB,EAAE,MAAM,EACxB,eAAe,CAAC,EAAE,uBAAuB,EACzC,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GACtC,OAAO,CAAC,IAAI,CAAC;IA0JhB;;OAEG;IACG,mBAAmB,CACvB,kBAAkB,EAAE,kBAAkB,EACtC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,EACvC,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,OAAO,CAAC;IAkGnB,OAAO,CAAC,iBAAiB;CAY1B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified, source-independent document data produced after a scan — whether
|
|
3
|
+
* the data came from an NFC chip read or camera OCR. All fields are normalized
|
|
4
|
+
* to consistent formats regardless of which path produced them.
|
|
5
|
+
*/
|
|
6
|
+
export interface DocumentData {
|
|
7
|
+
/**
|
|
8
|
+
* Document type.
|
|
9
|
+
* - `"P"` — passport (TD3)
|
|
10
|
+
* - `"I"` — ID card (TD1 / TD2)
|
|
11
|
+
*/
|
|
12
|
+
documentType: 'P' | 'I' | string;
|
|
13
|
+
/** 3-letter ICAO issuing country code, e.g. `"TUR"`, `"DEU"`. */
|
|
14
|
+
issuingCountry: string;
|
|
15
|
+
/** 3-letter ICAO nationality code, e.g. `"TUR"`. */
|
|
16
|
+
nationality: string;
|
|
17
|
+
/** Document serial / number exactly as encoded on the document. */
|
|
18
|
+
documentNumber: string;
|
|
19
|
+
/** National identity number where applicable (e.g. Turkish TC kimlik no). Null if not present. */
|
|
20
|
+
personalNumber: string | null;
|
|
21
|
+
/** Last name — raw MRZ ASCII (OCR-B), e.g. `"OEZTUERK"`. */
|
|
22
|
+
lastName: string;
|
|
23
|
+
/** First name(s) — raw MRZ ASCII (OCR-B), e.g. `"GOEKHAN MEHMET"`. */
|
|
24
|
+
firstName: string;
|
|
25
|
+
/**
|
|
26
|
+
* Sex / gender.
|
|
27
|
+
* - `"M"` — male
|
|
28
|
+
* - `"F"` — female
|
|
29
|
+
* - `"X"` — unspecified / non-binary
|
|
30
|
+
* - `"U"` — unknown (not encoded on document)
|
|
31
|
+
*/
|
|
32
|
+
sex: 'M' | 'F' | 'X' | 'U';
|
|
33
|
+
/**
|
|
34
|
+
* Date of birth in `YYYY-MM-DD` format, e.g. `"1985-01-15"`.
|
|
35
|
+
* Null if the document does not encode it.
|
|
36
|
+
*/
|
|
37
|
+
dateOfBirth: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Document expiry date in `YYYY-MM-DD` format, e.g. `"2030-12-31"`.
|
|
40
|
+
* Null if the document does not encode it.
|
|
41
|
+
*/
|
|
42
|
+
dateOfExpiry: string | null;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=documentData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentData.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Types/documentData.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,YAAY,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;IAEjC,iEAAiE;IACjE,cAAc,EAAE,MAAM,CAAC;IAEvB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IAEpB,mEAAmE;IACnE,cAAc,EAAE,MAAM,CAAC;IAEvB,kGAAkG;IAClG,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IAEjB,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAE3B;;;OAGG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DocumentData } from './documentData';
|
|
2
|
+
/**
|
|
3
|
+
* How the display name was derived from the raw MRZ ASCII name.
|
|
4
|
+
*
|
|
5
|
+
* - `dg11` — read from the chip's DG11 supplemental data file (exact printed name)
|
|
6
|
+
* - `reverse_table` — reconstructed via country-aware ICAO 9303 reverse transliteration table
|
|
7
|
+
* - `raw` — no conversion applied; display equals the raw MRZ value
|
|
8
|
+
*/
|
|
9
|
+
export type DocumentNameSource = 'dg11' | 'reverse_table' | 'raw';
|
|
10
|
+
export interface DocumentName {
|
|
11
|
+
/** First name exactly as stored in the MRZ (ASCII, OCR-B, e.g. "GOEKHAN"). */
|
|
12
|
+
rawFirst: string;
|
|
13
|
+
/** Last name exactly as stored in the MRZ (ASCII, OCR-B, e.g. "OEZTUERK"). */
|
|
14
|
+
rawLast: string;
|
|
15
|
+
/** First name in best available Unicode form (e.g. "GÖKHAN"). */
|
|
16
|
+
displayFirst: string;
|
|
17
|
+
/** Last name in best available Unicode form (e.g. "ÖZTÜRK"). */
|
|
18
|
+
displayLast: string;
|
|
19
|
+
/** How displayFirst / displayLast were derived. */
|
|
20
|
+
source: DocumentNameSource;
|
|
21
|
+
}
|
|
22
|
+
export interface DocumentFaceImage {
|
|
23
|
+
/** Base64-encoded image data (no data-URI prefix). */
|
|
24
|
+
data: string;
|
|
25
|
+
/** MIME type, e.g. "image/jpeg" or "image/png". */
|
|
26
|
+
mimeType: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DocumentReadResult {
|
|
29
|
+
/** Normalized document data — consistent shape regardless of NFC or OCR source. */
|
|
30
|
+
document: DocumentData;
|
|
31
|
+
/**
|
|
32
|
+
* Name in both raw MRZ ASCII form and best-available Unicode display form.
|
|
33
|
+
* rawFirst / rawLast mirror document.firstName / document.lastName.
|
|
34
|
+
* displayFirst / displayLast are the Unicode-converted equivalents.
|
|
35
|
+
*/
|
|
36
|
+
name: DocumentName;
|
|
37
|
+
/**
|
|
38
|
+
* Face image — from the chip's DG2 file on the NFC path, or extracted from
|
|
39
|
+
* the document photo on the camera OCR path. Optional: only present when a
|
|
40
|
+
* face image was successfully obtained.
|
|
41
|
+
*/
|
|
42
|
+
face?: DocumentFaceImage;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=documentReadResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentReadResult.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Types/documentReadResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,eAAe,GAAG,KAAK,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,QAAQ,EAAE,YAAY,CAAC;IACvB;;;;OAIG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* MRZ Field Names - ICAO 9303 Standard Machine Readable Zone Fields
|
|
3
3
|
* Local type definitions to replace dependency on 'mrz' package
|
|
4
4
|
*/
|
|
5
|
-
export type MRZFieldName = 'documentCode' | 'issuingState' | 'documentNumber' | '
|
|
5
|
+
export type MRZFieldName = 'documentCode' | 'issuingState' | 'documentNumber' | 'nationality' | 'lastName' | 'firstName' | 'sex' | 'birthDate' | 'expirationDate' | 'personalNumber' | 'optional1' | 'optional2';
|
|
6
6
|
/**
|
|
7
7
|
* MRZ Fields - Parsed data from Machine Readable Zone
|
|
8
8
|
* Compatible with native module output
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mrzFields.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Types/mrzFields.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,cAAc,GACd,gBAAgB,GAChB,
|
|
1
|
+
{"version":3,"file":"mrzFields.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Types/mrzFields.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,UAAU,GACV,WAAW,GACX,KAAK,GACL,WAAW,GACX,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,WAAW,CAAC;AAEhB;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'react-native-get-random-values';
|
|
3
|
+
import type { DocumentReadResult } from './Shared/Types/documentReadResult';
|
|
3
4
|
interface TrustchexBranding {
|
|
4
5
|
logoUrl?: string;
|
|
5
6
|
primaryColor: string;
|
|
@@ -13,6 +14,14 @@ interface TrustchexProps {
|
|
|
13
14
|
locale?: 'en' | 'tr';
|
|
14
15
|
onCompleted?: () => void;
|
|
15
16
|
onError?: (error: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Called as soon as document data is available — immediately after a
|
|
19
|
+
* successful NFC chip read (before the user taps "Approve and Continue")
|
|
20
|
+
* or after a successful camera OCR scan. Receives MRZ fields (raw,
|
|
21
|
+
* untouched ASCII), a name object with both raw and best-available Unicode
|
|
22
|
+
* display form, and optionally the face image.
|
|
23
|
+
*/
|
|
24
|
+
onDocumentRead?: (result: DocumentReadResult) => void;
|
|
16
25
|
enableAnalytics?: boolean;
|
|
17
26
|
debug?: boolean;
|
|
18
27
|
logLevel?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trustchex.d.ts","sourceRoot":"","sources":["../../../src/Trustchex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAKf,OAAO,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"Trustchex.d.ts","sourceRoot":"","sources":["../../../src/Trustchex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAKf,OAAO,gCAAgC,CAAC;AAmBxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAc5E,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;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACtD,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,CA8PvC,CAAC;AAWF,eAAe,SAAS,CAAC"}
|
|
@@ -8,5 +8,7 @@ export type { AnalyticsConfig, AnalyticsEvent, ErrorSeverity, ErrorContext, Erro
|
|
|
8
8
|
export { default as mrzUtils } from './Shared/Libs/mrz.utils';
|
|
9
9
|
export type { MRZFormat, MRZValidationResult } from './Shared/Libs/mrz.utils';
|
|
10
10
|
export type { MRZFields, MRZFieldName } from './Shared/Types/mrzFields';
|
|
11
|
+
export type { DocumentData } from './Shared/Types/documentData';
|
|
12
|
+
export type { DocumentReadResult, DocumentName, DocumentNameSource, DocumentFaceImage, } from './Shared/Types/documentReadResult';
|
|
11
13
|
export default Trustchex;
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAO,GACR,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,aAAa,GACd,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAO,GACR,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,aAAa,GACd,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxE,YAAY,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAE3C,eAAe,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.484.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -96,10 +96,6 @@ const IdentityDocumentEIDScanningScreen = () => {
|
|
|
96
96
|
);
|
|
97
97
|
}, [appContext.currentWorkflowStep]);
|
|
98
98
|
|
|
99
|
-
if (!appContext.currentWorkflowStep) {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
99
|
return (
|
|
104
100
|
<SafeAreaView style={styles.safeAreaContainer}>
|
|
105
101
|
{documentNumber && dateOfBirth && dateOfExpiry ? (
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { MRZFields } from '../../Shared/Types/mrzFields';
|
|
4
|
+
import { buildDocumentName } from '../../Shared/Libs/mrzTransliteration';
|
|
5
|
+
import { normalizeFromMRZFields } from '../../Shared/Libs/documentDataNormalizer';
|
|
4
6
|
import { Alert, SafeAreaView, StyleSheet, View } from 'react-native';
|
|
5
7
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
8
|
import IdentityDocumentCamera, {
|
|
@@ -122,6 +124,27 @@ const IdentityDocumentScanningScreen = () => {
|
|
|
122
124
|
true
|
|
123
125
|
);
|
|
124
126
|
|
|
127
|
+
{
|
|
128
|
+
const documentData = normalizeFromMRZFields(mrzFields);
|
|
129
|
+
const faceImg = idFrontSideData?.faceImage || passportData?.faceImage;
|
|
130
|
+
const builtName = buildDocumentName(
|
|
131
|
+
documentData.firstName,
|
|
132
|
+
documentData.lastName,
|
|
133
|
+
documentData.issuingCountry
|
|
134
|
+
);
|
|
135
|
+
const documentReadResult = {
|
|
136
|
+
document: {
|
|
137
|
+
...documentData,
|
|
138
|
+
firstName: builtName.displayFirst,
|
|
139
|
+
lastName: builtName.displayLast,
|
|
140
|
+
},
|
|
141
|
+
name: builtName,
|
|
142
|
+
face: faceImg ? { data: faceImg, mimeType: 'image/jpeg' } : undefined,
|
|
143
|
+
};
|
|
144
|
+
appContext.setLastDocumentRead?.(documentReadResult);
|
|
145
|
+
appContext.onDocumentRead?.(documentReadResult);
|
|
146
|
+
}
|
|
147
|
+
|
|
125
148
|
setTimeout(
|
|
126
149
|
() => navigationManagerRef.current?.navigateToNextStep(),
|
|
127
150
|
1000
|
|
@@ -147,7 +147,11 @@ const VideoCallScreen = ({ navigation }: any) => {
|
|
|
147
147
|
const uploadService = new DataUploadService(baseUrl);
|
|
148
148
|
dataUploadServiceRef.current = uploadService;
|
|
149
149
|
const uploaded =
|
|
150
|
-
await uploadService.uploadCollectedData(
|
|
150
|
+
await uploadService.uploadCollectedData(
|
|
151
|
+
identificationInfo,
|
|
152
|
+
undefined,
|
|
153
|
+
appContext.lastDocumentRead?.name
|
|
154
|
+
);
|
|
151
155
|
if (!uploaded) {
|
|
152
156
|
console.warn('[VideoCallScreen] Upload service returned false');
|
|
153
157
|
if (mounted) {
|