@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 +1 @@
1
- {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/components/OverLay/type.ts"],"names":[],"mappings":"","sourcesContent":["export interface IdCardOverlayProps {\n xMin: number;\n yMin: number;\n xMax: number;\n yMax: number;\n cornerOpacity: number;\n instructions: string;\n cornerColor?: string;\n stepperProps?: StepperProps;\n instructionsTile?: string;\n instructionsSubtitle?: string;\n orientation?: 'front' | 'left' | 'right';\n}\n\n\ninterface StepperProps {\n back: () => void;\n selectedDocumentType: string;\n step: number;\n totalSteps: number;\n}"]}
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/components/OverLay/type.ts"],"names":[],"mappings":"","sourcesContent":["import { ViewStyle } from \"react-native\";\nimport { ISilentCaptureResult } from \"../../types/KYC.types\";\n\nexport interface IdCardOverlayProps {\n xMin: number;\n yMin: number;\n xMax: number;\n yMax: number;\n cornerOpacity: number;\n instructions: string;\n cornerColor?: string;\n stepperProps?: StepperProps;\n instructionsTile?: string;\n instructionsSubtitle?: string;\n orientation?: 'center' | 'left' | 'right';\n isAnalyzing?: boolean;\n isSuccess?: boolean;\n language:string\n}\n\n\ninterface StepperProps {\n back: () => void;\n selectedDocumentType: string;\n step: number;\n totalSteps: number;\n}\n\nexport interface ExtractMrzTextResponse {\n parsed_data: {\n mrz_type: string;\n document_code: string;\n issuer_code: string;\n surname: string;\n given_name: string;\n document_number: string;\n document_number_checkdigit: string;\n nationality_code: string;\n birth_date: string;\n sex: string;\n expiry_date: string;\n optional_data: string;\n mrz_text: string;\n status: string;\n },\n success: boolean;\n}\n\n\n\nexport interface EnhancedCameraViewProps {\n instructions?: string;\n showCamera: boolean;\n cameraType?: 'front' | 'back';\n style?: ViewStyle;\n onCapture?: (result: { success: boolean; path?: string; error?: string }) => void;\n onSilentCapture?: (result: { success: boolean; path?: string; error?: string }) => void;\n silentCaptureResult?: ISilentCaptureResult;\n onError?: (event: { message: string }) => void;\n onClose?: () => void;\n enableFlash?: boolean;\n enableHdr?: boolean;\n quality?: 'low' | 'medium' | 'high';\n showCaptureButton?: boolean;\n showSwitchCamera?: boolean;\n overlayComponent?: React.ReactNode;\n bbox?: {\n xMin: number;\n yMin: number;\n xMax: number;\n yMax: number;\n borderColor?: string;\n borderWidth?: number;\n cornerRadius?: number;\n };\n canFlip?: boolean;\n // Video recording props\n enableVideo?: boolean;\n isRecording?: boolean;\n onVideoRecordingStart?: () => void;\n onVideoRecordingStop?: (result: { success: boolean; path?: string; error?: string }) => void;\n videoDuration?: number;\n }"]}
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
+ import { VerificationState } from '../types/KYC.types';
2
3
  export declare const TemplateKYCExample: React.FC<{
3
- onComplete: (data: Record<number, any>) => void;
4
+ onComplete: (data: VerificationState) => void;
4
5
  onCancel: () => void;
5
6
  onError: (error: string) => void;
7
+ language: string;
8
+ API_KEY: string;
6
9
  }>;
7
10
  //# sourceMappingURL=TemplateKYCExample.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateKYCExample.d.ts","sourceRoot":"","sources":["../../src/components/TemplateKYCExample.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA2V1B,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,CA4BpJ,CAAC"}
1
+ {"version":3,"file":"TemplateKYCExample.d.ts","sourceRoot":"","sources":["../../src/components/TemplateKYCExample.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAe,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AA+NpE,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,UAAU,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CA6BrL,CAAC"}
@@ -37,147 +37,72 @@ const advancedVerificationTemplate = {
37
37
  }
38
38
  },
39
39
  {
40
- id: 1,
41
- type: "id_card",
40
+ id: 6,
41
+ type: "country_selection",
42
42
  order: 2,
43
- templateId: 1,
44
43
  labels: {
45
- en: "Upload front of ID card",
46
- fr: "Téléversez le recto de votre carte d'identité"
44
+ en: "Select your country",
45
+ fr: "Sélectionnez votre pays"
47
46
  },
48
47
  instructions: {
49
- en: "Take a clear photo of the front of your ID.",
50
- fr: "Prenez une photo nette du recto de votre pièce."
48
+ en: "Choose your country of residence.",
49
+ fr: "Choisissez votre pays de résidence."
51
50
  },
52
51
  ui: {
53
- icon: "id-card-icon.png",
52
+ icon: "country-icon.png",
54
53
  themeColor: "#2DBD60",
55
- buttonText: { en: "Next", fr: "Suivant" }
54
+ buttonText: { en: "Confirm", fr: "Confirmer" }
56
55
  },
57
56
  config: {
58
- sides: ["front"],
59
- allowed_formats: ["jpg", "png"],
60
- max_size_mb: 5,
61
- document_types: ["id_card", "passport", "drivers_license", "national_id"],
62
- bbox_configs: {
63
- id_card: {
64
- xMin: 20,
65
- yMin: 140,
66
- xMax: 370,
67
- yMax: 340,
68
- borderColor: "#2DBD60",
69
- borderWidth: 4,
70
- cornerRadius: 12
71
- },
72
- passport: {
73
- xMin: 15,
74
- yMin: 130,
75
- xMax: 375,
76
- yMax: 350,
77
- borderColor: "#007AFF",
78
- borderWidth: 4,
79
- cornerRadius: 8
80
- },
81
- drivers_license: {
82
- xMin: 25,
83
- yMin: 150,
84
- xMax: 365,
85
- yMax: 330,
86
- borderColor: "#FF9500",
87
- borderWidth: 4,
88
- cornerRadius: 10
89
- },
90
- national_id: {
91
- xMin: 20,
92
- yMin: 140,
93
- xMax: 370,
94
- yMax: 340,
95
- borderColor: "#5856D6",
96
- borderWidth: 4,
97
- cornerRadius: 12
98
- },
99
- residence_permit: {
100
- xMin: 20,
101
- yMin: 140,
102
- xMax: 370,
103
- yMax: 340,
104
- borderColor: "#2DBD60",
105
- borderWidth: 4,
106
- cornerRadius: 12
107
- },
108
- voter_id: {
109
- xMin: 20,
110
- yMin: 140,
111
- xMax: 370,
112
- yMax: 340,
113
- borderColor: "#2DBD60",
114
- borderWidth: 4,
115
- cornerRadius: 12
116
- },
117
- military_id: {
118
- xMin: 20,
119
- yMin: 140,
120
- xMax: 370,
121
- yMax: 340,
122
- borderColor: "#2DBD60",
123
- borderWidth: 4,
124
- cornerRadius: 12
125
- },
126
- student_id: {
127
- xMin: 20,
128
- yMin: 140,
129
- xMax: 370,
130
- yMax: 340,
131
- borderColor: "#2DBD60",
132
- borderWidth: 4,
133
- cornerRadius: 12
134
- },
135
- work_permit: {
136
- xMin: 20,
137
- yMin: 140,
138
- xMax: 370,
139
- yMax: 340,
140
- borderColor: "#2DBD60",
141
- borderWidth: 4,
142
- cornerRadius: 12
143
- },
144
- other: {
145
- xMin: 20,
146
- yMin: 140,
147
- xMax: 370,
148
- yMax: 340,
149
- borderColor: "#2DBD60",
150
- borderWidth: 4,
151
- cornerRadius: 12
152
- }
153
- }
57
+ allowed_countries: ["CA", "FR", "CM", "US", "DE", "SN", "NG", "MA", "DZ", "CI", "KE", "GH"],
58
+ default_country: "CA",
59
+ required: true
154
60
  }
155
61
  },
156
62
  {
157
- id: 2,
63
+ id: 1,
158
64
  type: "id_card",
159
65
  order: 3,
160
66
  templateId: 1,
161
67
  labels: {
162
- en: "Upload back of ID card",
163
- fr: "Téléversez le verso de votre carte d'identité"
68
+ front: {
69
+ en: "Upload front of ID card",
70
+ fr: "Téléversez le recto de votre carte d'identité"
71
+ },
72
+ back: {
73
+ en: "Upload back of ID card",
74
+ fr: "Téléversez le verso de votre carte d'identité"
75
+ },
164
76
  },
165
77
  instructions: {
166
- en: "Take a clear photo of the back of your ID.",
167
- fr: "Prenez une photo nette du verso de votre pièce."
78
+ front: {
79
+ en: "Take a clear photo of the front of your ID.",
80
+ fr: "Prenez une photo nette du recto de votre pièce."
81
+ },
82
+ back: {
83
+ en: "Take a clear photo of the back of your ID.",
84
+ fr: "Prenez une photo nette du verso de votre pièce."
85
+ },
168
86
  },
169
87
  ui: {
170
- icon: "id-card-icon.png",
171
- themeColor: "#2DBD60",
172
- buttonText: { en: "Next", fr: "Suivant" }
88
+ front: {
89
+ icon: "id-card-icon.png",
90
+ themeColor: "#2DBD60",
91
+ buttonText: { en: "Next", fr: "Suivant" }
92
+ },
93
+ back: {
94
+ icon: "id-card-icon.png",
95
+ themeColor: "#2DBD60",
96
+ buttonText: { en: "Next", fr: "Suivant" }
97
+ },
173
98
  },
174
99
  config: {
175
- sides: ["back"],
100
+ sides: ["front", "back"],
176
101
  allowed_formats: ["jpg", "png"],
177
102
  max_size_mb: 5,
178
- document_types: ["id_card", "passport", "drivers_license", "national_id"],
103
+ document_types: ["drivers_licence", "passport", "drivers_licence", "national_id"],
179
104
  bbox_configs: {
180
- id_card: {
105
+ drivers_licence: {
181
106
  xMin: 20,
182
107
  yMin: 140,
183
108
  xMax: 370,
@@ -195,25 +120,7 @@ const advancedVerificationTemplate = {
195
120
  borderWidth: 4,
196
121
  cornerRadius: 8
197
122
  },
198
- drivers_license: {
199
- xMin: 25,
200
- yMin: 150,
201
- xMax: 365,
202
- yMax: 330,
203
- borderColor: "#FF9500",
204
- borderWidth: 4,
205
- cornerRadius: 10
206
- },
207
- national_id: {
208
- xMin: 20,
209
- yMin: 140,
210
- xMax: 370,
211
- yMax: 340,
212
- borderColor: "#5856D6",
213
- borderWidth: 4,
214
- cornerRadius: 12
215
- },
216
- residence_permit: {
123
+ identity_card: {
217
124
  xMin: 20,
218
125
  yMin: 140,
219
126
  xMax: 370,
@@ -222,7 +129,7 @@ const advancedVerificationTemplate = {
222
129
  borderWidth: 4,
223
130
  cornerRadius: 12
224
131
  },
225
- voter_id: {
132
+ health_insurance_card: {
226
133
  xMin: 20,
227
134
  yMin: 140,
228
135
  xMax: 370,
@@ -231,16 +138,16 @@ const advancedVerificationTemplate = {
231
138
  borderWidth: 4,
232
139
  cornerRadius: 12
233
140
  },
234
- military_id: {
141
+ national_id: {
235
142
  xMin: 20,
236
143
  yMin: 140,
237
144
  xMax: 370,
238
145
  yMax: 340,
239
- borderColor: "#2DBD60",
146
+ borderColor: "#5856D6",
240
147
  borderWidth: 4,
241
148
  cornerRadius: 12
242
149
  },
243
- student_id: {
150
+ permanent_residence: {
244
151
  xMin: 20,
245
152
  yMin: 140,
246
153
  xMax: 370,
@@ -258,22 +165,13 @@ const advancedVerificationTemplate = {
258
165
  borderWidth: 4,
259
166
  cornerRadius: 12
260
167
  },
261
- other: {
262
- xMin: 20,
263
- yMin: 140,
264
- xMax: 370,
265
- yMax: 340,
266
- borderColor: "#2DBD60",
267
- borderWidth: 4,
268
- cornerRadius: 12
269
- }
270
168
  }
271
169
  }
272
170
  },
273
171
  {
274
172
  id: 3,
275
173
  type: "selfie",
276
- order: 4,
174
+ order: 5,
277
175
  templateId: 1,
278
176
  labels: {
279
177
  en: "Take selfies from different angles",
@@ -291,58 +189,35 @@ const advancedVerificationTemplate = {
291
189
  config: {
292
190
  liveness_check: true,
293
191
  max_attempts: 3,
294
- orientations: ["front", "left", "right"]
192
+ orientations: ["center", "left", "right"]
295
193
  }
296
194
  },
297
- {
298
- id: 4,
299
- type: "file_upload",
300
- order: 5,
301
- labels: {
302
- en: "Upload proof of address",
303
- fr: "Téléversez un justificatif de domicile"
304
- },
305
- instructions: {
306
- en: "Upload a recent utility bill or bank statement (PDF, JPG, PNG).",
307
- fr: "Téléversez une facture récente ou un relevé bancaire (PDF, JPG, PNG)."
308
- },
309
- ui: {
310
- icon: "file-upload-icon.png",
311
- themeColor: "#2DBD60",
312
- buttonText: { en: "Upload", fr: "Téléverser" }
313
- },
314
- config: {
315
- allowed_formats: ["pdf", "jpg", "png"],
316
- max_size_mb: 10,
317
- required: true
318
- }
319
- },
320
- {
321
- id: 6,
322
- type: "country_selection",
323
- order: 6,
324
- labels: {
325
- en: "Select your country",
326
- fr: "Sélectionnez votre pays"
327
- },
328
- instructions: {
329
- en: "Choose your country of residence.",
330
- fr: "Choisissez votre pays de résidence."
331
- },
332
- ui: {
333
- icon: "country-icon.png",
334
- themeColor: "#2DBD60",
335
- buttonText: { en: "Confirm", fr: "Confirmer" }
336
- },
337
- config: {
338
- allowed_countries: ["FR", "CM", "US", "DE"],
339
- default_country: "FR",
340
- required: true
341
- }
342
- }
195
+ // {
196
+ // id: 4,
197
+ // type: "file_upload" as const,
198
+ // order: 6,
199
+ // labels: {
200
+ // en: "Upload proof of address",
201
+ // fr: "Téléversez un justificatif de domicile"
202
+ // },
203
+ // instructions: {
204
+ // en: "Upload a recent utility bill or bank statement (PDF, JPG, PNG).",
205
+ // fr: "Téléversez une facture récente ou un relevé bancaire (PDF, JPG, PNG)."
206
+ // },
207
+ // ui: {
208
+ // icon: "file-upload-icon.png",
209
+ // themeColor: "#2DBD60",
210
+ // buttonText: { en: "Upload", fr: "Téléverser" }
211
+ // },
212
+ // config: {
213
+ // allowed_formats: ["pdf", "jpg", "png"],
214
+ // max_size_mb: 10,
215
+ // required: true
216
+ // } as const
217
+ // },
343
218
  ]
344
219
  };
345
- export const TemplateKYCExample = ({ onComplete, onCancel, onError }) => {
220
+ export const TemplateKYCExample = ({ onComplete, onCancel, onError, language, API_KEY }) => {
346
221
  const handleComplete = (data) => {
347
222
  console.log('KYC Template completed with data:', data);
348
223
  onComplete(data);
@@ -357,8 +232,8 @@ export const TemplateKYCExample = ({ onComplete, onCancel, onError }) => {
357
232
  // Gérer l'erreur
358
233
  };
359
234
  return (<View style={styles.container}>
360
- <TemplateKYCFlow template={advancedVerificationTemplate} onComplete={handleComplete} onError={handleError} onCancel={handleCancel} language="fr" // ou "en" pour l'anglais
361
- />
235
+ <TemplateKYCFlow template={advancedVerificationTemplate} onComplete={handleComplete} onError={handleError} onCancel={handleCancel} language={language} // ou "en" pour l'anglais
236
+ API_KEY={API_KEY}/>
362
237
  </View>);
363
238
  };
364
239
  const styles = StyleSheet.create({
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateKYCExample.js","sourceRoot":"","sources":["../../src/components/TemplateKYCExample.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,uCAAuC;AACvC,MAAM,4BAA4B,GAAgB;IAChD,EAAE,EAAE,CAAC;IACL,IAAI,EAAE;QACJ,EAAE,EAAE,uBAAuB;QAC3B,EAAE,EAAE,sBAAsB;KAC3B;IACD,WAAW,EAAE;QACX,EAAE,EAAE,qCAAqC;QACzC,EAAE,EAAE,6CAA6C;KAClD;IACD,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE;QACV;YACE,EAAE,EAAE,CAAC;YACL,IAAI,EAAE,UAAmB;YACzB,KAAK,EAAE,CAAC;YACR,MAAM,EAAE;gBACN,EAAE,EAAE,sBAAsB;gBAC1B,EAAE,EAAE,4BAA4B;aACjC;YACD,YAAY,EAAE;gBACZ,EAAE,EAAE,oDAAoD;gBACxD,EAAE,EAAE,8EAA8E;aACnF;YACD,EAAE,EAAE;gBACF,IAAI,EAAE,mBAAmB;gBACzB,UAAU,EAAE,SAAS;gBACrB,UAAU,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,E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AAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;QAC5C,iBAAiB;IACnB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,eAAe,CACd,QAAQ,CAAC,CAAC,4BAA4B,CAAC,CACvC,UAAU,CAAC,CAAC,cAAc,CAAC,CAC3B,OAAO,CAAC,CAAC,WAAW,CAAC,CACrB,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,QAAQ,CAAC,IAAI,CAAC,yBAAyB;MAE3C;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC;AAEH,wEAAwE;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8DE","sourcesContent":["import React from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport { TemplateKYCFlow } from './TemplateKYCFlowRefactored';\nimport { KYCTemplate } from '../types/KYC.types';\n\n// Template JSON basé sur votre exemple\nconst advancedVerificationTemplate: KYCTemplate = {\n id: 1,\n name: {\n en: \"Advanced Verification\",\n fr: \"Vérification Avancée\"\n },\n description: {\n en: \"Extended identity verification flow\",\n fr: \"Processus de vérification d'identité étendu\"\n },\n version: \"1.1.0\",\n components: [\n {\n id: 5,\n type: \"location\" as const,\n order: 1,\n labels: {\n en: \"Enable your location\",\n fr: \"Activez votre localisation\"\n },\n instructions: {\n en: \"We need your GPS location for compliance purposes.\",\n fr: \"Nous avons besoin de votre localisation GPS pour des raisons réglementaires.\"\n },\n ui: {\n icon: \"location-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Enable Location\", fr: \"Activer la localisation\" }\n },\n config: {\n accuracy: \"high\",\n required: true\n } as const\n },\n {\n id: 1,\n type: \"id_card\" as const,\n order: 2,\n templateId: 1,\n labels: {\n en: \"Upload front of ID card\",\n fr: \"Téléversez le recto de votre carte d'identité\"\n },\n instructions: {\n en: \"Take a clear photo of the front of your ID.\",\n fr: \"Prenez une photo nette du recto de votre pièce.\"\n },\n ui: {\n icon: \"id-card-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Next\", fr: \"Suivant\" }\n },\n config: {\n sides: [\"front\"],\n allowed_formats: [\"jpg\", \"png\"],\n max_size_mb: 5,\n document_types: [\"id_card\", \"passport\", \"drivers_license\", \"national_id\"],\n bbox_configs: {\n id_card: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n passport: {\n xMin: 15,\n yMin: 130,\n xMax: 375,\n yMax: 350,\n borderColor: \"#007AFF\",\n borderWidth: 4,\n cornerRadius: 8\n },\n drivers_license: {\n xMin: 25,\n yMin: 150,\n xMax: 365,\n yMax: 330,\n borderColor: \"#FF9500\",\n borderWidth: 4,\n cornerRadius: 10\n },\n national_id: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#5856D6\",\n borderWidth: 4,\n cornerRadius: 12\n },\n residence_permit: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n voter_id: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n military_id: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n student_id: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n work_permit: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n other: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n }\n }\n } as const\n },\n {\n id: 2,\n type: \"id_card\" as const,\n order: 3,\n templateId: 1,\n labels: {\n en: \"Upload back of ID card\",\n fr: \"Téléversez le verso de votre carte d'identité\"\n },\n instructions: {\n en: \"Take a clear photo of the back of your ID.\",\n fr: \"Prenez une photo nette du verso de votre pièce.\"\n },\n ui: {\n icon: \"id-card-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Next\", fr: \"Suivant\" }\n },\n config: {\n sides: [\"back\"],\n allowed_formats: [\"jpg\", \"png\"],\n max_size_mb: 5,\n document_types: [\"id_card\", \"passport\", \"drivers_license\", \"national_id\"],\n bbox_configs: {\n id_card: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n passport: {\n xMin: 15,\n yMin: 130,\n xMax: 375,\n yMax: 350,\n borderColor: \"#007AFF\",\n borderWidth: 4,\n cornerRadius: 8\n },\n drivers_license: {\n xMin: 25,\n yMin: 150,\n xMax: 365,\n yMax: 330,\n borderColor: \"#FF9500\",\n borderWidth: 4,\n cornerRadius: 10\n },\n national_id: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#5856D6\",\n borderWidth: 4,\n cornerRadius: 12\n },\n residence_permit: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n voter_id: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n military_id: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n student_id: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n work_permit: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n other: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n }\n }\n } as const\n },\n {\n id: 3,\n type: \"selfie\" as const,\n order: 4,\n templateId: 1,\n labels: {\n en: \"Take selfies from different angles\",\n fr: \"Prenez des selfies sous différents angles\"\n },\n instructions: {\n en: \"Take selfies from front, left, and right angles.\",\n fr: \"Prenez des selfies de face, profil gauche et profil droit.\"\n },\n ui: {\n icon: \"selfie-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Next\", fr: \"Suivant\" }\n },\n config: {\n liveness_check: true,\n max_attempts: 3,\n orientations: [\"front\", \"left\", \"right\"]\n } as const\n },\n {\n id: 4,\n type: \"file_upload\" as const,\n order: 5,\n labels: {\n en: \"Upload proof of address\",\n fr: \"Téléversez un justificatif de domicile\"\n },\n instructions: {\n en: \"Upload a recent utility bill or bank statement (PDF, JPG, PNG).\",\n fr: \"Téléversez une facture récente ou un relevé bancaire (PDF, JPG, PNG).\"\n },\n ui: {\n icon: \"file-upload-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Upload\", fr: \"Téléverser\" }\n },\n config: {\n allowed_formats: [\"pdf\", \"jpg\", \"png\"],\n max_size_mb: 10,\n required: true\n } as const\n },\n {\n id: 6,\n type: \"country_selection\" as const,\n order: 6,\n labels: {\n en: \"Select your country\",\n fr: \"Sélectionnez votre pays\"\n },\n instructions: {\n en: \"Choose your country of residence.\",\n fr: \"Choisissez votre pays de résidence.\"\n },\n ui: {\n icon: \"country-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Confirm\", fr: \"Confirmer\" }\n },\n config: {\n allowed_countries: [\"FR\", \"CM\", \"US\", \"DE\"],\n default_country: \"FR\",\n required: true\n } as const\n }\n ]\n};\n\nexport const TemplateKYCExample: React.FC<{ onComplete: (data: Record<number, any>) => void, onCancel: () => void, onError: (error: string) => void }> = ({ onComplete, onCancel, onError }) => {\n const handleComplete = (data: Record<number, any>) => {\n console.log('KYC Template completed with data:', data);\n onComplete(data);\n // Ici vous pouvez envoyer les données à votre API\n };\n\n const handleCancel = () => {\n console.log('KYC Template flow cancelled');\n onCancel();\n };\n\n const handleError = (error: string) => {\n console.error('KYC Template error:', error);\n // Gérer l'erreur\n };\n\n return (\n <View style={styles.container}>\n <TemplateKYCFlow\n template={advancedVerificationTemplate}\n onComplete={handleComplete}\n onError={handleError}\n onCancel={handleCancel}\n language=\"fr\" // ou \"en\" pour l'anglais\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n\n// Exemples de différents types de documents gouvernementaux supportés :\n/*\nexport const documentTypeExamples = {\n // Carte d'identité nationale\n idCard: {\n document_type: \"id_card\" as const,\n labels: { en: \"Upload your ID card\", fr: \"Téléversez votre carte d'identité\" }\n },\n \n // Passeport\n passport: {\n document_type: \"passport\" as const,\n labels: { en: \"Upload your passport\", fr: \"Téléversez votre passeport\" }\n },\n \n // Permis de conduire\n driversLicense: {\n document_type: \"drivers_license\" as const,\n labels: { en: \"Upload your driver's license\", fr: \"Téléversez votre permis de conduire\" }\n },\n \n // Permis de séjour\n residencePermit: {\n document_type: \"residence_permit\" as const,\n labels: { en: \"Upload your residence permit\", fr: \"Téléversez votre permis de séjour\" }\n },\n \n // Carte nationale d'identité\n nationalId: {\n document_type: \"national_id\" as const,\n labels: { en: \"Upload your national ID\", fr: \"Téléversez votre carte nationale d'identité\" }\n },\n \n // Carte d'électeur\n voterId: {\n document_type: \"voter_id\" as const,\n labels: { en: \"Upload your voter ID\", fr: \"Téléversez votre carte d'électeur\" }\n },\n \n // Carte militaire\n militaryId: {\n document_type: \"military_id\" as const,\n labels: { en: \"Upload your military ID\", fr: \"Téléversez votre carte militaire\" }\n },\n \n // Carte d'étudiant\n studentId: {\n document_type: \"student_id\" as const,\n labels: { en: \"Upload your student ID\", fr: \"Téléversez votre carte d'étudiant\" }\n },\n \n // Permis de travail\n workPermit: {\n document_type: \"work_permit\" as const,\n labels: { en: \"Upload your work permit\", fr: \"Téléversez votre permis de travail\" }\n },\n \n // Autre document gouvernemental\n other: {\n document_type: \"other\" as const,\n labels: { en: \"Upload your government document\", fr: \"Téléversez votre document gouvernemental\" }\n }\n};\n*/ "]}
1
+ {"version":3,"file":"TemplateKYCExample.js","sourceRoot":"","sources":["../../src/components/TemplateKYCExample.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,uCAAuC;AACvC,MAAM,4BAA4B,GAAgB;IAChD,EAAE,EAAE,CAAC;IACL,IAAI,EAAE;QACJ,EAAE,EAAE,uBAAuB;QAC3B,EAAE,EAAE,sBAAsB;KAC3B;IACD,WAAW,EAAE;QACX,EAAE,EAAE,qCAAqC;QACzC,EAAE,EAAE,6CAA6C;KAClD;IACD,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE;QACV;YACE,EAAE,EAAE,CAAC;YACL,IAAI,EAAE,UAAmB;YACzB,KAAK,EAAE,CAAC;YACR,MAAM,EAAE;gBACN,EAAE,EAAE,sBAAsB;gBAC1B,EAAE,EAAE,4BAA4B;aACjC;YACD,YAAY,EAAE;gBACZ,EAAE,EAAE,oDAAoD;gBACxD,EAAE,EAAE,8EAA8E;aACnF;YACD,EAAE,EAAE;gBACF,IAAI,EAAE,m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Y,CAAC,CACvB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,yBAAyB;KAC7C,OAAO,CAAC,CAAC,OAAO,CAAC,EAErB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC;AAEH,wEAAwE;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8DE","sourcesContent":["import React from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport { TemplateKYCFlow } from './TemplateKYCFlowRefactored';\nimport { KYCTemplate, VerificationState } from '../types/KYC.types';\n\n// Template JSON basé sur votre exemple\nconst advancedVerificationTemplate: KYCTemplate = {\n id: 1,\n name: {\n en: \"Advanced Verification\",\n fr: \"Vérification Avancée\"\n },\n description: {\n en: \"Extended identity verification flow\",\n fr: \"Processus de vérification d'identité étendu\"\n },\n version: \"1.1.0\",\n components: [\n {\n id: 5,\n type: \"location\" as const,\n order: 1,\n labels: {\n en: \"Enable your location\",\n fr: \"Activez votre localisation\"\n },\n instructions: {\n en: \"We need your GPS location for compliance purposes.\",\n fr: \"Nous avons besoin de votre localisation GPS pour des raisons réglementaires.\"\n },\n ui: {\n icon: \"location-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Enable Location\", fr: \"Activer la localisation\" }\n },\n config: {\n accuracy: \"high\",\n required: true\n } as const\n },\n {\n id: 6,\n type: \"country_selection\" as const,\n order: 2,\n labels: {\n en: \"Select your country\",\n fr: \"Sélectionnez votre pays\"\n },\n instructions: {\n en: \"Choose your country of residence.\",\n fr: \"Choisissez votre pays de résidence.\"\n },\n ui: {\n icon: \"country-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Confirm\", fr: \"Confirmer\" }\n },\n config: {\n allowed_countries: [\"CA\", \"FR\", \"CM\", \"US\", \"DE\", \"SN\", \"NG\", \"MA\", \"DZ\",\"CI\", \"KE\",\"GH\"],\n default_country: \"CA\",\n required: true\n } as const\n },\n {\n id: 1,\n type: \"id_card\" as const,\n order: 3,\n templateId: 1,\n labels: {\n front: {\n en: \"Upload front of ID card\",\n fr: \"Téléversez le recto de votre carte d'identité\"\n },\n back: {\n en: \"Upload back of ID card\",\n fr: \"Téléversez le verso de votre carte d'identité\"\n },\n },\n instructions: {\n front: {\n en: \"Take a clear photo of the front of your ID.\",\n fr: \"Prenez une photo nette du recto de votre pièce.\"\n },\n back: {\n en: \"Take a clear photo of the back of your ID.\",\n fr: \"Prenez une photo nette du verso de votre pièce.\"\n },\n },\n ui: {\n front: {\n icon: \"id-card-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Next\", fr: \"Suivant\" }\n },\n back: {\n icon: \"id-card-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Next\", fr: \"Suivant\" }\n },\n },\n config: {\n sides: [\"front\", \"back\"],\n allowed_formats: [\"jpg\", \"png\"],\n max_size_mb: 5,\n document_types: [\"drivers_licence\", \"passport\", \"drivers_licence\", \"national_id\"],\n bbox_configs: {\n drivers_licence: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n passport: {\n xMin: 15,\n yMin: 130,\n xMax: 375,\n yMax: 350,\n borderColor: \"#007AFF\",\n borderWidth: 4,\n cornerRadius: 8\n },\n identity_card: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n health_insurance_card: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n national_id: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#5856D6\",\n borderWidth: 4,\n cornerRadius: 12\n },\n permanent_residence: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n\n\n work_permit: {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: \"#2DBD60\",\n borderWidth: 4,\n cornerRadius: 12\n },\n\n }\n } as const\n },\n {\n id: 3,\n type: \"selfie\" as const,\n order: 5,\n templateId: 1,\n labels: {\n en: \"Take selfies from different angles\",\n fr: \"Prenez des selfies sous différents angles\"\n },\n instructions: {\n en: \"Take selfies from front, left, and right angles.\",\n fr: \"Prenez des selfies de face, profil gauche et profil droit.\"\n },\n ui: {\n icon: \"selfie-icon.png\",\n themeColor: \"#2DBD60\",\n buttonText: { en: \"Next\", fr: \"Suivant\" }\n },\n config: {\n liveness_check: true,\n max_attempts: 3,\n orientations: [\"center\", \"left\", \"right\"]\n } as const\n },\n // {\n // id: 4,\n // type: \"file_upload\" as const,\n // order: 6,\n // labels: {\n // en: \"Upload proof of address\",\n // fr: \"Téléversez un justificatif de domicile\"\n // },\n // instructions: {\n // en: \"Upload a recent utility bill or bank statement (PDF, JPG, PNG).\",\n // fr: \"Téléversez une facture récente ou un relevé bancaire (PDF, JPG, PNG).\"\n // },\n // ui: {\n // icon: \"file-upload-icon.png\",\n // themeColor: \"#2DBD60\",\n // buttonText: { en: \"Upload\", fr: \"Téléverser\" }\n // },\n // config: {\n // allowed_formats: [\"pdf\", \"jpg\", \"png\"],\n // max_size_mb: 10,\n // required: true\n // } as const\n // },\n\n ]\n};\n\nexport const TemplateKYCExample: React.FC<{ onComplete: (data: VerificationState) => void, onCancel: () => void, onError: (error: string) => void, language: string, API_KEY: string }> = ({ onComplete, onCancel, onError, language, API_KEY }) => {\n const handleComplete = (data: VerificationState) => {\n console.log('KYC Template completed with data:', data);\n onComplete(data);\n // Ici vous pouvez envoyer les données à votre API\n };\n\n const handleCancel = () => {\n console.log('KYC Template flow cancelled');\n onCancel();\n };\n\n const handleError = (error: string) => {\n console.error('KYC Template error:', error);\n // Gérer l'erreur\n };\n\n return (\n <View style={styles.container}>\n <TemplateKYCFlow\n template={advancedVerificationTemplate}\n onComplete={handleComplete}\n onError={handleError}\n onCancel={handleCancel}\n language={language} // ou \"en\" pour l'anglais\n API_KEY={API_KEY}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n\n// Exemples de différents types de documents gouvernementaux supportés :\n/*\nexport const documentTypeExamples = {\n // Carte d'identité nationale\n idCard: {\n document_type: \"id_card\" as const,\n labels: { en: \"Upload your ID card\", fr: \"Téléversez votre carte d'identité\" }\n },\n \n // Passeport\n passport: {\n document_type: \"passport\" as const,\n labels: { en: \"Upload your passport\", fr: \"Téléversez votre passeport\" }\n },\n \n // Permis de conduire\n driversLicense: {\n document_type: \"drivers_license\" as const,\n labels: { en: \"Upload your driver's license\", fr: \"Téléversez votre permis de conduire\" }\n },\n \n // Permis de séjour\n residencePermit: {\n document_type: \"residence_permit\" as const,\n labels: { en: \"Upload your residence permit\", fr: \"Téléversez votre permis de séjour\" }\n },\n \n // Carte nationale d'identité\n nationalId: {\n document_type: \"national_id\" as const,\n labels: { en: \"Upload your national ID\", fr: \"Téléversez votre carte nationale d'identité\" }\n },\n \n // Carte d'électeur\n voterId: {\n document_type: \"voter_id\" as const,\n labels: { en: \"Upload your voter ID\", fr: \"Téléversez votre carte d'électeur\" }\n },\n \n // Carte militaire\n militaryId: {\n document_type: \"military_id\" as const,\n labels: { en: \"Upload your military ID\", fr: \"Téléversez votre carte militaire\" }\n },\n \n // Carte d'étudiant\n studentId: {\n document_type: \"student_id\" as const,\n labels: { en: \"Upload your student ID\", fr: \"Téléversez votre carte d'étudiant\" }\n },\n \n // Permis de travail\n workPermit: {\n document_type: \"work_permit\" as const,\n labels: { en: \"Upload your work permit\", fr: \"Téléversez votre permis de travail\" }\n },\n \n // Autre document gouvernemental\n other: {\n document_type: \"other\" as const,\n labels: { en: \"Upload your government document\", fr: \"Téléversez votre document gouvernemental\" }\n }\n};\n*/ "]}
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
- import { KYCTemplate } from '../types/KYC.types';
2
+ import { KYCTemplate, VerificationState } from '../types/KYC.types';
3
3
  interface TemplateKYCFlowProps {
4
4
  template: KYCTemplate;
5
- onComplete?: (data: Record<number, unknown>) => void;
5
+ onComplete?: (data: VerificationState) => void;
6
6
  onError?: (error: string) => void;
7
7
  language?: string;
8
8
  onCancel?: () => void;
9
+ API_KEY?: string;
9
10
  }
10
11
  export declare const TemplateKYCFlow: React.FC<TemplateKYCFlowProps>;
11
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateKYCFlowRefactored.d.ts","sourceRoot":"","sources":["../../src/components/TemplateKYCFlowRefactored.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAQjD,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAiB1D,CAAC"}
1
+ {"version":3,"file":"TemplateKYCFlowRefactored.d.ts","sourceRoot":"","sources":["../../src/components/TemplateKYCFlowRefactored.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAYpE,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoB1D,CAAC"}