@trustchex/react-native-sdk 1.500.2 → 1.501.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.
Files changed (97) hide show
  1. package/android/src/main/java/com/trustchex/reactnativesdk/GeolocationModule.kt +159 -0
  2. package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKPackage.kt +12 -0
  3. package/ios/Permission/CoarseLocationProvider.swift +111 -0
  4. package/ios/Permission/PermissionModule.m +4 -0
  5. package/ios/Permission/PermissionModule.swift +21 -1
  6. package/lib/module/Screens/Dynamic/AddressCaptureScreen.js +230 -0
  7. package/lib/module/Screens/Dynamic/ContractAcceptanceScreen.js +12 -0
  8. package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +33 -10
  9. package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +8 -10
  10. package/lib/module/Screens/Static/ResultScreen.js +74 -3
  11. package/lib/module/Shared/Components/EIDScanner.js +59 -3
  12. package/lib/module/Shared/Components/NavigationManager.js +6 -2
  13. package/lib/module/Shared/EIDReader/eidReader.js +52 -3
  14. package/lib/module/Shared/EIDReader/java/inputStream.js +6 -0
  15. package/lib/module/Shared/EIDReader/lds/icao/dg11File.js +60 -20
  16. package/lib/module/Shared/EIDReader/passiveAuth/der.js +93 -0
  17. package/lib/module/Shared/EIDReader/passiveAuth/integrity.js +71 -0
  18. package/lib/module/Shared/EIDReader/passiveAuth/sodParser.js +123 -0
  19. package/lib/module/Shared/Libs/chipVizMatch.js +93 -0
  20. package/lib/module/Shared/Libs/country-allow.js +16 -0
  21. package/lib/module/Shared/Libs/documentDataNormalizer.js +21 -11
  22. package/lib/module/Shared/Libs/geolocation.utils.js +77 -0
  23. package/lib/module/Shared/Libs/promise.utils.js +6 -0
  24. package/lib/module/Shared/Services/DataUploadService.js +18 -1
  25. package/lib/module/Translation/Resources/en.js +16 -0
  26. package/lib/module/Translation/Resources/tr.js +16 -0
  27. package/lib/module/Trustchex.js +4 -0
  28. package/lib/module/version.js +1 -1
  29. package/lib/typescript/src/Screens/Dynamic/AddressCaptureScreen.d.ts +9 -0
  30. package/lib/typescript/src/Screens/Dynamic/AddressCaptureScreen.d.ts.map +1 -0
  31. package/lib/typescript/src/Screens/Dynamic/ContractAcceptanceScreen.d.ts.map +1 -1
  32. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts.map +1 -1
  33. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts.map +1 -1
  34. package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
  35. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts +7 -1
  36. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -1
  37. package/lib/typescript/src/Shared/Components/NavigationManager.d.ts.map +1 -1
  38. package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts +14 -1
  39. package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts.map +1 -1
  40. package/lib/typescript/src/Shared/EIDReader/java/inputStream.d.ts +3 -0
  41. package/lib/typescript/src/Shared/EIDReader/java/inputStream.d.ts.map +1 -1
  42. package/lib/typescript/src/Shared/EIDReader/lds/icao/dg11File.d.ts +20 -7
  43. package/lib/typescript/src/Shared/EIDReader/lds/icao/dg11File.d.ts.map +1 -1
  44. package/lib/typescript/src/Shared/EIDReader/passiveAuth/der.d.ts +31 -0
  45. package/lib/typescript/src/Shared/EIDReader/passiveAuth/der.d.ts.map +1 -0
  46. package/lib/typescript/src/Shared/EIDReader/passiveAuth/integrity.d.ts +31 -0
  47. package/lib/typescript/src/Shared/EIDReader/passiveAuth/integrity.d.ts.map +1 -0
  48. package/lib/typescript/src/Shared/EIDReader/passiveAuth/sodParser.d.ts +12 -0
  49. package/lib/typescript/src/Shared/EIDReader/passiveAuth/sodParser.d.ts.map +1 -0
  50. package/lib/typescript/src/Shared/Libs/chipVizMatch.d.ts +68 -0
  51. package/lib/typescript/src/Shared/Libs/chipVizMatch.d.ts.map +1 -0
  52. package/lib/typescript/src/Shared/Libs/country-allow.d.ts +10 -0
  53. package/lib/typescript/src/Shared/Libs/country-allow.d.ts.map +1 -0
  54. package/lib/typescript/src/Shared/Libs/documentDataNormalizer.d.ts.map +1 -1
  55. package/lib/typescript/src/Shared/Libs/geolocation.utils.d.ts +19 -0
  56. package/lib/typescript/src/Shared/Libs/geolocation.utils.d.ts.map +1 -0
  57. package/lib/typescript/src/Shared/Libs/promise.utils.d.ts.map +1 -1
  58. package/lib/typescript/src/Shared/Services/DataUploadService.d.ts.map +1 -1
  59. package/lib/typescript/src/Shared/Types/documentData.d.ts +7 -0
  60. package/lib/typescript/src/Shared/Types/documentData.d.ts.map +1 -1
  61. package/lib/typescript/src/Shared/Types/documentReadResult.d.ts +20 -0
  62. package/lib/typescript/src/Shared/Types/documentReadResult.d.ts.map +1 -1
  63. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +95 -2
  64. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -1
  65. package/lib/typescript/src/Translation/Resources/en.d.ts +16 -0
  66. package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
  67. package/lib/typescript/src/Translation/Resources/tr.d.ts +16 -0
  68. package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
  69. package/lib/typescript/src/Trustchex.d.ts.map +1 -1
  70. package/lib/typescript/src/version.d.ts +1 -1
  71. package/package.json +1 -1
  72. package/src/Screens/Dynamic/AddressCaptureScreen.tsx +196 -0
  73. package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +12 -0
  74. package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +46 -14
  75. package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +9 -11
  76. package/src/Screens/Static/ResultScreen.tsx +101 -6
  77. package/src/Shared/Components/EIDScanner.tsx +69 -2
  78. package/src/Shared/Components/NavigationManager.tsx +6 -0
  79. package/src/Shared/EIDReader/eidReader.ts +75 -2
  80. package/src/Shared/EIDReader/java/inputStream.ts +6 -0
  81. package/src/Shared/EIDReader/lds/icao/dg11File.ts +68 -22
  82. package/src/Shared/EIDReader/passiveAuth/der.ts +110 -0
  83. package/src/Shared/EIDReader/passiveAuth/integrity.ts +97 -0
  84. package/src/Shared/EIDReader/passiveAuth/sodParser.ts +142 -0
  85. package/src/Shared/Libs/chipVizMatch.ts +149 -0
  86. package/src/Shared/Libs/country-allow.ts +17 -0
  87. package/src/Shared/Libs/documentDataNormalizer.ts +24 -11
  88. package/src/Shared/Libs/geolocation.utils.ts +87 -0
  89. package/src/Shared/Libs/promise.utils.ts +11 -0
  90. package/src/Shared/Services/DataUploadService.ts +23 -0
  91. package/src/Shared/Types/documentData.ts +8 -0
  92. package/src/Shared/Types/documentReadResult.ts +20 -0
  93. package/src/Shared/Types/identificationInfo.ts +97 -2
  94. package/src/Translation/Resources/en.ts +21 -0
  95. package/src/Translation/Resources/tr.ts +21 -0
  96. package/src/Trustchex.tsx +5 -0
  97. package/src/version.ts +1 -1
@@ -1,5 +1,6 @@
1
1
  import type { MRZFields } from './mrzFields';
2
2
  import type { LivenessInstructionType } from './livenessIntructionType';
3
+ import type { ChipVizMatchResult } from '../Libs/chipVizMatch';
3
4
 
4
5
  export interface IdentificationInfo {
5
6
  sessionId: string;
@@ -7,8 +8,21 @@ export interface IdentificationInfo {
7
8
  consent: {
8
9
  contractIds: string[];
9
10
  deviceInfo: string;
11
+ /**
12
+ * Coarse device geolocation ("lat,lng"), captured when a workflow step
13
+ * enables collectGeolocation (MASAK §4/C(1)(e) technical data). Optional —
14
+ * null/absent when not collected or unavailable.
15
+ */
16
+ geolocation?: string | null;
17
+ /**
18
+ * True when the workflow step required geolocation (collectGeolocation). Lets
19
+ * the server raise a suspicion signal if geolocation came back null.
20
+ */
21
+ geolocationExpected?: boolean;
10
22
  };
11
23
  scannedDocument?: ScannedIdentityDocument;
24
+ /** Captured address + proof document (MASAK 4/C(1)(d) ADDRESS_CAPTURE step). */
25
+ address?: CapturedAddress;
12
26
  livenessDetection?: LivenessDetection;
13
27
  locale: string;
14
28
  authToken?: string;
@@ -36,6 +50,25 @@ export interface ScannedIdentityDocument {
36
50
  barcodeValue?: string;
37
51
  mrzText?: string;
38
52
  mrzFields?: MRZFields;
53
+ /**
54
+ * The printed/VIZ MRZ from the camera scan, preserved separately from
55
+ * mrzFields (which the EID path overwrites with the chip MRZ). Sent to the
56
+ * backend so it can independently re-derive the chip↔VIZ match (MASAK 4/C).
57
+ */
58
+ vizMrzFields?: MRZFields;
59
+ /**
60
+ * The client-side chip↔VIZ match verdict. Advisory — the server re-derives
61
+ * the authoritative verdict. Recorded for every EID scan as a security signal.
62
+ */
63
+ chipVizMatch?: ChipVizMatchResult;
64
+ /**
65
+ * Passive Authentication artifacts (ICAO 9303-11 §5.1), present only when the
66
+ * eID step ran with passiveAuth. `paSodBase64` is the raw EF.SOD for
67
+ * server-side signature + CSCA chaining; `paIntegrityStatus` is the
68
+ * on-device DG-hash check.
69
+ */
70
+ paSodBase64?: string | null;
71
+ paIntegrityStatus?: 'MATCH' | 'TAMPERED' | 'INCOMPLETE' | null;
39
72
  }
40
73
 
41
74
  export interface LivenessDetection {
@@ -43,6 +76,23 @@ export interface LivenessDetection {
43
76
  videoPath: string;
44
77
  }
45
78
 
79
+ /**
80
+ * Address captured in the ADDRESS_CAPTURE step (MASAK 4/C(1)(d)). The text may
81
+ * be pre-filled from the chip's DG11 address and edited by the user. The proof
82
+ * image is a photo/scan of a supporting document (residence cert, utility bill
83
+ * ≤3 months, public-authority doc).
84
+ */
85
+ export interface CapturedAddress {
86
+ /** Free-form address line(s) as entered/confirmed by the user. */
87
+ addressText: string;
88
+ /** True when the addressText was pre-filled from the chip's DG11 address. */
89
+ fromChip: boolean;
90
+ /** Base64 proof-document image (no data-URI prefix), if captured. */
91
+ proofImage?: string;
92
+ /** MIME type of proofImage, e.g. "image/jpeg". */
93
+ proofImageMimeType?: string;
94
+ }
95
+
46
96
  export interface WorkflowStep {
47
97
  id?: string;
48
98
  type:
@@ -52,7 +102,8 @@ export interface WorkflowStep {
52
102
  | 'LIVENESS_CHECK'
53
103
  | 'VERBAL_CONSENT'
54
104
  | 'AML_CHECK'
55
- | 'VIDEO_CALL';
105
+ | 'VIDEO_CALL'
106
+ | 'ADDRESS_CAPTURE';
56
107
  data?: {
57
108
  contracts?: {
58
109
  en: {
@@ -67,11 +118,55 @@ export interface WorkflowStep {
67
118
  };
68
119
  };
69
120
  allowedDocumentTypes?: ('I' | 'P')[] | null;
70
- allowedCountries?: 'TUR'[] | null;
121
+ /** ICAO-3 allow-list of accepted document issuers/nationalities. Empty/unset
122
+ * = all allowed. Server-driven, so the client treats these as opaque codes. */
123
+ allowedCountries?: string[] | null;
71
124
  allowedLivenessInstructionTypes?: LivenessInstructionType[] | null;
72
125
  voiceGuidanceActive?: boolean;
73
126
  verbalConsentTitle?: string | null;
74
127
  verbalConsentText?: string | null;
128
+ /**
129
+ * Collect coarse device geolocation during this step (MASAK 4/C(1)(e)
130
+ * technical data). Server-driven per-step config; defaults to off.
131
+ */
132
+ collectGeolocation?: boolean;
133
+ /**
134
+ * Terminal-reject the identification server-side when the chip↔VIZ verdict
135
+ * is not MATCH (MASAK 4/C(1)(b)). Enforcement is SERVER-SIDE only — the
136
+ * client never blocks or surfaces the verdict to the user; it computes the
137
+ * verdict and sends it to the backend, which decides. Defaults to off.
138
+ */
139
+ enforceChipVizMatch?: boolean;
140
+ /**
141
+ * Whether a proof document is required in the ADDRESS_CAPTURE step
142
+ * (MASAK 4/C(1)(d)). Defaults to true; set false to allow address-only.
143
+ */
144
+ addressProofRequired?: boolean;
145
+ /**
146
+ * Run Passive Authentication on the eID scan (ICAO 9303-11 §5.1 / MASAK
147
+ * 4/C(1)(b),(c)): read EF.SOD, verify on-device DG-hash integrity, and send
148
+ * the SOD for server-side signature + CSCA chaining. Adds NFC time (re-reads
149
+ * SOD + DGs); defaults to off.
150
+ */
151
+ passiveAuth?: boolean;
152
+ /**
153
+ * Risky-country block (MASAK 4/C(3)): 3-letter ICAO nationality codes the
154
+ * obligated party may not accept via the remote-passport flow. Enforced
155
+ * server-side — a document whose nationality is on this list is rejected.
156
+ */
157
+ blockedNationalities?: string[];
158
+ /**
159
+ * Require a trained operator in the video interview (MASAK 4/C(1)(a)): the
160
+ * VIDEO_CALL step must have had an operator connected, not just completed.
161
+ * Enforced server-side. Defaults to off.
162
+ */
163
+ requireOperator?: boolean;
164
+ /**
165
+ * Terminal-reject the identification server-side when Passive Authentication
166
+ * comes back TAMPERED. Defaults to off (the verdict is recorded and
167
+ * withholds the step score, but does not hard-reject unless enabled).
168
+ */
169
+ enforcePassiveAuth?: boolean;
75
170
  };
76
171
  required: boolean;
77
172
  }
@@ -15,6 +15,8 @@ export default {
15
15
  'verificationSessionCheckScreen.or': 'or',
16
16
  'general.warning': 'Warning',
17
17
  'general.error': 'Error',
18
+ 'general.continue': 'Continue',
19
+ 'general.cancel': 'Cancel',
18
20
  'general.yes': 'Yes',
19
21
  'general.no': 'No',
20
22
  'general.letsGo': 'Start',
@@ -33,6 +35,8 @@ export default {
33
35
  'termsOfUseAndDataPrivacyScreen.acceptAndContinue': 'Accept and Continue',
34
36
  'resultScreen.submitting': 'Submitting your information...',
35
37
  'resultScreen.submissionFailed': 'An error occurred. Please try again later.',
38
+ 'resultScreen.sessionTerminated':
39
+ 'This verification could not be completed and has been ended. Please contact support if you believe this is an error.',
36
40
  'resultScreen.submissionFailedTitle': 'Submission failed',
37
41
  'resultScreen.submissionFailedRetryHint':
38
42
  'We could not submit your verification. Your information is saved — you can try again without re-scanning.',
@@ -120,10 +124,27 @@ export default {
120
124
  'Connection to the document was lost. Keep the document still against the device and try again.',
121
125
  'eidScannerScreen.nfcTimeout':
122
126
  'Reading the chip timed out. Hold the document steady against the device and try again.',
127
+ 'addressCaptureScreen.title': 'Confirm your address',
128
+ 'addressCaptureScreen.subtitle':
129
+ 'Enter your current residential address and provide a supporting document.',
130
+ 'addressCaptureScreen.prefilledFromChip':
131
+ 'We pre-filled your address from your document chip. Please review and correct it if needed.',
132
+ 'addressCaptureScreen.addressLabel': 'Address',
133
+ 'addressCaptureScreen.addressPlaceholder': 'Street, number, city, country',
134
+ 'addressCaptureScreen.proofLabel': 'Proof of address',
135
+ 'addressCaptureScreen.proofHint':
136
+ 'A residence certificate, or a utility bill issued within the last 3 months, or a document from a public authority.',
137
+ 'addressCaptureScreen.captureProof': 'Capture proof document',
138
+ 'addressCaptureScreen.retakeProof': 'Retake proof document',
139
+ 'addressCaptureScreen.proofCameraHint':
140
+ 'Position the document within the frame and capture.',
141
+ 'addressCaptureScreen.capture': 'Capture',
123
142
  'eidScannerScreen.faceImageNotFound': 'Photo data not found on document.',
124
143
  'eidScannerScreen.documentCode': 'Document Type',
125
144
  'eidScannerScreen.nationality': 'Nationality',
126
145
  'eidScannerScreen.personalNumber': 'Personal Number',
146
+ 'eidScannerScreen.address': 'Address',
147
+ 'eidScannerScreen.location': 'Location',
127
148
  'eidScannerScreen.documentNumber': 'Document Number',
128
149
  'eidScannerScreen.name': 'Name',
129
150
  'eidScannerScreen.surname': 'Surname',
@@ -14,6 +14,8 @@ export default {
14
14
  'verificationSessionCheckScreen.or': 'veya',
15
15
  'general.warning': 'Uyarı',
16
16
  'general.error': 'Hata',
17
+ 'general.continue': 'Devam Et',
18
+ 'general.cancel': 'İptal',
17
19
  'general.yes': 'Evet',
18
20
  'general.no': 'Hayır',
19
21
  'general.letsGo': 'Başla',
@@ -33,6 +35,8 @@ export default {
33
35
  'resultScreen.submitting': 'Bilgileriniz gönderiliyor...',
34
36
  'resultScreen.submissionFailed':
35
37
  'Bir hata oluştu. Lütfen daha sonra tekrar deneyin.',
38
+ 'resultScreen.sessionTerminated':
39
+ 'Bu doğrulama tamamlanamadı ve sonlandırıldı. Bir hata olduğunu düşünüyorsanız lütfen destek ekibiyle iletişime geçin.',
36
40
  'resultScreen.submissionFailedTitle': 'Gönderim başarısız',
37
41
  'resultScreen.submissionFailedRetryHint':
38
42
  'Doğrulamanız gönderilemedi. Bilgileriniz kaydedildi — yeniden taramadan tekrar deneyebilirsiniz.',
@@ -120,10 +124,27 @@ export default {
120
124
  'Belge ile bağlantı kesildi. Belgeyi cihaza sabit tutun ve tekrar deneyin.',
121
125
  'eidScannerScreen.nfcTimeout':
122
126
  'Çip okuması zaman aşımına uğradı. Belgeyi cihaza sabit tutup tekrar deneyin.',
127
+ 'addressCaptureScreen.title': 'Adresinizi doğrulayın',
128
+ 'addressCaptureScreen.subtitle':
129
+ 'Güncel yerleşim adresinizi girin ve destekleyici bir belge sağlayın.',
130
+ 'addressCaptureScreen.prefilledFromChip':
131
+ 'Adresiniz belge yongasından önceden dolduruldu. Lütfen kontrol edin ve gerekirse düzeltin.',
132
+ 'addressCaptureScreen.addressLabel': 'Adres',
133
+ 'addressCaptureScreen.addressPlaceholder': 'Cadde, numara, şehir, ülke',
134
+ 'addressCaptureScreen.proofLabel': 'Adres kanıtı',
135
+ 'addressCaptureScreen.proofHint':
136
+ 'Yerleşim yeri belgesi veya son 3 ay içinde düzenlenmiş bir fatura ya da bir kamu kurumu tarafından verilen belge.',
137
+ 'addressCaptureScreen.captureProof': 'Kanıt belgesini çek',
138
+ 'addressCaptureScreen.retakeProof': 'Kanıt belgesini yeniden çek',
139
+ 'addressCaptureScreen.proofCameraHint':
140
+ 'Belgeyi çerçeveye yerleştirin ve fotoğraf çekin.',
141
+ 'addressCaptureScreen.capture': 'Çek',
123
142
  'eidScannerScreen.faceImageNotFound': 'Belgede fotoğraf verisi bulunamadı.',
124
143
  'eidScannerScreen.documentCode': 'Belge Türü',
125
144
  'eidScannerScreen.nationality': 'Uyruk',
126
145
  'eidScannerScreen.personalNumber': 'Vatandaşlık No',
146
+ 'eidScannerScreen.address': 'Adres',
147
+ 'eidScannerScreen.location': 'Konum',
127
148
  'eidScannerScreen.documentNumber': 'Belge No',
128
149
  'eidScannerScreen.name': 'Ad',
129
150
  'eidScannerScreen.surname': 'Soyad',
package/src/Trustchex.tsx CHANGED
@@ -23,6 +23,7 @@ import VerificationSessionCheckScreen from './Screens/Static/VerificationSession
23
23
  import QrCodeScanningScreen from './Screens/Static/QrCodeScanningScreen';
24
24
  import VideoCallScreen from './Screens/Dynamic/VideoCallScreen';
25
25
  import VerbalConsentScreen from './Screens/Dynamic/VerbalConsentScreen';
26
+ import AddressCaptureScreen from './Screens/Dynamic/AddressCaptureScreen';
26
27
  import OTPVerificationScreen from './Screens/Static/OTPVerificationScreen';
27
28
  import MRZTestScreen from './Screens/Debug/MRZTestScreen';
28
29
  import BarcodeTestScreen from './Screens/Debug/BarcodeTestScreen';
@@ -328,6 +329,10 @@ const Trustchex: React.FC<TrustchexProps> = ({
328
329
  name="VerbalConsentScreen"
329
330
  component={VerbalConsentScreen}
330
331
  />
332
+ <Stack.Screen
333
+ name="AddressCaptureScreen"
334
+ component={AddressCaptureScreen}
335
+ />
331
336
  <Stack.Screen name="MRZTestScreen" component={MRZTestScreen} />
332
337
  <Stack.Screen
333
338
  name="BarcodeTestScreen"
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file is auto-generated. Do not edit manually.
2
2
  // Version is synced from package.json during build.
3
- export const SDK_VERSION = '1.500.2';
3
+ export const SDK_VERSION = '1.501.1';