@transfergratis/react-native-sdk 0.1.3 → 0.1.5

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 (308) hide show
  1. package/android/.idea/caches/deviceStreaming.xml +860 -0
  2. package/android/build/.transforms/{7ec900c0f64f5f1a7c88998dd44001b8 → 01c28d00c798aa4846f16ce72123ebf9}/transformed/classes/classes_dex/classes.dex +0 -0
  3. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +1 -0
  4. package/android/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar +0 -0
  5. package/android/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
  6. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  7. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -2
  8. package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
  9. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +51 -48
  10. package/android/build/intermediates/merged_java_res/debug/mergeDebugJavaResource/feature-transfergratis-react-native-sdk.jar +0 -0
  11. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +1 -0
  12. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  13. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  14. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  15. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  16. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  17. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  18. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  19. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  20. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  21. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  22. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  51. package/android/build/outputs/aar/transfergratis-react-native-sdk-debug.aar +0 -0
  52. package/android/build/outputs/logs/manifest-merger-debug-report.txt +27 -23
  53. package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule.class +0 -0
  54. package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkView.class +0 -0
  55. package/android/build.gradle +1 -5
  56. package/android/src/main/AndroidManifest.xml +1 -0
  57. package/build/api/axios.d.ts +30 -0
  58. package/build/api/axios.d.ts.map +1 -0
  59. package/build/api/axios.js +92 -0
  60. package/build/api/axios.js.map +1 -0
  61. package/build/components/EnhancedCameraView.d.ts +1 -41
  62. package/build/components/EnhancedCameraView.d.ts.map +1 -1
  63. package/build/components/EnhancedCameraView.js +76 -35
  64. package/build/components/EnhancedCameraView.js.map +1 -1
  65. package/build/components/EnhancedCameraView.web.d.ts +1 -41
  66. package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
  67. package/build/components/EnhancedCameraView.web.js +28 -4
  68. package/build/components/EnhancedCameraView.web.js.map +1 -1
  69. package/build/components/KYCElements/CountrySelectionTemplate.d.ts +2 -2
  70. package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
  71. package/build/components/KYCElements/CountrySelectionTemplate.js +71 -114
  72. package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
  73. package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
  74. package/build/components/KYCElements/FileUploadTemplate.js +7 -3
  75. package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
  76. package/build/components/KYCElements/IDCardCapture.d.ts +7 -2
  77. package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  78. package/build/components/KYCElements/IDCardCapture.js +253 -104
  79. package/build/components/KYCElements/IDCardCapture.js.map +1 -1
  80. package/build/components/KYCElements/InitializationStep.d.ts +5 -0
  81. package/build/components/KYCElements/InitializationStep.d.ts.map +1 -0
  82. package/build/components/KYCElements/InitializationStep.js +41 -0
  83. package/build/components/KYCElements/InitializationStep.js.map +1 -0
  84. package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
  85. package/build/components/KYCElements/LocationCaptureTemplate.js +15 -13
  86. package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
  87. package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -2
  88. package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
  89. package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
  90. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -2
  91. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
  92. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
  93. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -2
  94. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
  95. package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
  96. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts +12 -0
  97. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts.map +1 -0
  98. package/build/components/KYCElements/ReviewSubmitTemplate.js +171 -0
  99. package/build/components/KYCElements/ReviewSubmitTemplate.js.map +1 -0
  100. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +6 -2
  101. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
  102. package/build/components/KYCElements/SelfieCaptureTemplate.js +105 -35
  103. package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
  104. package/build/components/KYCElements/VerificationProgressTemplate.d.ts +12 -0
  105. package/build/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -0
  106. package/build/components/KYCElements/VerificationProgressTemplate.js +93 -0
  107. package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
  108. package/build/components/OverLay/IdCard.d.ts +1 -1
  109. package/build/components/OverLay/IdCard.d.ts.map +1 -1
  110. package/build/components/OverLay/IdCard.js +10 -6
  111. package/build/components/OverLay/IdCard.js.map +1 -1
  112. package/build/components/OverLay/SelfieOverlay.d.ts +1 -1
  113. package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -1
  114. package/build/components/OverLay/SelfieOverlay.js +5 -4
  115. package/build/components/OverLay/SelfieOverlay.js.map +1 -1
  116. package/build/components/OverLay/type.d.ts +71 -1
  117. package/build/components/OverLay/type.d.ts.map +1 -1
  118. package/build/components/OverLay/type.js.map +1 -1
  119. package/build/components/TemplateKYCExample.d.ts.map +1 -1
  120. package/build/components/TemplateKYCExample.js +72 -197
  121. package/build/components/TemplateKYCExample.js.map +1 -1
  122. package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
  123. package/build/components/TemplateKYCFlowRefactored.js +63 -39
  124. package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
  125. package/build/components/VisionCameraView.js +1 -1
  126. package/build/components/VisionCameraView.js.map +1 -1
  127. package/build/components/example/OrientationVideoExample.d.ts.map +1 -1
  128. package/build/components/example/OrientationVideoExample.js +1 -5
  129. package/build/components/example/OrientationVideoExample.js.map +1 -1
  130. package/build/components/ui/Button.js +1 -1
  131. package/build/components/ui/Button.js.map +1 -1
  132. package/build/config/countriesData.d.ts +3 -0
  133. package/build/config/countriesData.d.ts.map +1 -0
  134. package/build/config/countriesData.js +79 -0
  135. package/build/config/countriesData.js.map +1 -0
  136. package/build/config/region_mapping.d.ts +3 -0
  137. package/build/config/region_mapping.d.ts.map +1 -0
  138. package/build/config/region_mapping.js +687 -0
  139. package/build/config/region_mapping.js.map +1 -0
  140. package/build/hooks/useI18n.d.ts +11 -0
  141. package/build/hooks/useI18n.d.ts.map +1 -0
  142. package/build/hooks/useI18n.js +37 -0
  143. package/build/hooks/useI18n.js.map +1 -0
  144. package/build/hooks/useOrientationVideo.d.ts +1 -2
  145. package/build/hooks/useOrientationVideo.d.ts.map +1 -1
  146. package/build/hooks/useOrientationVideo.js +2 -1
  147. package/build/hooks/useOrientationVideo.js.map +1 -1
  148. package/build/hooks/useRealtimeVerifier.d.ts +28 -0
  149. package/build/hooks/useRealtimeVerifier.d.ts.map +1 -0
  150. package/build/hooks/useRealtimeVerifier.js +91 -0
  151. package/build/hooks/useRealtimeVerifier.js.map +1 -0
  152. package/build/hooks/useTemplateKYCFlow.d.ts +1 -0
  153. package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  154. package/build/hooks/useTemplateKYCFlow.js +337 -38
  155. package/build/hooks/useTemplateKYCFlow.js.map +1 -1
  156. package/build/i18n/en/index.d.ts +168 -0
  157. package/build/i18n/en/index.d.ts.map +1 -0
  158. package/build/i18n/en/index.js +195 -0
  159. package/build/i18n/en/index.js.map +1 -0
  160. package/build/i18n/fr/index.d.ts +168 -0
  161. package/build/i18n/fr/index.d.ts.map +1 -0
  162. package/build/i18n/fr/index.js +194 -0
  163. package/build/i18n/fr/index.js.map +1 -0
  164. package/build/i18n/index.d.ts +10 -0
  165. package/build/i18n/index.d.ts.map +1 -0
  166. package/build/i18n/index.js +56 -0
  167. package/build/i18n/index.js.map +1 -0
  168. package/build/i18n/types.d.ts +153 -0
  169. package/build/i18n/types.d.ts.map +1 -0
  170. package/build/i18n/types.js +3 -0
  171. package/build/i18n/types.js.map +1 -0
  172. package/build/i18n/usage-example.d.ts +4 -0
  173. package/build/i18n/usage-example.d.ts.map +1 -0
  174. package/build/i18n/usage-example.js +189 -0
  175. package/build/i18n/usage-example.js.map +1 -0
  176. package/build/modules/api/CardAuthentification.d.ts +22 -0
  177. package/build/modules/api/CardAuthentification.d.ts.map +1 -0
  178. package/build/modules/api/CardAuthentification.js +107 -0
  179. package/build/modules/api/CardAuthentification.js.map +1 -0
  180. package/build/modules/api/KYCService.d.ts +57 -1
  181. package/build/modules/api/KYCService.d.ts.map +1 -1
  182. package/build/modules/api/KYCService.js +348 -27
  183. package/build/modules/api/KYCService.js.map +1 -1
  184. package/build/modules/api/SelfieVerification.d.ts +3 -0
  185. package/build/modules/api/SelfieVerification.d.ts.map +1 -0
  186. package/build/modules/api/SelfieVerification.js +9 -0
  187. package/build/modules/api/SelfieVerification.js.map +1 -0
  188. package/build/modules/api/backendApi.d.ts +2 -0
  189. package/build/modules/api/backendApi.d.ts.map +1 -0
  190. package/build/modules/api/backendApi.js +6 -0
  191. package/build/modules/api/backendApi.js.map +1 -0
  192. package/build/modules/api/types.d.ts +20 -0
  193. package/build/modules/api/types.d.ts.map +1 -0
  194. package/build/modules/api/types.js +2 -0
  195. package/build/modules/api/types.js.map +1 -0
  196. package/build/modules/camera/VisionCameraModule.d.ts +1 -1
  197. package/build/modules/camera/VisionCameraModule.d.ts.map +1 -1
  198. package/build/modules/camera/VisionCameraModule.js +8 -2
  199. package/build/modules/camera/VisionCameraModule.js.map +1 -1
  200. package/build/types/KYC.types.d.ts +59 -7
  201. package/build/types/KYC.types.d.ts.map +1 -1
  202. package/build/types/KYC.types.js +9 -1
  203. package/build/types/KYC.types.js.map +1 -1
  204. package/build/utils/cropByObb.d.ts +11 -0
  205. package/build/utils/cropByObb.d.ts.map +1 -0
  206. package/build/utils/cropByObb.js +78 -0
  207. package/build/utils/cropByObb.js.map +1 -0
  208. package/build/utils/get-document-type-info.d.ts +13 -0
  209. package/build/utils/get-document-type-info.d.ts.map +1 -0
  210. package/build/utils/get-document-type-info.js +59 -0
  211. package/build/utils/get-document-type-info.js.map +1 -0
  212. package/build/utils/pathToBase64.d.ts +3 -0
  213. package/build/utils/pathToBase64.d.ts.map +1 -0
  214. package/build/utils/pathToBase64.js +47 -0
  215. package/build/utils/pathToBase64.js.map +1 -0
  216. package/build/utils/remove-duplicate.d.ts +2 -0
  217. package/build/utils/remove-duplicate.d.ts.map +1 -0
  218. package/build/utils/remove-duplicate.js +4 -0
  219. package/build/utils/remove-duplicate.js.map +1 -0
  220. package/package.json +3 -1
  221. package/src/api/axios.ts +144 -0
  222. package/src/components/EnhancedCameraView.tsx +96 -78
  223. package/src/components/EnhancedCameraView.web.tsx +41 -40
  224. package/src/components/KYCElements/CountrySelectionTemplate.tsx +104 -136
  225. package/src/components/KYCElements/FileUploadTemplate.tsx +14 -8
  226. package/src/components/KYCElements/IDCardCapture.tsx +311 -115
  227. package/src/components/KYCElements/InitializationStep.tsx +53 -0
  228. package/src/components/KYCElements/LocationCaptureTemplate.tsx +17 -15
  229. package/src/components/KYCElements/OrientationVideoCapture.tsx +2 -2
  230. package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +2 -2
  231. package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +2 -2
  232. package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
  233. package/src/components/KYCElements/SelfieCaptureTemplate.tsx +140 -53
  234. package/src/components/KYCElements/VerificationProgressTemplate.tsx +123 -0
  235. package/src/components/OverLay/IdCard.tsx +17 -9
  236. package/src/components/OverLay/SelfieOverlay.tsx +6 -5
  237. package/src/components/OverLay/type.ts +64 -2
  238. package/src/components/TemplateKYCExample.tsx +76 -197
  239. package/src/components/TemplateKYCFlowRefactored.tsx +74 -46
  240. package/src/components/VisionCameraView.tsx +1 -1
  241. package/src/components/example/OrientationVideoExample.tsx +3 -7
  242. package/src/components/ui/Button.tsx +1 -1
  243. package/src/config/countriesData.ts +84 -0
  244. package/src/config/region_mapping.ts +688 -0
  245. package/src/hooks/useI18n.ts +53 -0
  246. package/src/hooks/useOrientationVideo.ts +2 -2
  247. package/src/hooks/useRealtimeVerifier.ts +128 -0
  248. package/src/hooks/useTemplateKYCFlow.tsx +375 -53
  249. package/src/i18n/README.md +288 -0
  250. package/src/i18n/en/index.ts +206 -0
  251. package/src/i18n/fr/index.ts +205 -0
  252. package/src/i18n/index.ts +65 -0
  253. package/src/i18n/types.ts +172 -0
  254. package/src/i18n/usage-example.tsx +202 -0
  255. package/src/modules/api/CardAuthentification.ts +114 -0
  256. package/src/modules/api/KYCService.ts +403 -30
  257. package/src/modules/api/SelfieVerification.ts +11 -0
  258. package/src/modules/api/backendApi.ts +8 -0
  259. package/src/modules/api/types.ts +24 -0
  260. package/src/modules/camera/VisionCameraModule.ts +16 -7
  261. package/src/types/KYC.types.ts +83 -14
  262. package/src/utils/cropByObb.ts +99 -0
  263. package/src/utils/get-document-type-info.ts +62 -0
  264. package/src/utils/pathToBase64.ts +47 -0
  265. package/src/utils/remove-duplicate.ts +3 -0
  266. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/results.bin +0 -1
  267. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/BuildConfig.dex +0 -0
  268. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.dex +0 -0
  269. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.dex +0 -0
  270. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.dex +0 -0
  271. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.dex +0 -0
  272. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.dex +0 -0
  273. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.dex +0 -0
  274. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.dex +0 -0
  275. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.dex +0 -0
  276. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.dex +0 -0
  277. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.dex +0 -0
  278. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.dex +0 -0
  279. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.dex +0 -0
  280. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.dex +0 -0
  281. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.dex +0 -0
  282. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.dex +0 -0
  283. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule.dex +0 -0
  284. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkView.dex +0 -0
  285. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  286. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/BuildConfig.class +0 -0
  287. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.class +0 -0
  288. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.class +0 -0
  289. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.class +0 -0
  290. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.class +0 -0
  291. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.class +0 -0
  292. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.class +0 -0
  293. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.class +0 -0
  294. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.class +0 -0
  295. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.class +0 -0
  296. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.class +0 -0
  297. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.class +0 -0
  298. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.class +0 -0
  299. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
  300. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.class +0 -0
  301. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.class +0 -0
  302. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule.class +0 -0
  303. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkView.class +0 -0
  304. package/android/build/tmp/kotlin-classes/debug/META-INF/transfergratis-sdk_debug.kotlin_module +0 -0
  305. package/src/types/nativewind.d.ts +0 -2
  306. /package/android/build/.transforms/{7ec900c0f64f5f1a7c88998dd44001b8 → 01c28d00c798aa4846f16ce72123ebf9}/results.bin +0 -0
  307. /package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/{transfergratis-sdk_debug.kotlin_module → transfergratis-react-native-sdk_debug.kotlin_module} +0 -0
  308. /package/android/build/{intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/transfergratis-sdk_debug.kotlin_module → tmp/kotlin-classes/debug/META-INF/transfergratis-react-native-sdk_debug.kotlin_module} +0 -0
@@ -0,0 +1,189 @@
1
+ import React from 'react';
2
+ import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
3
+ import { useI18n } from '../hooks/useI18n';
4
+ // Exemple d'utilisation du système i18n dans votre application
5
+ export const KYCFlowWithI18n = () => {
6
+ const { t, locale, setLocale, availableLocales } = useI18n();
7
+ return (<View style={styles.container}>
8
+ {/* Sélecteur de langue */}
9
+ <View style={styles.languageSelector}>
10
+ <Text style={styles.languageLabel}>{t('kyc.countrySelection.title')}</Text>
11
+ <View style={styles.languageButtons}>
12
+ {availableLocales.map((loc) => (<TouchableOpacity key={loc} style={[
13
+ styles.languageButton,
14
+ locale === loc && styles.activeLanguageButton
15
+ ]} onPress={() => setLocale(loc)}>
16
+ <Text style={[
17
+ styles.languageButtonText,
18
+ locale === loc && styles.activeLanguageButtonText
19
+ ]}>
20
+ {loc.toUpperCase()}
21
+ </Text>
22
+ </TouchableOpacity>))}
23
+ </View>
24
+ </View>
25
+
26
+ {/* Titre principal */}
27
+ <Text style={styles.title}>{t('kyc.title')}</Text>
28
+ <Text style={styles.subtitle}>{t('kyc.subtitle')}</Text>
29
+
30
+ {/* Boutons d'action */}
31
+ <View style={styles.buttonContainer}>
32
+ <TouchableOpacity style={styles.primaryButton}>
33
+ <Text style={styles.primaryButtonText}>
34
+ {t('kyc.initialization.startButton')}
35
+ </Text>
36
+ </TouchableOpacity>
37
+
38
+ <TouchableOpacity style={styles.secondaryButton}>
39
+ <Text style={styles.secondaryButtonText}>
40
+ {t('common.cancel')}
41
+ </Text>
42
+ </TouchableOpacity>
43
+ </View>
44
+
45
+ {/* Instructions */}
46
+ <View style={styles.instructionsContainer}>
47
+ <Text style={styles.instructionsTitle}>
48
+ {t('kyc.initialization.requirements')}
49
+ </Text>
50
+ {/* {t('kyc.initialization.requirementsList').map((requirement: string, index: number) => (
51
+ <Text key={index} style={styles.requirementItem}>
52
+ • {requirement}
53
+ </Text>
54
+ ))} */}
55
+ </View>
56
+
57
+ {/* Exemple d'utilisation avec interpolation */}
58
+ <Text style={styles.stepText}>
59
+ {t('kyc.step', { current: 1, total: 3 })}
60
+ </Text>
61
+
62
+ {/* Exemple d'utilisation avec pluralisation */}
63
+ <Text style={styles.countText}>
64
+ {t('kyc.verificationProgress.estimatedTime')}
65
+ </Text>
66
+ </View>);
67
+ };
68
+ const styles = StyleSheet.create({
69
+ container: {
70
+ flex: 1,
71
+ padding: 20,
72
+ backgroundColor: '#FFFFFF',
73
+ },
74
+ languageSelector: {
75
+ flexDirection: 'row',
76
+ alignItems: 'center',
77
+ justifyContent: 'space-between',
78
+ marginBottom: 20,
79
+ paddingVertical: 10,
80
+ borderBottomWidth: 1,
81
+ borderBottomColor: '#E0E0E0',
82
+ },
83
+ languageLabel: {
84
+ fontSize: 16,
85
+ fontWeight: '600',
86
+ color: '#333333',
87
+ },
88
+ languageButtons: {
89
+ flexDirection: 'row',
90
+ gap: 10,
91
+ },
92
+ languageButton: {
93
+ paddingHorizontal: 16,
94
+ paddingVertical: 8,
95
+ borderRadius: 20,
96
+ backgroundColor: '#F5F5F5',
97
+ borderWidth: 1,
98
+ borderColor: '#E0E0E0',
99
+ },
100
+ activeLanguageButton: {
101
+ backgroundColor: '#007AFF',
102
+ borderColor: '#007AFF',
103
+ },
104
+ languageButtonText: {
105
+ fontSize: 14,
106
+ fontWeight: '500',
107
+ color: '#666666',
108
+ },
109
+ activeLanguageButtonText: {
110
+ color: '#FFFFFF',
111
+ },
112
+ title: {
113
+ fontSize: 28,
114
+ fontWeight: 'bold',
115
+ textAlign: 'center',
116
+ marginBottom: 10,
117
+ color: '#333333',
118
+ },
119
+ subtitle: {
120
+ fontSize: 16,
121
+ textAlign: 'center',
122
+ marginBottom: 30,
123
+ color: '#666666',
124
+ lineHeight: 22,
125
+ },
126
+ buttonContainer: {
127
+ gap: 15,
128
+ marginBottom: 30,
129
+ },
130
+ primaryButton: {
131
+ backgroundColor: '#007AFF',
132
+ paddingVertical: 15,
133
+ paddingHorizontal: 30,
134
+ borderRadius: 8,
135
+ alignItems: 'center',
136
+ },
137
+ primaryButtonText: {
138
+ color: '#FFFFFF',
139
+ fontSize: 16,
140
+ fontWeight: '600',
141
+ },
142
+ secondaryButton: {
143
+ backgroundColor: 'transparent',
144
+ paddingVertical: 15,
145
+ paddingHorizontal: 30,
146
+ borderRadius: 8,
147
+ alignItems: 'center',
148
+ borderWidth: 1,
149
+ borderColor: '#E0E0E0',
150
+ },
151
+ secondaryButtonText: {
152
+ color: '#666666',
153
+ fontSize: 16,
154
+ fontWeight: '500',
155
+ },
156
+ instructionsContainer: {
157
+ backgroundColor: '#F8F9FA',
158
+ padding: 20,
159
+ borderRadius: 10,
160
+ marginBottom: 20,
161
+ },
162
+ instructionsTitle: {
163
+ fontSize: 16,
164
+ fontWeight: '600',
165
+ marginBottom: 15,
166
+ color: '#333333',
167
+ },
168
+ requirementItem: {
169
+ fontSize: 14,
170
+ marginBottom: 8,
171
+ color: '#666666',
172
+ lineHeight: 20,
173
+ },
174
+ stepText: {
175
+ fontSize: 14,
176
+ textAlign: 'center',
177
+ color: '#007AFF',
178
+ fontWeight: '500',
179
+ marginBottom: 10,
180
+ },
181
+ countText: {
182
+ fontSize: 12,
183
+ textAlign: 'center',
184
+ color: '#999999',
185
+ fontStyle: 'italic',
186
+ },
187
+ });
188
+ export default KYCFlowWithI18n;
189
+ //# sourceMappingURL=usage-example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage-example.js","sourceRoot":"","sources":["../../src/i18n/usage-example.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,eAAe,GAAa,GAAG,EAAE;IAC5C,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,OAAO,EAAE,CAAC;IAI7D,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,yBAAyB,CAC1B;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CACnC;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,EAAE,IAAI,CAC1E;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAClC;UAAA,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC7B,CAAC,gBAAgB,CACf,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,KAAK,CAAC,CAAC;gBACL,MAAM,CAAC,cAAc;gBACrB,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,oBAAoB;aAC9C,CAAC,CACF,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,G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AS;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;IACD,qBAAqB,EAAE;QACrB,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;KACjB;IACD,iBAAiB,EAAE;QACjB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,EAAE;QAChB,KAAK,EAAE,SAAS;KACjB;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,CAAC;QACf,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,EAAE;KACjB;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC;AAEH,eAAe,eAAe,CAAC","sourcesContent":["import React from 'react';\nimport { View, Text, TouchableOpacity, StyleSheet } from 'react-native';\nimport { useI18n } from '../hooks/useI18n';\n\n// Exemple d'utilisation du système i18n dans votre application\nexport const KYCFlowWithI18n: React.FC = () => {\n const { t, locale, setLocale, availableLocales } = useI18n();\n\n \n\n return (\n <View style={styles.container}>\n {/* Sélecteur de langue */}\n <View style={styles.languageSelector}>\n <Text style={styles.languageLabel}>{t('kyc.countrySelection.title')}</Text>\n <View style={styles.languageButtons}>\n {availableLocales.map((loc) => (\n <TouchableOpacity\n key={loc}\n style={[\n styles.languageButton,\n locale === loc && styles.activeLanguageButton\n ]}\n onPress={() => setLocale(loc)}\n >\n <Text style={[\n styles.languageButtonText,\n locale === loc && styles.activeLanguageButtonText\n ]}>\n {loc.toUpperCase()}\n </Text>\n </TouchableOpacity>\n ))}\n </View>\n </View>\n\n {/* Titre principal */}\n <Text style={styles.title}>{t('kyc.title')}</Text>\n <Text style={styles.subtitle}>{t('kyc.subtitle')}</Text>\n\n {/* Boutons d'action */}\n <View style={styles.buttonContainer}>\n <TouchableOpacity style={styles.primaryButton}>\n <Text style={styles.primaryButtonText}>\n {t('kyc.initialization.startButton')}\n </Text>\n </TouchableOpacity>\n \n <TouchableOpacity style={styles.secondaryButton}>\n <Text style={styles.secondaryButtonText}>\n {t('common.cancel')}\n </Text>\n </TouchableOpacity>\n </View>\n\n {/* Instructions */}\n <View style={styles.instructionsContainer}>\n <Text style={styles.instructionsTitle}>\n {t('kyc.initialization.requirements')}\n </Text>\n {/* {t('kyc.initialization.requirementsList').map((requirement: string, index: number) => (\n <Text key={index} style={styles.requirementItem}>\n • {requirement}\n </Text>\n ))} */}\n </View>\n\n {/* Exemple d'utilisation avec interpolation */}\n <Text style={styles.stepText}>\n {t('kyc.step', { current: 1, total: 3 })}\n </Text>\n\n {/* Exemple d'utilisation avec pluralisation */}\n <Text style={styles.countText}>\n {t('kyc.verificationProgress.estimatedTime')}\n </Text>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 20,\n backgroundColor: '#FFFFFF',\n },\n languageSelector: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: 20,\n paddingVertical: 10,\n borderBottomWidth: 1,\n borderBottomColor: '#E0E0E0',\n },\n languageLabel: {\n fontSize: 16,\n fontWeight: '600',\n color: '#333333',\n },\n languageButtons: {\n flexDirection: 'row',\n gap: 10,\n },\n languageButton: {\n paddingHorizontal: 16,\n paddingVertical: 8,\n borderRadius: 20,\n backgroundColor: '#F5F5F5',\n borderWidth: 1,\n borderColor: '#E0E0E0',\n },\n activeLanguageButton: {\n backgroundColor: '#007AFF',\n borderColor: '#007AFF',\n },\n languageButtonText: {\n fontSize: 14,\n fontWeight: '500',\n color: '#666666',\n },\n activeLanguageButtonText: {\n color: '#FFFFFF',\n },\n title: {\n fontSize: 28,\n fontWeight: 'bold',\n textAlign: 'center',\n marginBottom: 10,\n color: '#333333',\n },\n subtitle: {\n fontSize: 16,\n textAlign: 'center',\n marginBottom: 30,\n color: '#666666',\n lineHeight: 22,\n },\n buttonContainer: {\n gap: 15,\n marginBottom: 30,\n },\n primaryButton: {\n backgroundColor: '#007AFF',\n paddingVertical: 15,\n paddingHorizontal: 30,\n borderRadius: 8,\n alignItems: 'center',\n },\n primaryButtonText: {\n color: '#FFFFFF',\n fontSize: 16,\n fontWeight: '600',\n },\n secondaryButton: {\n backgroundColor: 'transparent',\n paddingVertical: 15,\n paddingHorizontal: 30,\n borderRadius: 8,\n alignItems: 'center',\n borderWidth: 1,\n borderColor: '#E0E0E0',\n },\n secondaryButtonText: {\n color: '#666666',\n fontSize: 16,\n fontWeight: '500',\n },\n instructionsContainer: {\n backgroundColor: '#F8F9FA',\n padding: 20,\n borderRadius: 10,\n marginBottom: 20,\n },\n instructionsTitle: {\n fontSize: 16,\n fontWeight: '600',\n marginBottom: 15,\n color: '#333333',\n },\n requirementItem: {\n fontSize: 14,\n marginBottom: 8,\n color: '#666666',\n lineHeight: 20,\n },\n stepText: {\n fontSize: 14,\n textAlign: 'center',\n color: '#007AFF',\n fontWeight: '500',\n marginBottom: 10,\n },\n countText: {\n fontSize: 12,\n textAlign: 'center',\n color: '#999999',\n fontStyle: 'italic',\n },\n});\n\nexport default KYCFlowWithI18n;\n"]}
@@ -0,0 +1,22 @@
1
+ import { IBbox } from "../../types/KYC.types";
2
+ export declare function frontVerification(result: {
3
+ path?: string;
4
+ regionMapping: string[];
5
+ selectedDocumentType: string;
6
+ code: string;
7
+ currentSide: string;
8
+ }): Promise<{
9
+ mrz?: any;
10
+ croppedBase64: string | undefined;
11
+ bbox: IBbox | undefined;
12
+ result: boolean;
13
+ detail: any[];
14
+ }>;
15
+ export declare function backVerification(result: {
16
+ path?: string;
17
+ regionMapping: string[];
18
+ selectedDocumentType: string;
19
+ code: string;
20
+ currentSide: string;
21
+ }): Promise<any>;
22
+ //# sourceMappingURL=CardAuthentification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardAuthentification.d.ts","sourceRoot":"","sources":["../../../src/modules/api/CardAuthentification.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;CAAE;;;;;;GA+B3J;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;CAAE,gBA2E1J"}
@@ -0,0 +1,107 @@
1
+ import kycService, { authentification, errorMessage } from "./KYCService";
2
+ import { cropByObb } from "../../utils/cropByObb";
3
+ export async function frontVerification(result) {
4
+ try {
5
+ console.log("Front verification", JSON.stringify({ result }, null, 2));
6
+ const token = await authentification();
7
+ const detected = await kycService.detectFaceOnId(result?.path || '', token, result?.selectedDocumentType || '');
8
+ if (!detected.result) {
9
+ throw new Error('Aucun visage détecté sur la carte. Veuillez reprendre.');
10
+ }
11
+ // Optional: crop image using card_obb for better MRZ/barcode extraction
12
+ let croppedBase64;
13
+ let bbox;
14
+ let mrz;
15
+ try {
16
+ const crop = await cropByObb(result?.path || '', detected.card_obb);
17
+ croppedBase64 = crop.base64;
18
+ bbox = crop.bbox;
19
+ }
20
+ catch { }
21
+ if (result.regionMapping.length > 0 && result.regionMapping.includes('MRZ')) {
22
+ mrz = await kycService.extractMrzText({ fileUri: result.path || '', docType: result?.selectedDocumentType || '', docRegion: result?.code || "", postfix: result?.currentSide, token: token });
23
+ }
24
+ return { ...detected, croppedBase64, bbox, ...(mrz ? { mrz } : {}) };
25
+ }
26
+ catch (e) {
27
+ console.error('Error front verification:', JSON.stringify(errorMessage(e), null, 2));
28
+ throw new Error(e?.message || 'Erreur de détection du visage');
29
+ }
30
+ }
31
+ export async function backVerification(result) {
32
+ try {
33
+ if (!result.path)
34
+ throw new Error('No path provided');
35
+ console.log("result.regionMapping", result.regionMapping, result.currentSide, result.code);
36
+ const token = await authentification();
37
+ // Fonction helper pour essayer MRZ puis barcode en fallback
38
+ const tryMrzWithBarcodeFallback = async () => {
39
+ try {
40
+ console.log("Tentative d'extraction MRZ");
41
+ const mrz = await kycService.extractMrzText({
42
+ fileUri: result.path,
43
+ docType: result?.selectedDocumentType || '',
44
+ docRegion: result?.code || '',
45
+ postfix: 'back',
46
+ token: token
47
+ });
48
+ return mrz;
49
+ }
50
+ catch (mrzError) {
51
+ console.log("MRZ échoué, tentative d'extraction barcode");
52
+ try {
53
+ const barcode = await kycService.extractBarcode({ fileUri: result.path, token: token });
54
+ return barcode;
55
+ }
56
+ catch (barcodeError) {
57
+ throw new Error(`MRZ et barcode ont échoué. MRZ: ${mrzError?.message}, Barcode: ${barcodeError?.message}`);
58
+ }
59
+ }
60
+ };
61
+ if (result.regionMapping.length > 2) {
62
+ return await tryMrzWithBarcodeFallback();
63
+ }
64
+ if (result.regionMapping.length > 0 && result.regionMapping.includes('MRZ')) {
65
+ try {
66
+ const mrz = await kycService.extractMrzText({
67
+ fileUri: result.path,
68
+ docType: result?.selectedDocumentType || '',
69
+ docRegion: result?.code || '',
70
+ postfix: 'back',
71
+ token: token
72
+ });
73
+ let bbox;
74
+ try {
75
+ const crop = await cropByObb(result?.path || '', mrz.card_obb);
76
+ bbox = crop.bbox;
77
+ }
78
+ catch { }
79
+ return { ...mrz, bbox };
80
+ }
81
+ catch (mrzError) {
82
+ throw new Error(`MRZ et barcode ont échoué. MRZ: ${mrzError?.message}, Barcode: ${mrzError?.message}`);
83
+ }
84
+ }
85
+ if (result.regionMapping.length > 0 && result.regionMapping.includes('2D_barcode')) {
86
+ try {
87
+ console.log("Tentative d'extraction barcode");
88
+ const barcode = await kycService.extractBarcode({ fileUri: result.path, token: token });
89
+ let bbox;
90
+ try {
91
+ const crop = await cropByObb(result?.path || '', barcode.card_obb);
92
+ bbox = crop.bbox;
93
+ }
94
+ catch { }
95
+ return { ...barcode, bbox };
96
+ }
97
+ catch (barcodeError) {
98
+ throw new Error(`Barcode et MRZ ont échoué. Barcode: ${barcodeError?.message}, MRZ: ${barcodeError?.message}`);
99
+ }
100
+ }
101
+ return null;
102
+ }
103
+ catch (e) {
104
+ throw new Error(e?.message || 'Erreur de détection du MRZ ou barcode');
105
+ }
106
+ }
107
+ //# sourceMappingURL=CardAuthentification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardAuthentification.js","sourceRoot":"","sources":["../../../src/modules/api/CardAuthentification.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAoH;IACxJ,IAAI,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,MAAM,gBAAgB,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,IAAI,EAAE,CAAC,CAAA;QAE/G,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;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AAO,EAAE,MAAM,CAAC,IAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;gBACzF,IAAI,IAAuB,CAAC;gBAC5B,IAAI,CAAC;oBACD,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE,EAAG,OAAe,CAAC,QAAQ,CAAC,CAAC;oBAC5E,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;gBACrB,CAAC;gBAAC,MAAM,CAAC,CAAC,CAAC;gBACX,OAAO,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,CAAC;YAChC,CAAC;YAAC,OAAO,YAAiB,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,uCAAuC,YAAY,EAAE,OAAO,UAAU,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;YACnH,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,IAAI,uCAAuC,CAAC,CAAC;IAC3E,CAAC;AACL,CAAC","sourcesContent":["import kycService, { authentification, errorMessage } from \"./KYCService\";\nimport { cropByObb } from \"../../utils/cropByObb\";\nimport { IBbox } from \"../../types/KYC.types\";\n\nexport async function frontVerification(result: { path?: string, regionMapping: string[], selectedDocumentType: string, code: string, currentSide: string, }) {\n try {\n\n console.log(\"Front verification\", JSON.stringify({ result }, null, 2));\n const token = await authentification();\n const detected = await kycService.detectFaceOnId(result?.path || '', token, result?.selectedDocumentType || '')\n\n if (!detected.result) {\n throw new Error('Aucun visage détecté sur la carte. Veuillez reprendre.');\n }\n\n // Optional: crop image using card_obb for better MRZ/barcode extraction\n let croppedBase64: string | undefined;\n let bbox: IBbox | undefined;\n let mrz: any | undefined;\n try {\n const crop = await cropByObb(result?.path || '', (detected as any).card_obb);\n croppedBase64 = crop.base64;\n bbox = crop.bbox;\n } catch { }\n\n if (result.regionMapping.length > 0 && result.regionMapping.includes('MRZ')) {\n mrz = await kycService.extractMrzText({ fileUri: result.path || '', docType: result?.selectedDocumentType || '', docRegion: result?.code || \"\", postfix: result?.currentSide, token: token })\n\n }\n\n return { ...detected, croppedBase64, bbox, ...(mrz ? { mrz } : {}) };\n } catch (e: any) {\n console.error('Error front verification:', JSON.stringify(errorMessage(e), null, 2));\n throw new Error(e?.message || 'Erreur de détection du visage');\n }\n}\n\nexport async function backVerification(result: { path?: string, regionMapping: string[], selectedDocumentType: string, code: string, currentSide: string, }) {\n try {\n if (!result.path) throw new Error('No path provided');\n console.log(\"result.regionMapping\", result.regionMapping, result.currentSide, result.code);\n const token = await authentification();\n\n\n\n // Fonction helper pour essayer MRZ puis barcode en fallback\n const tryMrzWithBarcodeFallback = async () => {\n try {\n console.log(\"Tentative d'extraction MRZ\");\n const mrz = await kycService.extractMrzText({\n fileUri: result.path!,\n docType: result?.selectedDocumentType || '',\n docRegion: result?.code || '',\n postfix: 'back',\n token: token\n });\n return mrz;\n } catch (mrzError: any) {\n console.log(\"MRZ échoué, tentative d'extraction barcode\");\n try {\n const barcode = await kycService.extractBarcode({ fileUri: result.path!, token: token });\n return barcode;\n } catch (barcodeError: any) {\n throw new Error(`MRZ et barcode ont échoué. MRZ: ${mrzError?.message}, Barcode: ${barcodeError?.message}`);\n }\n }\n };\n\n\n\n if (result.regionMapping.length > 2) {\n return await tryMrzWithBarcodeFallback();\n }\n\n if (result.regionMapping.length > 0 && result.regionMapping.includes('MRZ')) {\n try {\n const mrz = await kycService.extractMrzText({\n fileUri: result.path!,\n docType: result?.selectedDocumentType || '',\n docRegion: result?.code || '',\n postfix: 'back',\n token: token\n });\n let bbox: IBbox | undefined;\n try {\n const crop = await cropByObb(result?.path || '', (mrz as any).card_obb);\n bbox = crop.bbox;\n } catch { }\n return { ...mrz, bbox };\n } catch (mrzError: any) {\n throw new Error(`MRZ et barcode ont échoué. MRZ: ${mrzError?.message}, Barcode: ${mrzError?.message}`);\n }\n }\n\n if (result.regionMapping.length > 0 && result.regionMapping.includes('2D_barcode')) {\n try {\n console.log(\"Tentative d'extraction barcode\");\n const barcode = await kycService.extractBarcode({ fileUri: result.path!, token: token });\n let bbox: IBbox | undefined;\n try {\n const crop = await cropByObb(result?.path || '', (barcode as any).card_obb);\n bbox = crop.bbox;\n } catch { }\n return { ...barcode, bbox };\n } catch (barcodeError: any) {\n throw new Error(`Barcode et MRZ ont échoué. Barcode: ${barcodeError?.message}, MRZ: ${barcodeError?.message}`);\n }\n }\n return null;\n } catch (e: any) {\n throw new Error(e?.message || 'Erreur de détection du MRZ ou barcode');\n }\n}\n\n"]}
@@ -1,4 +1,5 @@
1
1
  import { OrientationVideoResponse } from '../../types/KYC.types';
2
+ import { SessionResponse, VerificationSessionRequest } from './types';
2
3
  export interface KYCRequest {
3
4
  userId: string;
4
5
  documentImage: string;
@@ -20,16 +21,71 @@ export interface FaceDetectionResponse {
20
21
  confidence: number;
21
22
  message: string;
22
23
  }
24
+ export interface SelfieVideoResponse {
25
+ orientation_direction: "center" | "left" | "right";
26
+ turn_score: number;
27
+ bbox: number[];
28
+ capture: boolean;
29
+ instruction: string;
30
+ error: string;
31
+ }
23
32
  export declare class KYCService {
24
33
  private baseURL;
25
34
  private apiKey;
35
+ private faceServiceURL;
36
+ private textExtractionServiceURL;
37
+ private mrzServiceURL;
38
+ private barcodeServiceURL;
39
+ private orientationServiceURL;
40
+ private backendServiceURL;
26
41
  constructor(baseURL: string, apiKey: string);
27
42
  private getHeaders;
28
43
  submitKYC(data: KYCRequest): Promise<KYCResponse>;
29
44
  detectFace(data: FaceDetectionRequest): Promise<FaceDetectionResponse>;
30
45
  validateDocument(documentImage: string, documentType: string): Promise<any>;
31
46
  getKYCStatus(verificationId: string): Promise<KYCResponse>;
47
+ processSelfieOrientationPicture(videoFile: string, token: string): Promise<SelfieVideoResponse[]>;
32
48
  processOrientationVideo(videoFile: string): Promise<OrientationVideoResponse>;
49
+ detectFaceOnId(idCardImageUri: string, token: string, docType: string): Promise<{
50
+ result: boolean;
51
+ detail: any[];
52
+ }>;
53
+ extractDocumentInformation(params: {
54
+ fileUri: string;
55
+ docType: string;
56
+ docRegion: string;
57
+ token: string;
58
+ }): Promise<any>;
59
+ extractBarcode(params: {
60
+ fileUri: string;
61
+ token: string;
62
+ }): Promise<any>;
63
+ extractMrzText(params: {
64
+ fileUri: string;
65
+ docType: string;
66
+ docRegion: string;
67
+ postfix?: string;
68
+ token: string;
69
+ }): Promise<any>;
70
+ recognizeFace(params: {
71
+ idPhotoUri: string;
72
+ selfiePhotoUri: string;
73
+ }): Promise<{
74
+ is_match: boolean;
75
+ similarity: number;
76
+ id_bbox?: number[];
77
+ selfie_bbox?: number[];
78
+ }>;
79
+ healthFaceDetection(): Promise<any>;
80
+ healthTextExtraction(): Promise<any>;
81
+ healthMrzService(): Promise<any>;
82
+ healthOrientationService(): Promise<any>;
83
+ newSession(token: string): Promise<SessionResponse>;
84
+ verificationSession(payload: VerificationSessionRequest): Promise<any>;
33
85
  }
34
- export default KYCService;
86
+ declare const kycService: KYCService;
87
+ export default kycService;
88
+ export declare function truncateFields(obj: any, maxLength?: number): any;
89
+ export declare const authentification: () => Promise<any>;
90
+ export declare const errorMessage: (error: any) => any;
35
91
  //# sourceMappingURL=KYCService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KYCService.d.ts","sourceRoot":"","sources":["../../../src/modules/api/KYCService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,UAAU,GAAG,SAAS,GAAG,iBAAiB,CAAC;CAC1D;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,SAAS,GAAG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