@transfergratis/react-native-sdk 0.1.4 → 0.1.6

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 (216) hide show
  1. package/build/api/axios.d.ts +30 -0
  2. package/build/api/axios.d.ts.map +1 -0
  3. package/build/api/axios.js +92 -0
  4. package/build/api/axios.js.map +1 -0
  5. package/build/components/EnhancedCameraView.d.ts +1 -41
  6. package/build/components/EnhancedCameraView.d.ts.map +1 -1
  7. package/build/components/EnhancedCameraView.js +75 -34
  8. package/build/components/EnhancedCameraView.js.map +1 -1
  9. package/build/components/EnhancedCameraView.web.d.ts +1 -41
  10. package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
  11. package/build/components/EnhancedCameraView.web.js +28 -4
  12. package/build/components/EnhancedCameraView.web.js.map +1 -1
  13. package/build/components/KYCElements/CountrySelectionTemplate.d.ts +2 -2
  14. package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
  15. package/build/components/KYCElements/CountrySelectionTemplate.js +77 -114
  16. package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
  17. package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
  18. package/build/components/KYCElements/FileUploadTemplate.js +7 -3
  19. package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
  20. package/build/components/KYCElements/IDCardCapture.d.ts +7 -2
  21. package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  22. package/build/components/KYCElements/IDCardCapture.js +253 -104
  23. package/build/components/KYCElements/IDCardCapture.js.map +1 -1
  24. package/build/components/KYCElements/InitializationStep.d.ts +5 -0
  25. package/build/components/KYCElements/InitializationStep.d.ts.map +1 -0
  26. package/build/components/KYCElements/InitializationStep.js +41 -0
  27. package/build/components/KYCElements/InitializationStep.js.map +1 -0
  28. package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
  29. package/build/components/KYCElements/LocationCaptureTemplate.js +15 -13
  30. package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
  31. package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -2
  32. package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
  33. package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
  34. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -2
  35. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
  36. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
  37. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -2
  38. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
  39. package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
  40. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts +12 -0
  41. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts.map +1 -0
  42. package/build/components/KYCElements/ReviewSubmitTemplate.js +171 -0
  43. package/build/components/KYCElements/ReviewSubmitTemplate.js.map +1 -0
  44. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +6 -2
  45. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
  46. package/build/components/KYCElements/SelfieCaptureTemplate.js +137 -38
  47. package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
  48. package/build/components/KYCElements/VerificationProgressTemplate.d.ts +12 -0
  49. package/build/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -0
  50. package/build/components/KYCElements/VerificationProgressTemplate.js +194 -0
  51. package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
  52. package/build/components/OverLay/IdCard.d.ts +1 -1
  53. package/build/components/OverLay/IdCard.d.ts.map +1 -1
  54. package/build/components/OverLay/IdCard.js +10 -6
  55. package/build/components/OverLay/IdCard.js.map +1 -1
  56. package/build/components/OverLay/SelfieOverlay.d.ts +1 -1
  57. package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -1
  58. package/build/components/OverLay/SelfieOverlay.js +5 -4
  59. package/build/components/OverLay/SelfieOverlay.js.map +1 -1
  60. package/build/components/OverLay/type.d.ts +71 -1
  61. package/build/components/OverLay/type.d.ts.map +1 -1
  62. package/build/components/OverLay/type.js.map +1 -1
  63. package/build/components/TemplateKYCExample.d.ts +4 -1
  64. package/build/components/TemplateKYCExample.d.ts.map +1 -1
  65. package/build/components/TemplateKYCExample.js +74 -199
  66. package/build/components/TemplateKYCExample.js.map +1 -1
  67. package/build/components/TemplateKYCFlowRefactored.d.ts +3 -2
  68. package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
  69. package/build/components/TemplateKYCFlowRefactored.js +64 -40
  70. package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
  71. package/build/components/example/OrientationVideoExample.d.ts.map +1 -1
  72. package/build/components/example/OrientationVideoExample.js +1 -5
  73. package/build/components/example/OrientationVideoExample.js.map +1 -1
  74. package/build/config/countriesData.d.ts +3 -0
  75. package/build/config/countriesData.d.ts.map +1 -0
  76. package/build/config/countriesData.js +79 -0
  77. package/build/config/countriesData.js.map +1 -0
  78. package/build/config/region_mapping.d.ts +3 -0
  79. package/build/config/region_mapping.d.ts.map +1 -0
  80. package/build/config/region_mapping.js +687 -0
  81. package/build/config/region_mapping.js.map +1 -0
  82. package/build/hooks/useI18n.d.ts +11 -0
  83. package/build/hooks/useI18n.d.ts.map +1 -0
  84. package/build/hooks/useI18n.js +37 -0
  85. package/build/hooks/useI18n.js.map +1 -0
  86. package/build/hooks/useOrientationVideo.d.ts +1 -2
  87. package/build/hooks/useOrientationVideo.d.ts.map +1 -1
  88. package/build/hooks/useOrientationVideo.js +2 -1
  89. package/build/hooks/useOrientationVideo.js.map +1 -1
  90. package/build/hooks/useRealtimeVerifier.d.ts +28 -0
  91. package/build/hooks/useRealtimeVerifier.d.ts.map +1 -0
  92. package/build/hooks/useRealtimeVerifier.js +91 -0
  93. package/build/hooks/useRealtimeVerifier.js.map +1 -0
  94. package/build/hooks/useTemplateKYCFlow.d.ts +6 -3
  95. package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  96. package/build/hooks/useTemplateKYCFlow.js +356 -42
  97. package/build/hooks/useTemplateKYCFlow.js.map +1 -1
  98. package/build/i18n/en/index.d.ts +168 -0
  99. package/build/i18n/en/index.d.ts.map +1 -0
  100. package/build/i18n/en/index.js +195 -0
  101. package/build/i18n/en/index.js.map +1 -0
  102. package/build/i18n/fr/index.d.ts +168 -0
  103. package/build/i18n/fr/index.d.ts.map +1 -0
  104. package/build/i18n/fr/index.js +194 -0
  105. package/build/i18n/fr/index.js.map +1 -0
  106. package/build/i18n/index.d.ts +10 -0
  107. package/build/i18n/index.d.ts.map +1 -0
  108. package/build/i18n/index.js +56 -0
  109. package/build/i18n/index.js.map +1 -0
  110. package/build/i18n/types.d.ts +153 -0
  111. package/build/i18n/types.d.ts.map +1 -0
  112. package/build/i18n/types.js +3 -0
  113. package/build/i18n/types.js.map +1 -0
  114. package/build/i18n/usage-example.d.ts +4 -0
  115. package/build/i18n/usage-example.d.ts.map +1 -0
  116. package/build/i18n/usage-example.js +189 -0
  117. package/build/i18n/usage-example.js.map +1 -0
  118. package/build/index.d.ts +1 -0
  119. package/build/index.d.ts.map +1 -1
  120. package/build/index.js +2 -0
  121. package/build/index.js.map +1 -1
  122. package/build/modules/api/CardAuthentification.d.ts +22 -0
  123. package/build/modules/api/CardAuthentification.d.ts.map +1 -0
  124. package/build/modules/api/CardAuthentification.js +107 -0
  125. package/build/modules/api/CardAuthentification.js.map +1 -0
  126. package/build/modules/api/KYCService.d.ts +58 -1
  127. package/build/modules/api/KYCService.d.ts.map +1 -1
  128. package/build/modules/api/KYCService.js +304 -27
  129. package/build/modules/api/KYCService.js.map +1 -1
  130. package/build/modules/api/SelfieVerification.d.ts +3 -0
  131. package/build/modules/api/SelfieVerification.d.ts.map +1 -0
  132. package/build/modules/api/SelfieVerification.js +9 -0
  133. package/build/modules/api/SelfieVerification.js.map +1 -0
  134. package/build/modules/api/backendApi.d.ts +2 -0
  135. package/build/modules/api/backendApi.d.ts.map +1 -0
  136. package/build/modules/api/backendApi.js +6 -0
  137. package/build/modules/api/backendApi.js.map +1 -0
  138. package/build/modules/api/types.d.ts +45 -0
  139. package/build/modules/api/types.d.ts.map +1 -0
  140. package/build/modules/api/types.js +2 -0
  141. package/build/modules/api/types.js.map +1 -0
  142. package/build/types/KYC.types.d.ts +56 -7
  143. package/build/types/KYC.types.d.ts.map +1 -1
  144. package/build/types/KYC.types.js +9 -1
  145. package/build/types/KYC.types.js.map +1 -1
  146. package/build/utils/cropByObb.d.ts +11 -0
  147. package/build/utils/cropByObb.d.ts.map +1 -0
  148. package/build/utils/cropByObb.js +78 -0
  149. package/build/utils/cropByObb.js.map +1 -0
  150. package/build/utils/get-document-type-info.d.ts +13 -0
  151. package/build/utils/get-document-type-info.d.ts.map +1 -0
  152. package/build/utils/get-document-type-info.js +59 -0
  153. package/build/utils/get-document-type-info.js.map +1 -0
  154. package/build/utils/pathToBase64.d.ts +3 -0
  155. package/build/utils/pathToBase64.d.ts.map +1 -0
  156. package/build/utils/pathToBase64.js +47 -0
  157. package/build/utils/pathToBase64.js.map +1 -0
  158. package/build/utils/remove-duplicate.d.ts +2 -0
  159. package/build/utils/remove-duplicate.d.ts.map +1 -0
  160. package/build/utils/remove-duplicate.js +4 -0
  161. package/build/utils/remove-duplicate.js.map +1 -0
  162. package/build/web/WebKYCEntry.d.ts +9 -0
  163. package/build/web/WebKYCEntry.d.ts.map +1 -0
  164. package/build/web/WebKYCEntry.js +156 -0
  165. package/build/web/WebKYCEntry.js.map +1 -0
  166. package/build/web/index.d.ts +2 -0
  167. package/build/web/index.d.ts.map +1 -0
  168. package/build/web/index.js +2 -0
  169. package/build/web/index.js.map +1 -0
  170. package/package.json +3 -1
  171. package/src/api/axios.ts +144 -0
  172. package/src/components/EnhancedCameraView.tsx +96 -78
  173. package/src/components/EnhancedCameraView.web.tsx +41 -40
  174. package/src/components/KYCElements/CountrySelectionTemplate.tsx +111 -136
  175. package/src/components/KYCElements/FileUploadTemplate.tsx +14 -8
  176. package/src/components/KYCElements/IDCardCapture.tsx +311 -115
  177. package/src/components/KYCElements/InitializationStep.tsx +53 -0
  178. package/src/components/KYCElements/LocationCaptureTemplate.tsx +17 -15
  179. package/src/components/KYCElements/OrientationVideoCapture.tsx +2 -2
  180. package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +2 -2
  181. package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +2 -2
  182. package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
  183. package/src/components/KYCElements/SelfieCaptureTemplate.tsx +174 -57
  184. package/src/components/KYCElements/VerificationProgressTemplate.tsx +246 -0
  185. package/src/components/OverLay/IdCard.tsx +17 -9
  186. package/src/components/OverLay/SelfieOverlay.tsx +6 -5
  187. package/src/components/OverLay/type.ts +64 -2
  188. package/src/components/TemplateKYCExample.tsx +80 -200
  189. package/src/components/TemplateKYCFlowRefactored.tsx +80 -48
  190. package/src/components/example/OrientationVideoExample.tsx +3 -7
  191. package/src/config/countriesData.ts +84 -0
  192. package/src/config/region_mapping.ts +688 -0
  193. package/src/hooks/useI18n.ts +53 -0
  194. package/src/hooks/useOrientationVideo.ts +2 -2
  195. package/src/hooks/useRealtimeVerifier.ts +128 -0
  196. package/src/hooks/useTemplateKYCFlow.tsx +407 -57
  197. package/src/i18n/README.md +288 -0
  198. package/src/i18n/en/index.ts +206 -0
  199. package/src/i18n/fr/index.ts +205 -0
  200. package/src/i18n/index.ts +65 -0
  201. package/src/i18n/types.ts +172 -0
  202. package/src/i18n/usage-example.tsx +202 -0
  203. package/src/index.ts +3 -0
  204. package/src/modules/api/CardAuthentification.ts +114 -0
  205. package/src/modules/api/KYCService.ts +350 -30
  206. package/src/modules/api/SelfieVerification.ts +11 -0
  207. package/src/modules/api/backendApi.ts +8 -0
  208. package/src/modules/api/types.ts +51 -0
  209. package/src/types/KYC.types.ts +82 -14
  210. package/src/utils/cropByObb.ts +99 -0
  211. package/src/utils/get-document-type-info.ts +62 -0
  212. package/src/utils/pathToBase64.ts +47 -0
  213. package/src/utils/remove-duplicate.ts +3 -0
  214. package/src/web/WebKYCEntry.tsx +215 -0
  215. package/src/web/index.ts +1 -0
  216. package/src/types/nativewind.d.ts +0 -2
@@ -1,7 +1,15 @@
1
1
  import axios from 'axios';
2
+ import { GovernmentDocumentTypeShorted } from '../../types/KYC.types';
2
3
  export class KYCService {
3
4
  baseURL;
4
5
  apiKey;
6
+ // Additional service base URLs (fixed as per current infra)
7
+ faceServiceURL = 'http://kyc-ecs-alb-278715158.us-east-2.elb.amazonaws.com:8000';
8
+ textExtractionServiceURL = 'http://kyc-ecs-alb-278715158.us-east-2.elb.amazonaws.com:8006';
9
+ mrzServiceURL = 'http://kyc-ecs-alb-278715158.us-east-2.elb.amazonaws.com:8002';
10
+ barcodeServiceURL = 'http://kyc-ecs-alb-278715158.us-east-2.elb.amazonaws.com:8000';
11
+ orientationServiceURL = 'http://18.188.180.154:8080';
12
+ backendServiceURL = 'http://16.170.133.50/api/v1';
5
13
  constructor(baseURL, apiKey) {
6
14
  this.baseURL = baseURL;
7
15
  this.apiKey = apiKey;
@@ -52,36 +60,40 @@ export class KYCService {
52
60
  throw error;
53
61
  }
54
62
  }
63
+ async processSelfieOrientationPicture(videoFile, token) {
64
+ try {
65
+ const formData = new FormData();
66
+ const rnFile = {
67
+ uri: videoFile,
68
+ type: 'image/jpeg',
69
+ name: 'selfie_picture.jpg',
70
+ };
71
+ formData.append('file', rnFile);
72
+ const response = await axios.post(`${this.faceServiceURL}/detect_face_orientation/`, formData, {
73
+ timeout: 20000,
74
+ headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },
75
+ });
76
+ return response.data;
77
+ }
78
+ catch (error) {
79
+ console.error('Error processing selfie orientation:', error);
80
+ throw error;
81
+ }
82
+ }
55
83
  async processOrientationVideo(videoFile) {
56
84
  try {
57
85
  // Create FormData for multipart/form-data request
58
86
  const formData = new FormData();
59
- // Convert base64 to blob if needed, or use file path
60
- let fileData;
61
- if (videoFile.startsWith('data:') || videoFile.startsWith('file://')) {
62
- // Handle base64 or file URI
63
- if (videoFile.startsWith('data:')) {
64
- const response = await fetch(videoFile);
65
- fileData = await response.blob();
66
- }
67
- else {
68
- // For file:// URIs, we need to handle this differently
69
- // This is a simplified approach - in a real implementation,
70
- // you might need platform-specific handling
71
- const response = await fetch(videoFile);
72
- fileData = await response.blob();
73
- }
74
- }
75
- else {
76
- // Assume it's already a blob or file object
77
- fileData = videoFile;
78
- }
79
- formData.append('file', fileData, 'orientation_video.mp4');
80
- const response = await axios.post(`${this.baseURL}/process_orientation_video_stream/`, formData, {
81
- headers: {
82
- // 'Authorization': `Bearer ${this.apiKey}`,
83
- 'Content-Type': 'multipart/form-data',
84
- }
87
+ // In React Native, prefer the { uri, type, name } pattern rather than Blob
88
+ const rnFile = {
89
+ uri: videoFile,
90
+ type: 'video/mp4',
91
+ name: 'orientation_video.mp4',
92
+ };
93
+ formData.append('file', rnFile);
94
+ const response = await axios.post(`${this.orientationServiceURL}/process_orientation_video_stream/`, formData, {
95
+ // Let axios set the proper multipart boundary header automatically
96
+ timeout: 90000,
85
97
  });
86
98
  return {
87
99
  success: true,
@@ -114,6 +126,271 @@ export class KYCService {
114
126
  };
115
127
  }
116
128
  }
129
+ // STEP 1 - ID CARD VALIDATION
130
+ async detectFaceOnId(idCardImageUri, token, docType) {
131
+ const formData = new FormData();
132
+ const rnFile = { uri: idCardImageUri, type: 'image/jpeg', name: 'id_card_photo.jpg' };
133
+ formData.append('file', rnFile);
134
+ const docTypeShorted = GovernmentDocumentTypeShorted[docType];
135
+ try {
136
+ const res = await axios.post(`${this.faceServiceURL}/detect_face/?doc_type=${docTypeShorted}`, formData, {
137
+ headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },
138
+ timeout: 20000
139
+ });
140
+ console.log('detectFaceOnId res', JSON.stringify(res.data, null, 2));
141
+ if (res.data?.result)
142
+ return res.data;
143
+ throw new Error(res.data?.detail || 'detect_face failed');
144
+ }
145
+ catch (error) {
146
+ console.error('Error detecting face on id:', JSON.stringify(error));
147
+ throw error;
148
+ }
149
+ }
150
+ async extractDocumentInformation(params) {
151
+ const { fileUri, docType, docRegion, token } = params;
152
+ const formData = new FormData();
153
+ const rnFile = { uri: fileUri, type: 'image/jpeg', name: 'id_card_front.jpg' };
154
+ formData.append('file', rnFile);
155
+ const url = `${this.textExtractionServiceURL}/extract_doc_information/?doc_type=${encodeURIComponent(docType)}&doc_region=${encodeURIComponent(docRegion)}`;
156
+ const attempt = async () => {
157
+ const res = await axios.post(url, formData, {
158
+ headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },
159
+ timeout: 60000,
160
+ });
161
+ console.log('extractDocumentInformation res', JSON.stringify(res));
162
+ if (res.data?.detail)
163
+ throw new Error(res.data.detail);
164
+ return res.data;
165
+ };
166
+ try {
167
+ return await attempt();
168
+ }
169
+ catch (e) {
170
+ console.error('Error extracting document information:', JSON.stringify(e));
171
+ throw e;
172
+ // await new Promise(r => setTimeout(r, 1500));
173
+ // return await attempt();
174
+ }
175
+ }
176
+ // STEP 2 - barcode extraction
177
+ async extractBarcode(params) {
178
+ const { fileUri, token } = params;
179
+ const formData = new FormData();
180
+ const rnFile = { uri: fileUri, type: 'image/jpeg', name: 'id_card_back.jpg' };
181
+ formData.append('file', rnFile);
182
+ const url = `${this.barcodeServiceURL}/decode_barcode/`;
183
+ const attempt = async () => {
184
+ try {
185
+ const res = await axios.post(url, formData, {
186
+ headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },
187
+ timeout: 60000,
188
+ });
189
+ console.log('extractBarcode res', JSON.stringify(res.data));
190
+ //check if res.data has aleast one key
191
+ if (Object.keys(res.data).length === 0)
192
+ throw new Error('No data found');
193
+ return res.data;
194
+ }
195
+ catch (e) {
196
+ throw new Error(e?.message || 'Erreur de détection du barcode');
197
+ }
198
+ };
199
+ try {
200
+ return await attempt();
201
+ }
202
+ catch (e) {
203
+ console.error('Error extracting Barcode text:', JSON.stringify(e));
204
+ throw e;
205
+ }
206
+ }
207
+ // STEP 3 - MRZ TEXT EXTRACTION
208
+ async extractMrzText(params) {
209
+ const { fileUri, docType, docRegion, postfix = 'back', token } = params;
210
+ const formData = new FormData();
211
+ const rnFile = { uri: fileUri, type: 'image/jpeg', name: 'id_card_back.jpg' };
212
+ formData.append('file', rnFile);
213
+ const docTypeShorted = GovernmentDocumentTypeShorted[docType];
214
+ console.log("docTypeShorted", docTypeShorted, docRegion, postfix);
215
+ const url = `${this.mrzServiceURL}/extract_mrz_text/?doc_type=${docTypeShorted}&doc_region=${docRegion}&postfix=${postfix}`;
216
+ console.log("url", url);
217
+ const attempt = async () => {
218
+ try {
219
+ const res = await axios.post(url, formData, {
220
+ headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },
221
+ timeout: 60000,
222
+ });
223
+ console.log('extractMrzText res', JSON.stringify(res.data));
224
+ //check if res.data has aleast one key
225
+ if (Object.keys(res.data).length === 0)
226
+ throw new Error('No data found');
227
+ if (res.data?.success === false)
228
+ throw new Error(res.data.parsed_data.status);
229
+ return res.data;
230
+ }
231
+ catch (e) {
232
+ throw new Error(e?.message || 'Erreur de détection du MRZ');
233
+ }
234
+ };
235
+ try {
236
+ return await attempt();
237
+ }
238
+ catch (e) {
239
+ console.error('Error extracting MRZ text:', JSON.stringify(errorMessage(e), null, 2));
240
+ throw e;
241
+ }
242
+ }
243
+ // STEP 2 - SELFIE VALIDATION
244
+ async recognizeFace(params) {
245
+ const { idPhotoUri, selfiePhotoUri } = params;
246
+ const formData = new FormData();
247
+ const idFile = { uri: idPhotoUri, type: 'image/jpeg', name: 'id_card_photo.jpg' };
248
+ const selfieFile = { uri: selfiePhotoUri, type: 'image/jpeg', name: 'selfie_final.jpg' };
249
+ formData.append('id_photo', idFile);
250
+ formData.append('selfie_photo', selfieFile);
251
+ const res = await axios.post(`${this.faceServiceURL}/recognize_face/`, formData, { timeout: 45000 });
252
+ if (res.data?.detail)
253
+ throw new Error(res.data.detail);
254
+ return res.data;
255
+ }
256
+ // HEALTH CHECKS
257
+ async healthFaceDetection() {
258
+ const res = await axios.get(`${this.faceServiceURL}/health`);
259
+ return res.data;
260
+ }
261
+ async healthTextExtraction() {
262
+ const res = await axios.get(`${this.textExtractionServiceURL}/health`);
263
+ return res.data;
264
+ }
265
+ async healthMrzService() {
266
+ const res = await axios.get(`${this.mrzServiceURL}/health`);
267
+ return res.data;
268
+ }
269
+ async healthOrientationService() {
270
+ const res = await axios.get(`${this.orientationServiceURL}/health`);
271
+ return res.data;
272
+ }
273
+ async newSession(token) {
274
+ try {
275
+ const data = {
276
+ "status": "PENDING",
277
+ "metadata": {},
278
+ };
279
+ const res = await axios.post(`${this.backendServiceURL}/verification/sessions/`, data, { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });
280
+ return res.data;
281
+ }
282
+ catch (error) {
283
+ console.error('Error creating session:', JSON.stringify(errorMessage(error), null, 2));
284
+ // Extract backend error message if available
285
+ const backendMessage = errorMessage(error);
286
+ if (backendMessage) {
287
+ console.error('Backend error message:', JSON.stringify(backendMessage, null, 2));
288
+ throw new Error(`Backend error: ${JSON.stringify(backendMessage)}`);
289
+ }
290
+ throw error;
291
+ }
292
+ }
293
+ async verificationSession(payload) {
294
+ try {
295
+ const token = await authentification();
296
+ // /api/v1/verification/api/kyc/sessions/{session_id}/steps/{step}/
297
+ const { session_id, step, data, templateId, action } = payload;
298
+ // const session_id = "kyc-8b4e069258d8";
299
+ const payloadData = {
300
+ action: action,
301
+ data: {
302
+ step,
303
+ templateId,
304
+ ...(action === "location_permission" ? { permissionGranted: true, } : {}),
305
+ ...data,
306
+ },
307
+ ...({ session_id: session_id }),
308
+ timestamp: new Date().toISOString()
309
+ };
310
+ const url = `${this.backendServiceURL}/verification/api/kyc/sessions/${session_id}/steps/${step}/`;
311
+ const logPayload = truncateFields({ payloadData, session_id, step });
312
+ console.log('verificationSession payload', JSON.stringify({ logPayload, token, path: url }, null, 2));
313
+ const res = await axios.post(url, payloadData, {
314
+ headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }
315
+ });
316
+ console.log('verificationSession res', JSON.stringify(res.data, null, 2));
317
+ return res.data;
318
+ }
319
+ catch (error) {
320
+ console.error('Error validating component:', JSON.stringify(errorMessage(error), null, 2));
321
+ throw new Error(errorMessage(error));
322
+ }
323
+ }
324
+ // reultat de la verification
325
+ async getVerificationResult(session_id) {
326
+ const token = await authentification();
327
+ const url = `${this.backendServiceURL}/verification/api/kyc/result/?session_id=${session_id}`;
328
+ const res = await axios.get(url, { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });
329
+ console.log('getVerificationResult res', JSON.stringify(res.data, null, 2));
330
+ return res.data;
331
+ }
117
332
  }
118
- export default KYCService;
333
+ const kycService = new KYCService("", "");
334
+ export default kycService;
335
+ // Pour éviter d'afficher des champs trop longs, on tronque les valeurs longues dans le log
336
+ export function truncateFields(obj, maxLength = 420) {
337
+ if (typeof obj !== 'object' || obj === null)
338
+ return obj;
339
+ if (Array.isArray(obj))
340
+ return obj.map(item => truncateFields(item, maxLength));
341
+ const truncated = {};
342
+ for (const key in obj) {
343
+ if (!Object.prototype.hasOwnProperty.call(obj, key))
344
+ continue;
345
+ const value = obj[key];
346
+ if (typeof value === 'string' && value.length > maxLength) {
347
+ truncated[key] = value.slice(0, maxLength) + '... [truncated]';
348
+ }
349
+ else if (typeof value === 'object' && value !== null) {
350
+ truncated[key] = truncateFields(value, maxLength);
351
+ }
352
+ else {
353
+ truncated[key] = value;
354
+ }
355
+ }
356
+ return truncated;
357
+ }
358
+ export const authentification = async () => {
359
+ try {
360
+ const params = new URLSearchParams();
361
+ params.append('client_id', 'kyc_frontend');
362
+ params.append('client_secret', 'ZCW4mGaJXWR0UuI40lM1pHNQmYLw2xvX');
363
+ params.append('grant_type', 'client_credentials');
364
+ const res = await axios.post(`http://16.170.133.50:7080/realms/kyc/protocol/openid-connect/token`, params, {
365
+ headers: {
366
+ 'Content-Type': 'application/x-www-form-urlencoded',
367
+ },
368
+ });
369
+ console.log('authentification res', JSON.stringify(res.data));
370
+ return res.data.access_token;
371
+ }
372
+ catch (error) {
373
+ console.error('Error authentifying:', {
374
+ message: error.message,
375
+ status: error.response?.status,
376
+ statusText: error.response?.statusText,
377
+ data: error.response?.data,
378
+ url: error.config?.url,
379
+ method: error.config?.method
380
+ });
381
+ // Extract backend error message if available
382
+ const backendMessage = errorMessage(error);
383
+ if (backendMessage) {
384
+ console.error('Backend authentication error:', JSON.stringify(backendMessage, null, 2));
385
+ throw new Error(`Authentication failed: ${JSON.stringify(backendMessage)}`);
386
+ }
387
+ throw error;
388
+ }
389
+ };
390
+ export const errorMessage = (error) => {
391
+ return error.response?.data?.message ||
392
+ error.response?.data?.detail ||
393
+ error.response?.data?.error ||
394
+ error.response?.data;
395
+ };
119
396
  //# sourceMappingURL=KYCService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"KYCService.js","sourceRoot":"","sources":["../../../src/modules/api/KYCService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,MAAM,OAAO,UAAU;IACb,OAAO,CAAS;IAChB,MAAM,CAAS;IAEvB,YAAY,OAAe,EAAE,MAAc;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEO,UAAU;QAChB,OAAO;YACL,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;YACxC,cAAc,EAAE,kBAAkB;SACnC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAgB;QAC9B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAC/B,GAAG,IAAI,CAAC,OAAO,aAAa,EAC5B,IAAI,EACJ,EAAE,OAAO,EAAE,I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BAC5C,cAAc,EAAE,qBAAqB;iBACtC;aACF,CACF,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,OAAO,EAAE,0CAA0C;aACpD,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAErF,8BAA8B;YAC9B,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;gBACnC,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE;wBACL,IAAI,EAAE,qBAAqB;wBAC3B,OAAO,EAAE,2CAA2C;wBACpD,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI;qBAC7B;oBACD,OAAO,EAAE,iCAAiC;iBAC3C,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACL,IAAI,EAAE,kBAAkB;oBACxB,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,wBAAwB;oBAClF,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI;iBAC9B;gBACD,OAAO,EAAE,qCAAqC;aAC/C,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,eAAe,UAAU,CAAC","sourcesContent":["import axios from 'axios';\nimport { OrientationVideoResponse } from '../../types/KYC.types';\n\nexport interface KYCRequest {\n userId: string;\n documentImage: string;\n selfieImage: string;\n documentType: 'passport' | 'id_card' | 'drivers_license';\n}\n\nexport interface KYCResponse {\n success: boolean;\n verificationId: string;\n status: 'pending' | 'approved' | 'rejected';\n message?: string;\n}\n\nexport interface FaceDetectionRequest {\n selfieImage: string;\n documentImage: string;\n}\n\nexport interface FaceDetectionResponse {\n match: boolean;\n confidence: number;\n message: string;\n}\n\nexport class KYCService {\n private baseURL: string;\n private apiKey: string;\n\n constructor(baseURL: string, apiKey: string) {\n this.baseURL = baseURL;\n this.apiKey = apiKey;\n }\n\n private getHeaders() {\n return {\n 'Authorization': `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n };\n }\n\n async submitKYC(data: KYCRequest): Promise<KYCResponse> {\n try {\n const response = await axios.post(\n `${this.baseURL}/kyc/submit`,\n data,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n console.error('Error submitting KYC:', error);\n throw error;\n }\n }\n\n async detectFace(data: FaceDetectionRequest): Promise<FaceDetectionResponse> {\n try {\n const response = await axios.post(\n `${this.baseURL}/ai/face-detection`,\n data,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n console.error('Error detecting face:', error);\n throw error;\n }\n }\n\n async validateDocument(documentImage: string, documentType: string): Promise<any> {\n try {\n const response = await axios.post(\n `${this.baseURL}/ai/document-validation`,\n { documentImage, documentType },\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n console.error('Error validating document:', error);\n throw error;\n }\n }\n\n async getKYCStatus(verificationId: string): Promise<KYCResponse> {\n try {\n const response = await axios.get(\n `${this.baseURL}/kyc/status/${verificationId}`,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n console.error('Error getting KYC status:', error);\n throw error;\n }\n }\n\n async processOrientationVideo(videoFile: string): Promise<OrientationVideoResponse> {\n try {\n // Create FormData for multipart/form-data request\n const formData = new FormData();\n \n // Convert base64 to blob if needed, or use file path\n let fileData;\n if (videoFile.startsWith('data:') || videoFile.startsWith('file://')) {\n // Handle base64 or file URI\n if (videoFile.startsWith('data:')) {\n const response = await fetch(videoFile);\n fileData = await response.blob();\n } else {\n // For file:// URIs, we need to handle this differently\n // This is a simplified approach - in a real implementation,\n // you might need platform-specific handling\n const response = await fetch(videoFile);\n fileData = await response.blob();\n }\n } else {\n // Assume it's already a blob or file object\n fileData = videoFile as any;\n }\n\n formData.append('file', fileData, 'orientation_video.mp4');\n\n const response = await axios.post(\n `${this.baseURL}/process_orientation_video_stream/`,\n formData,\n { \n headers: {\n // 'Authorization': `Bearer ${this.apiKey}`,\n 'Content-Type': 'multipart/form-data',\n }\n }\n );\n\n return {\n success: true,\n data: response.data,\n message: 'Orientation video processed successfully'\n };\n } catch (error: any) {\n console.error('Error processing orientation video:', JSON.stringify(error, null, 2));\n \n // Handle specific error cases\n if (error.response?.status === 503) {\n return {\n success: false,\n error: {\n code: 'SERVICE_UNAVAILABLE',\n message: 'Service not ready, model not initialized.',\n details: error.response.data\n },\n message: 'Service temporarily unavailable'\n };\n }\n\n return {\n success: false,\n error: {\n code: 'PROCESSING_ERROR',\n message: error.response?.data?.detail || error.message || 'Unknown error occurred',\n details: error.response?.data\n },\n message: 'Failed to process orientation video'\n };\n }\n }\n}\n\nexport default KYCService; "]}
1
+ {"version":3,"file":"KYCService.js","sourceRoot":"","sources":["../../../src/modules/api/KYCService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,6BAA6B,EAA4B,MAAM,uBAAuB,CAAC;AAuCxH,MAAM,OAAO,UAAU;IACb,OAAO,CAAS;IAChB,MAAM,CAAS;IACvB,4DAA4D;IACpD,cAAc,GAAG,+DAA+D,CAAC;IACjF,wBAAwB,GAAG,+DAA+D,CAAC;IAC3F,aAAa,GAAG,+DAA+D,CAAC;IAChF,iBAAiB,GAAG,+DAA+D,CAAC;IACpF,qBAAqB,GAAG,4BAA4B,CAAC;IACrD,iBAAiB,GAAG,6BAA6B,CAAC;IAE1D,YAAY,OAAe,EAAE,MAAc;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEO,UAAU;QAChB,OAAO;YACL,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;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CAA6C;QAC7C,MAAM,cAAc,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAE3C,IAAI,cAAc,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACxF,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QAC9E,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAID,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE;IACzC,OAAO,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO;QAClC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM;QAC5B,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK;QAC3B,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;AACzB,CAAC,CAAA","sourcesContent":["import axios from 'axios';\nimport { GovernmentDocumentType, GovernmentDocumentTypeShorted, OrientationVideoResponse } from '../../types/KYC.types';\nimport { ExtractMrzTextResponse } from '../../components/OverLay/type';\nimport { SessionResponse, VerificationResult, VerificationSessionRequest } from './types';\n\nexport interface KYCRequest {\n userId: string;\n documentImage: string;\n selfieImage: string;\n documentType: 'passport' | 'id_card' | 'drivers_license';\n}\n\nexport interface KYCResponse {\n success: boolean;\n verificationId: string;\n status: 'pending' | 'approved' | 'rejected';\n message?: string;\n}\n\nexport interface FaceDetectionRequest {\n selfieImage: string;\n documentImage: string;\n}\n\nexport interface FaceDetectionResponse {\n match: boolean;\n confidence: number;\n message: string;\n}\n\nexport interface SelfieVideoResponse {\n orientation_direction: \"center\" | \"left\" | \"right\",\n turn_score: number;\n bbox: number[];\n capture: boolean;\n instruction: string;\n error: string;\n}\n\n\nexport class KYCService {\n private baseURL: string;\n private apiKey: string;\n // Additional service base URLs (fixed as per current infra)\n private faceServiceURL = 'http://kyc-ecs-alb-278715158.us-east-2.elb.amazonaws.com:8000';\n private textExtractionServiceURL = 'http://kyc-ecs-alb-278715158.us-east-2.elb.amazonaws.com:8006';\n private mrzServiceURL = 'http://kyc-ecs-alb-278715158.us-east-2.elb.amazonaws.com:8002';\n private barcodeServiceURL = 'http://kyc-ecs-alb-278715158.us-east-2.elb.amazonaws.com:8000';\n private orientationServiceURL = 'http://18.188.180.154:8080';\n private backendServiceURL = 'http://16.170.133.50/api/v1';\n\n constructor(baseURL: string, apiKey: string) {\n this.baseURL = baseURL;\n this.apiKey = apiKey;\n }\n\n private getHeaders() {\n return {\n 'Authorization': `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n };\n }\n\n async submitKYC(data: KYCRequest): Promise<KYCResponse> {\n try {\n const response = await axios.post(\n `${this.baseURL}/kyc/submit`,\n data,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n console.error('Error submitting KYC:', error);\n throw error;\n }\n }\n\n async detectFace(data: FaceDetectionRequest): Promise<FaceDetectionResponse> {\n try {\n const response = await axios.post(\n `${this.baseURL}/ai/face-detection`,\n data,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n console.error('Error detecting face:', error);\n throw error;\n }\n }\n\n async validateDocument(documentImage: string, documentType: string): Promise<any> {\n try {\n const response = await axios.post(\n `${this.baseURL}/ai/document-validation`,\n { documentImage, documentType },\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n console.error('Error validating document:', error);\n throw error;\n }\n }\n\n async getKYCStatus(verificationId: string): Promise<KYCResponse> {\n try {\n const response = await axios.get(\n `${this.baseURL}/kyc/status/${verificationId}`,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n console.error('Error getting KYC status:', error);\n throw error;\n }\n }\n\n async processSelfieOrientationPicture(videoFile: string, token: string): Promise<SelfieVideoResponse[]> {\n try {\n const formData = new FormData();\n const rnFile: any = {\n uri: videoFile,\n type: 'image/jpeg',\n name: 'selfie_picture.jpg',\n };\n formData.append('file', rnFile);\n const response = await axios.post<SelfieVideoResponse[]>(\n `${this.faceServiceURL}/detect_face_orientation/`,\n formData,\n {\n timeout: 20000,\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n }\n );\n return response.data;\n } catch (error) {\n console.error('Error processing selfie orientation:', error);\n throw error;\n }\n }\n\n async processOrientationVideo(videoFile: string): Promise<OrientationVideoResponse> {\n try {\n // Create FormData for multipart/form-data request\n const formData = new FormData();\n // In React Native, prefer the { uri, type, name } pattern rather than Blob\n const rnFile: any = {\n uri: videoFile,\n type: 'video/mp4',\n name: 'orientation_video.mp4',\n };\n formData.append('file', rnFile);\n\n const response = await axios.post(\n `${this.orientationServiceURL}/process_orientation_video_stream/`,\n formData,\n {\n // Let axios set the proper multipart boundary header automatically\n timeout: 90000,\n }\n );\n\n return {\n success: true,\n data: response.data,\n message: 'Orientation video processed successfully'\n };\n } catch (error: any) {\n console.error('Error processing orientation video:', JSON.stringify(error, null, 2));\n\n // Handle specific error cases\n if (error.response?.status === 503) {\n return {\n success: false,\n error: {\n code: 'SERVICE_UNAVAILABLE',\n message: 'Service not ready, model not initialized.',\n details: error.response.data\n },\n message: 'Service temporarily unavailable'\n };\n }\n\n return {\n success: false,\n error: {\n code: 'PROCESSING_ERROR',\n message: error.response?.data?.detail || error.message || 'Unknown error occurred',\n details: error.response?.data\n },\n message: 'Failed to process orientation video'\n };\n }\n }\n\n // STEP 1 - ID CARD VALIDATION\n async detectFaceOnId(idCardImageUri: string, token: string, docType: string): Promise<{ result: boolean, detail: any[] }> {\n const formData = new FormData();\n const rnFile: any = { uri: idCardImageUri, type: 'image/jpeg', name: 'id_card_photo.jpg' };\n formData.append('file', rnFile);\n\n const docTypeShorted = GovernmentDocumentTypeShorted[docType as GovernmentDocumentType];\n\n try {\n const res = await axios.post(`${this.faceServiceURL}/detect_face/?doc_type=${docTypeShorted}`, formData,\n {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 20000\n });\n console.log('detectFaceOnId res', JSON.stringify(res.data, null, 2));\n\n if (res.data?.result) return res.data;\n throw new Error(res.data?.detail || 'detect_face failed');\n } catch (error) {\n console.error('Error detecting face on id:', JSON.stringify(error));\n throw error;\n }\n }\n\n async extractDocumentInformation(params: { fileUri: string; docType: string; docRegion: string; token: string }): Promise<any> {\n const { fileUri, docType, docRegion, token } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_front.jpg' };\n formData.append('file', rnFile);\n\n const url = `${this.textExtractionServiceURL}/extract_doc_information/?doc_type=${encodeURIComponent(docType)}&doc_region=${encodeURIComponent(docRegion)}`;\n const attempt = async () => {\n const res = await axios.post(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n console.log('extractDocumentInformation res', JSON.stringify(res));\n\n if (res.data?.detail) throw new Error(res.data.detail);\n return res.data;\n };\n try {\n return await attempt();\n } catch (e) {\n console.error('Error extracting document information:', JSON.stringify(e));\n throw e;\n // await new Promise(r => setTimeout(r, 1500));\n // return await attempt();\n }\n }\n // STEP 2 - barcode extraction\n async extractBarcode(params: { fileUri: string; token: string }): Promise<any> {\n const { fileUri, token } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_back.jpg' };\n formData.append('file', rnFile);\n\n const url = `${this.barcodeServiceURL}/decode_barcode/`;\n const attempt = async () => {\n try {\n const res = await axios.post(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n console.log('extractBarcode res', JSON.stringify(res.data));\n //check if res.data has aleast one key\n if (Object.keys(res.data).length === 0) throw new Error('No data found');\n return res.data;\n } catch (e: any) {\n throw new Error(e?.message || 'Erreur de détection du barcode');\n }\n };\n try {\n return await attempt();\n } catch (e) {\n console.error('Error extracting Barcode text:', JSON.stringify(e));\n throw e;\n }\n }\n // STEP 3 - MRZ TEXT EXTRACTION\n async extractMrzText(params: { fileUri: string; docType: string; docRegion: string; postfix?: string; token: string }): Promise<any> {\n const { fileUri, docType, docRegion, postfix = 'back', token } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_back.jpg' };\n formData.append('file', rnFile);\n const docTypeShorted = GovernmentDocumentTypeShorted[docType as GovernmentDocumentType];\n console.log(\"docTypeShorted\", docTypeShorted, docRegion, postfix);\n\n const url = `${this.mrzServiceURL}/extract_mrz_text/?doc_type=${docTypeShorted}&doc_region=${docRegion}&postfix=${postfix}`;\n console.log(\"url\", url);\n\n const attempt = async () => {\n try {\n const res = await axios.post<ExtractMrzTextResponse>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n console.log('extractMrzText res', JSON.stringify(res.data));\n //check if res.data has aleast one key\n if (Object.keys(res.data).length === 0) throw new Error('No data found');\n if (res.data?.success === false) throw new Error(res.data.parsed_data.status);\n return res.data;\n } catch (e: any) {\n throw new Error(e?.message || 'Erreur de détection du MRZ');\n }\n };\n try {\n return await attempt();\n } catch (e) {\n console.error('Error extracting MRZ text:', JSON.stringify(errorMessage(e), null, 2));\n throw e;\n }\n }\n\n // STEP 2 - SELFIE VALIDATION\n async recognizeFace(params: { idPhotoUri: string; selfiePhotoUri: string }): Promise<{ is_match: boolean; similarity: number; id_bbox?: number[]; selfie_bbox?: number[] }> {\n const { idPhotoUri, selfiePhotoUri } = params;\n const formData = new FormData();\n const idFile: any = { uri: idPhotoUri, type: 'image/jpeg', name: 'id_card_photo.jpg' };\n const selfieFile: any = { uri: selfiePhotoUri, type: 'image/jpeg', name: 'selfie_final.jpg' };\n formData.append('id_photo', idFile);\n formData.append('selfie_photo', selfieFile);\n\n const res = await axios.post(`${this.faceServiceURL}/recognize_face/`, formData, { timeout: 45000 });\n if (res.data?.detail) throw new Error(res.data.detail);\n return res.data;\n }\n\n // HEALTH CHECKS\n async healthFaceDetection(): Promise<any> {\n const res = await axios.get(`${this.faceServiceURL}/health`);\n return res.data;\n }\n\n async healthTextExtraction(): Promise<any> {\n const res = await axios.get(`${this.textExtractionServiceURL}/health`);\n return res.data;\n }\n\n async healthMrzService(): Promise<any> {\n const res = await axios.get(`${this.mrzServiceURL}/health`);\n return res.data;\n }\n\n async healthOrientationService(): Promise<any> {\n const res = await axios.get(`${this.orientationServiceURL}/health`);\n return res.data;\n }\n\n async newSession(token: string): Promise<SessionResponse> {\n try {\n const data = {\n \"status\": \"PENDING\",\n \"metadata\": {},\n }\n const res = await axios.post<SessionResponse>(`${this.backendServiceURL}/verification/sessions/`,\n data, { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });\n return res.data;\n } catch (error: any) {\n console.error('Error creating session:', JSON.stringify(errorMessage(error), null, 2));\n\n // Extract backend error message if available\n const backendMessage = errorMessage(error);\n\n if (backendMessage) {\n console.error('Backend error message:', JSON.stringify(backendMessage, null, 2));\n throw new Error(`Backend error: ${JSON.stringify(backendMessage)}`);\n }\n\n throw error;\n }\n }\n\n async verificationSession(payload: VerificationSessionRequest): Promise<any> {\n\n try {\n\n const token = await authentification();\n\n // /api/v1/verification/api/kyc/sessions/{session_id}/steps/{step}/\n const { session_id, step, data, templateId, action } = payload;\n // const session_id = \"kyc-8b4e069258d8\";\n const payloadData = {\n action: action,\n data: {\n step,\n templateId,\n ...(action === \"location_permission\" ? { permissionGranted: true, } : {}),\n ...data,\n },\n ...({ session_id: session_id }),\n timestamp: new Date().toISOString()\n }\n const url = `${this.backendServiceURL}/verification/api/kyc/sessions/${session_id}/steps/${step}/`;\n\n\n const logPayload = truncateFields({ payloadData, session_id, step });\n console.log('verificationSession payload',\n JSON.stringify({ logPayload, token, path: url },\n null, 2))\n\n const res = await axios.post<SessionResponse>(url,\n payloadData,\n {\n headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }\n });\n console.log('verificationSession res', JSON.stringify(res.data, null, 2));\n return res.data;\n\n\n } catch (error) {\n console.error('Error validating component:', JSON.stringify(errorMessage(error), null, 2));\n throw new Error(errorMessage(error));\n }\n }\n // reultat de la verification\n async getVerificationResult(session_id: string): Promise<VerificationResult> {\n const token = await authentification();\n const url = `${this.backendServiceURL}/verification/api/kyc/result/?session_id=${session_id}`;\n const res = await axios.get<VerificationResult>(url,\n { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });\n console.log('getVerificationResult res', JSON.stringify(res.data, null, 2));\n return res.data;\n }\n}\n\n\nconst kycService = new KYCService(\"\", \"\");\nexport default kycService;\n\n\n// Pour éviter d'afficher des champs trop longs, on tronque les valeurs longues dans le log\nexport function truncateFields(obj: any, maxLength = 420): any {\n if (typeof obj !== 'object' || obj === null) return obj;\n if (Array.isArray(obj)) return obj.map(item => truncateFields(item, maxLength));\n const truncated: any = {};\n for (const key in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;\n const value = obj[key];\n if (typeof value === 'string' && value.length > maxLength) {\n truncated[key] = value.slice(0, maxLength) + '... [truncated]';\n } else if (typeof value === 'object' && value !== null) {\n truncated[key] = truncateFields(value, maxLength);\n } else {\n truncated[key] = value;\n }\n }\n return truncated;\n}\nexport const authentification = async () => {\n try {\n const params = new URLSearchParams();\n params.append('client_id', 'kyc_frontend');\n params.append('client_secret', 'ZCW4mGaJXWR0UuI40lM1pHNQmYLw2xvX');\n params.append('grant_type', 'client_credentials');\n const res = await axios.post(`http://16.170.133.50:7080/realms/kyc/protocol/openid-connect/token`,\n params,\n {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }\n );\n console.log('authentification res', JSON.stringify(res.data));\n return res.data.access_token;\n } catch (error: any) {\n console.error('Error authentifying:', {\n message: error.message,\n status: error.response?.status,\n statusText: error.response?.statusText,\n data: error.response?.data,\n url: error.config?.url,\n method: error.config?.method\n });\n\n // Extract backend error message if available\n const backendMessage = errorMessage(error);\n\n if (backendMessage) {\n console.error('Backend authentication error:', JSON.stringify(backendMessage, null, 2));\n throw new Error(`Authentication failed: ${JSON.stringify(backendMessage)}`);\n }\n\n throw error;\n }\n}\n\n\n\nexport const errorMessage = (error: any) => {\n return error.response?.data?.message ||\n error.response?.data?.detail ||\n error.response?.data?.error ||\n error.response?.data;\n}"]}
@@ -0,0 +1,3 @@
1
+ declare const selfieVerification: (selfieImage: string) => Promise<import("./KYCService").SelfieVideoResponse[]>;
2
+ export default selfieVerification;
3
+ //# sourceMappingURL=SelfieVerification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelfieVerification.d.ts","sourceRoot":"","sources":["../../../src/modules/api/SelfieVerification.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,kBAAkB,GAAU,aAAa,MAAM,0DAMpD,CAAA;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import kycService, { authentification } from "./KYCService";
2
+ const selfieVerification = async (selfieImage) => {
3
+ const token = await authentification();
4
+ const response = await kycService.processSelfieOrientationPicture(selfieImage, token);
5
+ console.log("selfieVerification response", JSON.stringify(response, null, 2));
6
+ return response;
7
+ };
8
+ export default selfieVerification;
9
+ //# sourceMappingURL=SelfieVerification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelfieVerification.js","sourceRoot":"","sources":["../../../src/modules/api/SelfieVerification.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,kBAAkB,GAAG,KAAK,EAAE,WAAmB,EAAE,EAAE;IACrD,MAAM,KAAK,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAEvC,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,+BAA+B,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9E,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAA;AAED,eAAe,kBAAkB,CAAC","sourcesContent":["import kycService, { authentification } from \"./KYCService\";\n\nconst selfieVerification = async (selfieImage: string) => {\n const token = await authentification();\n\n const response = await kycService.processSelfieOrientationPicture(selfieImage, token);\n console.log(\"selfieVerification response\", JSON.stringify(response, null, 2));\n return response;\n}\n\nexport default selfieVerification;"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=backendApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backendApi.d.ts","sourceRoot":"","sources":["../../../src/modules/api/backendApi.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ // import kycService from "./KYCService"
2
+ export {};
3
+ // const initializesession = (token: string) => {
4
+ // // const session = await kycService.post("/session", {
5
+ // }
6
+ //# sourceMappingURL=backendApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backendApi.js","sourceRoot":"","sources":["../../../src/modules/api/backendApi.ts"],"names":[],"mappings":"AAAA,wCAAwC;;AAIxC,iDAAiD;AAEjD,6DAA6D;AAC7D,IAAI","sourcesContent":["// import kycService from \"./KYCService\"\n\n\n\n// const initializesession = (token: string) => {\n\n// // const session = await kycService.post(\"/session\", {\n// }"]}
@@ -0,0 +1,45 @@
1
+ export interface SessionResponse {
2
+ id: number;
3
+ session_id: string;
4
+ status: string;
5
+ created_at: string;
6
+ updated_at: string;
7
+ metadata: string;
8
+ user: number;
9
+ module: number;
10
+ }
11
+ export interface VerificationSessionRequest {
12
+ step: number;
13
+ data: VerificationSessionData;
14
+ templateId: string | null;
15
+ session_id: string;
16
+ token: string;
17
+ action: string;
18
+ }
19
+ export type VerificationSessionData = Record<string, any>;
20
+ export interface VerificationResult {
21
+ [key: string]: {
22
+ data: {
23
+ verification_id: string;
24
+ verification_status: string;
25
+ completion_timestamp: string;
26
+ user_data: {
27
+ personal_information: {
28
+ full_name: string;
29
+ first_name: string | null;
30
+ last_name: string | null;
31
+ date_of_birth: string | null;
32
+ nationality: string | null;
33
+ gender: string | null;
34
+ place_of_birth: string | null;
35
+ };
36
+ };
37
+ selfie_info: {
38
+ is_match: boolean;
39
+ similarity: number;
40
+ image: string;
41
+ };
42
+ };
43
+ };
44
+ }
45
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/api/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAA;CACjB;AAID,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAG1D,MAAM,WAAW,kBAAkB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG;QACX,IAAI,EAAE;YACF,eAAe,EAAE,MAAM,CAAC;YACxB,mBAAmB,EAAE,MAAM,CAAC;YAC5B,oBAAoB,EAAE,MAAM,CAAC;YAC7B,SAAS,EAAE;gBACP,oBAAoB,EAAE;oBAClB,SAAS,EAAE,MAAM,CAAC;oBAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;oBAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;oBACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;oBAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;oBAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;oBACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;iBACjC,CAAC;aACL,CAAC;YACF,WAAW,EAAE;gBACT,QAAQ,EAAE,OAAO,CAAC;gBAClB,UAAU,EAAE,MAAM,CAAC;gBACnB,KAAK,EAAE,MAAM,CAAC;aACjB,CAAC;SACL,CAAC;KACL,CAAC;CACL"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/api/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SessionResponse {\n id: number;\n session_id: string;\n status: string;\n created_at: string;\n updated_at: string;\n metadata: string;\n user: number;\n module: number;\n}\n\n\nexport interface VerificationSessionRequest {\n step: number;\n data: VerificationSessionData;\n templateId: string | null;\n session_id: string;\n token: string;\n action: string\n}\n\n\n// dynamic type\nexport type VerificationSessionData = Record<string, any>;\n\n\nexport interface VerificationResult {\n [key: string]: {\n data: {\n verification_id: string;\n verification_status: string;\n completion_timestamp: string;\n user_data: {\n personal_information: {\n full_name: string;\n first_name: string | null;\n last_name: string | null;\n date_of_birth: string | null;\n nationality: string | null;\n gender: string | null;\n place_of_birth: string | null;\n };\n };\n selfie_info: {\n is_match: boolean;\n similarity: number;\n image: string;\n };\n };\n };\n}"]}