@transfergratis/react-native-sdk 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/build/components/KYCElements/IDCardCapture.js +4 -4
- package/build/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/components/KYCElements/VerificationProgressTemplate.js +3 -3
- package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -1
- package/build/components/TemplateKYCExample.d.ts.map +1 -1
- package/build/components/TemplateKYCExample.js +5 -8
- package/build/components/TemplateKYCExample.js.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.js +7 -2
- package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
- package/build/i18n/en/index.d.ts +1 -0
- package/build/i18n/en/index.d.ts.map +1 -1
- package/build/i18n/en/index.js +2 -1
- package/build/i18n/en/index.js.map +1 -1
- package/build/i18n/fr/index.d.ts +1 -0
- package/build/i18n/fr/index.d.ts.map +1 -1
- package/build/i18n/fr/index.js +2 -1
- package/build/i18n/fr/index.js.map +1 -1
- package/build/modules/api/KYCService.d.ts.map +1 -1
- package/build/modules/api/KYCService.js +12 -6
- package/build/modules/api/KYCService.js.map +1 -1
- package/build/utils/cropByObb.js +3 -3
- package/build/utils/cropByObb.js.map +1 -1
- package/package.json +1 -1
- package/src/components/KYCElements/IDCardCapture.tsx +9 -9
- package/src/components/KYCElements/VerificationProgressTemplate.tsx +10 -10
- package/src/components/TemplateKYCExample.tsx +6 -8
- package/src/components/TemplateKYCFlowRefactored.tsx +10 -3
- package/src/i18n/en/index.ts +2 -1
- package/src/i18n/fr/index.ts +2 -1
- package/src/modules/api/KYCService.ts +12 -7
- package/src/utils/cropByObb.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateKYCFlowRefactored.js","sourceRoot":"","sources":["../../src/components/TemplateKYCFlowRefactored.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OA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,QAAQ;QACpB,MAAM,EAAE,IAAI;KACb;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;QAClB,YAAY,EAAE,EAAE;KACjB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet, SafeAreaView, TouchableOpacity, ActivityIndicator, Dimensions, Alert } from 'react-native';\nimport { KYCTemplate, VerificationState } from '../types/KYC.types';\nimport { TemplateKYCFlowProvider, useTemplateKYCFlowContext } from '../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../hooks/useI18n';\nimport { IDCardCapture } from './KYCElements/IDCardCapture';\nimport { SelfieCaptureTemplate } from './KYCElements/SelfieCaptureTemplate';\nimport { FileUploadTemplate } from './KYCElements/FileUploadTemplate';\nimport { LocationCaptureTemplate } from './KYCElements/LocationCaptureTemplate';\nimport { CountrySelectionTemplate } from './KYCElements/CountrySelectionTemplate';\nimport { InitializationStep } from './KYCElements/InitializationStep';\nimport { ReviewSubmitTemplate } from './KYCElements/ReviewSubmitTemplate';\nimport { VerificationProgressTemplate } from './KYCElements/VerificationProgressTemplate';\n\ninterface TemplateKYCFlowProps {\n template: KYCTemplate;\n onComplete?: (data: VerificationState) => void;\n onError?: (error: string) => void;\n language?: string;\n onCancel?: () => void;\n API_KEY?: string;\n}\n\nexport const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({\n template,\n onComplete,\n onError,\n language = 'fr',\n onCancel,\n API_KEY,\n}) => {\n const { t } = useI18n();\n \n const OnCancel = () => {\n Alert.alert(\n t('kyc.cancelConfirmation.title'),\n t('kyc.cancelConfirmation.message'),\n [\n { text: t('kyc.cancelConfirmation.cancelButton'), style: 'cancel' },\n {\n text: t('kyc.cancelConfirmation.confirmButton'),\n onPress: () => {\n onCancel?.();\n }\n },\n ]\n );\n };\n return (\n <TemplateKYCFlowProvider\n template={template}\n onComplete={onComplete}\n onError={onError}\n onCancel={OnCancel}\n initialLanguage={language}\n apiKey={API_KEY}\n >\n <TemplateKYCFlowContent onCancel={OnCancel} />\n </TemplateKYCFlowProvider>\n );\n};\n\nconst TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel }) => {\n const {\n state,\n actions,\n currentComponent,\n progress,\n } = useTemplateKYCFlowContext();\n\n const { t } = useI18n();\n\n const updateComponentData = (componentId: number, data: unknown) => {\n actions.updateComponentData(componentId, data);\n };\n\n if (!currentComponent) {\n return (\n <View style={styles.container}>\n <Text style={styles.errorText}>{t('errors.unknownError')}</Text>\n </View>\n );\n }\n\n // Rendu du composant actuel\n const renderCurrentComponent = () => {\n const commonProps = {\n component: currentComponent,\n value: state.componentData[currentComponent.id],\n onValueChange: (data: unknown) => updateComponentData(currentComponent.id, data),\n error: state.errors[currentComponent.id],\n language: state.currentLanguage,\n };\n\n if (!state.session.isInitialized) {\n return <InitializationStep session={state.session} />\n }\n\n switch (currentComponent.type) {\n case 'id_card':\n return <IDCardCapture {...commonProps} />;\n\n case 'selfie':\n return <SelfieCaptureTemplate {...commonProps} />;\n\n case 'file_upload':\n return <FileUploadTemplate {...commonProps} />;\n\n case 'location':\n return <LocationCaptureTemplate {...commonProps} />;\n\n case 'country_selection':\n return <CountrySelectionTemplate {...commonProps} />;\n\n case 'review_submit':\n return <ReviewSubmitTemplate {...commonProps} />;\n\n case 'verification_progress':\n return <VerificationProgressTemplate {...commonProps} />;\n\n default:\n return (\n <View style={styles.unsupportedContainer}>\n <Text style={styles.unsupportedText}>\n {t('errors.unknownError')}: {currentComponent.type}\n </Text>\n </View>\n );\n }\n };\n\n return (\n <View style={{ flex: 1 }}>\n {state.isProcessing && (\n <View style={styles.processingContainer}>\n <Text style={styles.processingText}>{t('common.loading')}</Text>\n <ActivityIndicator size=\"large\" color=\"#fff\" />\n </View>\n )}\n <SafeAreaView style={styles.container}>\n {/* Header avec informations sur l'étape */}\n\n {(state.showCustomStepper && state.session.isInitialized) ? (\n <View style={styles.header}>\n <Text style={styles.progressText}>\n {t('kyc.step', { current: state.currentComponentIndex + 1, total: state.template.components.length })}\n </Text>\n <View style={styles.progressContainer}>\n <View style={styles.progressBar}>\n <View\n style={[\n styles.progressFill,\n { width: `${progress}%` }\n ]}\n />\n </View>\n\n </View>\n\n <View style={{ position: 'absolute', right: 12, top: 12 }}>\n <TouchableOpacity onPress={onCancel} disabled={!onCancel} style={{ opacity: onCancel ? 1 : 0.5 }}>\n <Text style={{ fontSize: 20, fontWeight: 'bold', color: '#333' }}>{`X`}</Text>\n </TouchableOpacity>\n </View>\n </View>\n ) : null}\n\n {/* Contenu principal */}\n <View style={styles.content}>\n {renderCurrentComponent()}\n </View>\n </SafeAreaView>\n </View>\n\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: '#f5f5f5',\n\n },\n header: {\n backgroundColor: 'white',\n paddingVertical: 20,\n paddingHorizontal: 12,\n borderBottomWidth: 1,\n borderBottomColor: '#e0e0e0',\n marginHorizontal: 12,\n marginTop: 12,\n // shadow\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.15,\n shadowRadius: 1.84,\n elevation: 5,\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n },\n description: {\n fontSize: 16,\n color: '#666',\n marginBottom: 20,\n },\n progressContainer: {\n // marginBottom: 20,\n },\n progressBar: {\n height: 8,\n backgroundColor: '#e0e0e0',\n borderRadius: 4,\n overflow: 'hidden',\n },\n progressFill: {\n height: '100%',\n backgroundColor: '#2DBD60',\n borderRadius: 4,\n },\n progressText: {\n fontSize: 14,\n color: 'black',\n fontWeight: '600',\n textAlign: 'left',\n marginBottom: 8,\n },\n stepInfo: {\n backgroundColor: '#f8f9fa',\n padding: 16,\n borderRadius: 8,\n borderLeftWidth: 4,\n borderLeftColor: '#2DBD60',\n },\n stepTitle: {\n fontSize: 18,\n fontWeight: '600',\n color: '#333',\n marginBottom: 8,\n },\n stepDescription: {\n fontSize: 14,\n color: '#666',\n lineHeight: 20,\n },\n content: {\n flex: 1,\n // justifyContent: 'center',\n alignItems: 'center',\n // paddingTop: Dimensions.get('window').height > 760 ? 12 : 0,\n },\n navigation: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 20,\n backgroundColor: 'white',\n borderTopWidth: 1,\n borderTopColor: '#e0e0e0',\n },\n navButton: {\n paddingHorizontal: 24,\n paddingVertical: 12,\n borderRadius: 8,\n minWidth: 100,\n alignItems: 'center',\n },\n primaryButton: {\n backgroundColor: '#2DBD60',\n },\n navButtonText: {\n fontSize: 16,\n fontWeight: '600',\n color: 'white',\n },\n errorText: {\n color: '#dc2626',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n unsupportedContainer: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: 20,\n },\n unsupportedText: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n },\n processingContainer: {\n position: 'absolute',\n flex: 1,\n width: Dimensions.get('window').width,\n height: Dimensions.get('window').height,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 1000,\n },\n processingText: {\n fontSize: 16,\n color: '#fff',\n textAlign: 'center',\n fontWeight: 'bold',\n marginBottom: 10,\n },\n}); "]}
|
|
1
|
+
{"version":3,"file":"TemplateKYCFlowRefactored.js","sourceRoot":"","sources":["../../src/components/TemplateKYCFlowRefactored.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE5H,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA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AC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM;QACvC,eAAe,EAAE,oBAAoB;QACrC,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,QAAQ;KACjB;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;QAClB,YAAY,EAAE,EAAE;KACjB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet, SafeAreaView, TouchableOpacity, ActivityIndicator, Dimensions, Alert } from 'react-native';\nimport { KYCTemplate, VerificationState } from '../types/KYC.types';\nimport { TemplateKYCFlowProvider, useTemplateKYCFlowContext } from '../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../hooks/useI18n';\nimport { IDCardCapture } from './KYCElements/IDCardCapture';\nimport { SelfieCaptureTemplate } from './KYCElements/SelfieCaptureTemplate';\nimport { FileUploadTemplate } from './KYCElements/FileUploadTemplate';\nimport { LocationCaptureTemplate } from './KYCElements/LocationCaptureTemplate';\nimport { CountrySelectionTemplate } from './KYCElements/CountrySelectionTemplate';\nimport { InitializationStep } from './KYCElements/InitializationStep';\nimport { ReviewSubmitTemplate } from './KYCElements/ReviewSubmitTemplate';\nimport { VerificationProgressTemplate } from './KYCElements/VerificationProgressTemplate';\n\ninterface TemplateKYCFlowProps {\n template: KYCTemplate;\n onComplete?: (data: VerificationState) => void;\n onError?: (error: string) => void;\n language?: string;\n onCancel?: () => void;\n API_KEY?: string;\n}\n\nexport const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({\n template,\n onComplete,\n onError,\n language = 'fr',\n onCancel,\n API_KEY,\n}) => {\n const { t } = useI18n();\n\n const OnCancel = () => {\n Alert.alert(\n t('kyc.cancelConfirmation.title'),\n t('kyc.cancelConfirmation.message'),\n [\n { text: t('kyc.cancelConfirmation.cancelButton'), style: 'cancel' },\n {\n text: t('kyc.cancelConfirmation.confirmButton'),\n onPress: () => {\n onCancel?.();\n }\n },\n ]\n );\n };\n return (\n <TemplateKYCFlowProvider\n template={template}\n onComplete={onComplete}\n onError={onError}\n onCancel={OnCancel}\n initialLanguage={language}\n apiKey={API_KEY}\n >\n <TemplateKYCFlowContent onCancel={OnCancel} />\n </TemplateKYCFlowProvider>\n );\n};\n\nconst TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel }) => {\n const {\n state,\n actions,\n currentComponent,\n progress,\n } = useTemplateKYCFlowContext();\n\n const { t } = useI18n();\n\n const updateComponentData = (componentId: number, data: unknown) => {\n actions.updateComponentData(componentId, data);\n };\n\n if (!currentComponent) {\n return (\n <View style={styles.container}>\n <Text style={styles.errorText}>{t('errors.unknownError')}</Text>\n </View>\n );\n }\n\n // Rendu du composant actuel\n const renderCurrentComponent = () => {\n const commonProps = {\n component: currentComponent,\n value: state.componentData[currentComponent.id],\n onValueChange: (data: unknown) => updateComponentData(currentComponent.id, data),\n error: state.errors[currentComponent.id],\n language: state.currentLanguage,\n };\n\n if (!state.session.isInitialized) {\n return <InitializationStep session={state.session} />\n }\n\n switch (currentComponent.type) {\n case 'id_card':\n return <IDCardCapture {...commonProps} />;\n\n case 'selfie':\n return <SelfieCaptureTemplate {...commonProps} />;\n\n case 'file_upload':\n return <FileUploadTemplate {...commonProps} />;\n\n case 'location':\n return <LocationCaptureTemplate {...commonProps} />;\n\n case 'country_selection':\n return <CountrySelectionTemplate {...commonProps} />;\n\n case 'review_submit':\n return <ReviewSubmitTemplate {...commonProps} />;\n\n case 'verification_progress':\n return <VerificationProgressTemplate {...commonProps} />;\n\n default:\n return (\n <View style={styles.unsupportedContainer}>\n <Text style={styles.unsupportedText}>\n {t('errors.unknownError')}: {currentComponent.type}\n </Text>\n </View>\n );\n }\n };\n\n return (\n <View style={{ flex: 1, position: 'relative' }}>\n {state.isProcessing && (\n <View style={styles.processingContainer}>\n <Text style={styles.processingText}>{t('common.loading')}</Text>\n <ActivityIndicator size=\"large\" color=\"#fff\" />\n </View>\n )}\n <SafeAreaView style={styles.container}>\n {/* Header avec informations sur l'étape */}\n\n {(state.showCustomStepper && state.session.isInitialized) ? (\n <View style={styles.header}>\n <Text style={styles.progressText}>\n {t('kyc.step', { current: state.currentComponentIndex + 1, total: state.template.components.length })}\n </Text>\n <View style={styles.progressContainer}>\n <View style={styles.progressBar}>\n <View\n style={[\n styles.progressFill,\n { width: `${progress}%` }\n ]}\n />\n </View>\n\n </View>\n\n <View style={{ position: 'absolute', right: 12, top: 12 }}>\n <TouchableOpacity onPress={onCancel} disabled={!onCancel} style={{ opacity: onCancel ? 1 : 0.5 }}>\n <Text style={{ fontSize: 20, fontWeight: 'bold', color: '#333' }}>{`X`}</Text>\n </TouchableOpacity>\n </View>\n </View>\n ) : null}\n\n {/* Contenu principal */}\n <View style={styles.content}>\n {renderCurrentComponent()}\n </View>\n\n {state.isProcessing && (\n <View style={styles.processingContainer}>\n <Text style={styles.processingText}>{t('common.loading')}</Text>\n <ActivityIndicator size=\"large\" color=\"#fff\" />\n </View>\n )}\n </SafeAreaView>\n </View>\n\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: '#f5f5f5',\n\n },\n header: {\n backgroundColor: 'white',\n paddingVertical: 20,\n paddingHorizontal: 12,\n borderBottomWidth: 1,\n borderBottomColor: '#e0e0e0',\n marginHorizontal: 12,\n marginTop: 12,\n // shadow\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.15,\n shadowRadius: 1.84,\n elevation: 5,\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n },\n description: {\n fontSize: 16,\n color: '#666',\n marginBottom: 20,\n },\n progressContainer: {\n // marginBottom: 20,\n },\n progressBar: {\n height: 8,\n backgroundColor: '#e0e0e0',\n borderRadius: 4,\n overflow: 'hidden',\n },\n progressFill: {\n height: '100%',\n backgroundColor: '#2DBD60',\n borderRadius: 4,\n },\n progressText: {\n fontSize: 14,\n color: 'black',\n fontWeight: '600',\n textAlign: 'left',\n marginBottom: 8,\n },\n stepInfo: {\n backgroundColor: '#f8f9fa',\n padding: 16,\n borderRadius: 8,\n borderLeftWidth: 4,\n borderLeftColor: '#2DBD60',\n },\n stepTitle: {\n fontSize: 18,\n fontWeight: '600',\n color: '#333',\n marginBottom: 8,\n },\n stepDescription: {\n fontSize: 14,\n color: '#666',\n lineHeight: 20,\n },\n content: {\n flex: 1,\n // justifyContent: 'center',\n alignItems: 'center',\n // paddingTop: Dimensions.get('window').height > 760 ? 12 : 0,\n },\n navigation: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 20,\n backgroundColor: 'white',\n borderTopWidth: 1,\n borderTopColor: '#e0e0e0',\n },\n navButton: {\n paddingHorizontal: 24,\n paddingVertical: 12,\n borderRadius: 8,\n minWidth: 100,\n alignItems: 'center',\n },\n primaryButton: {\n backgroundColor: '#2DBD60',\n },\n navButtonText: {\n fontSize: 16,\n fontWeight: '600',\n color: 'white',\n },\n errorText: {\n color: '#dc2626',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n unsupportedContainer: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: 20,\n },\n unsupportedText: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n },\n processingContainer: {\n position: 'absolute',\n flex: 1,\n width: Dimensions.get('window').width,\n height: Dimensions.get('window').height,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 10000000,\n },\n processingText: {\n fontSize: 16,\n color: '#fff',\n textAlign: 'center',\n fontWeight: 'bold',\n marginBottom: 10,\n },\n}); "]}
|
package/build/i18n/en/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/en/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/en/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Nd,CAAC"}
|
package/build/i18n/en/index.js
CHANGED
|
@@ -81,7 +81,8 @@ export const en = {
|
|
|
81
81
|
usePhotoButton: 'Use This Photo',
|
|
82
82
|
processing: 'Processing image...',
|
|
83
83
|
success: 'ID captured successfully',
|
|
84
|
-
error: 'Failed to capture ID. Please try again.'
|
|
84
|
+
error: 'Failed to capture ID. Please try again.',
|
|
85
|
+
captureTitle: '%{side} side of your government document',
|
|
85
86
|
},
|
|
86
87
|
// Selfie Capture
|
|
87
88
|
selfieCapture: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/en/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,qBAAqB;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,aAAa;KACpB;IAED,WAAW;IACX,GAAG,EAAE;QACH,KAAK,EAAE,uBAAuB;QAC9B,QAAQ,EAAE,iDAAiD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B;QAC1C,YAAY,EAAE,oCAAoC;QAClD,YAAY,EAAE,8CAA8C;KAC7D;IAED,sBAAsB;IACtB,UAAU,EAAE;QACV,QAAQ,EAAE,wBAAwB;QAClC,YAAY,EAAE,oCAAoC;QAClD,YAAY,EAAE,mCAAmC;QACjD,WAAW,EAAE,2BAA2B;QACxC,SAAS,EAAE,oCAAoC;QAC/C,SAAS,EAAE,wCAAwC;QACnD,aAAa,EAAE,gBAAgB;QAC/B,YAAY,EAAE,mBAAmB;QACjC,oBAAoB,EAAE,yBAAyB;KAChD;CACF,CAAC","sourcesContent":["export const en = {\n // Common UI elements\n common: {\n next: 'Next',\n previous: 'Previous',\n continue: 'Continue',\n cancel: 'Cancel',\n confirm: 'Confirm',\n submit: 'Submit',\n retry: 'Retry',\n close: 'Close',\n back: 'Back',\n loading: 'Loading...',\n error: 'Error',\n success: 'Success',\n warning: 'Warning',\n info: 'Information',\n },\n\n // KYC Flow\n kyc: {\n title: 'Identity Verification',\n subtitle: 'Complete your identity verification to continue',\n step: 'Step %{current} of %{total}',\n \n // Initialization\n initialization: {\n title: 'Welcome to Identity Verification',\n description: 'We need to verify your identity to comply with regulations and ensure security.',\n startButton: 'Start Verification',\n requirements: 'What you\\'ll need:',\n requirementsList: [\n 'Valid government-issued ID',\n 'Good lighting for photos',\n 'Stable internet connection'\n ]\n },\n\n // Location Capture\n locationCapture: {\n title: 'Secure Your Verification',\n description: 'Allow location access to help us protect your account and prevent fraudulent activity during verification.',\n howThisHelps: 'How this helps:',\n howThisHelpsList: '• Verifies your device location matches your identity\\n• Detects and prevents unauthorized access\\n• Ensures compliance with security regulations',\n permissionDeniedTitle: 'Permission denied',\n permissionDeniedMessage: 'Location permission is required to continue.',\n locationDisabledTitle: 'Location disabled',\n locationDisabledMessage: 'Please enable location services on your device to continue.',\n errorTitle: 'Error',\n errorMessage: 'Unable to retrieve your location. Please try again.',\n obtained: 'Location obtained',\n latitudeLabel: 'Latitude',\n longitudeLabel: 'Longitude',\n accuracyLabel: 'Accuracy',\n resetButton: 'Reset',\n enableButton: 'Enable Location Access',\n fetching: 'Fetching...'\n },\n\n // Country Selection\n countrySelection: {\n title: 'Select Your Country',\n subtitle: 'Choose the country that issued your ID document',\n searchPlaceholder: 'Search for your country...',\n noResults: 'No countries found',\n selectCountry: 'Select Country'\n },\n\n // ID Card Capture\n idCardCapture: {\n title: 'Capture Your ID Document',\n subtitle: 'Take a clear photo of your ID document',\n frontSide: 'Front Side',\n backSide: 'Back Side',\n instructions: {\n title: 'Instructions:',\n list: [\n 'Place your ID on a flat surface',\n 'Ensure good lighting',\n 'Keep the entire document in frame',\n 'Avoid glare and shadows'\n ]\n },\n captureButton: 'Capture Photo',\n retakeButton: 'Retake',\n usePhotoButton: 'Use This Photo',\n processing: 'Processing image...',\n success: 'ID captured successfully',\n error: 'Failed to capture ID. Please try again.'\n },\n\n // Selfie Capture\n selfieCapture: {\n title: 'Take a Selfie',\n subtitle: 'Take a clear selfie for identity verification',\n instructions: {\n title: 'Instructions:',\n list: [\n 'Look directly at the camera',\n 'Ensure good lighting on your face',\n 'Remove glasses and hats',\n 'Keep a neutral expression'\n ]\n },\n captureButton: 'Take Selfie',\n retakeButton: 'Retake',\n usePhotoButton: 'Use This Photo',\n processing: 'Processing selfie...',\n success: 'Selfie captured successfully',\n error: 'Failed to capture selfie. Please try again.'\n },\n\n // File Upload\n fileUpload: {\n title: 'Upload Document',\n subtitle: 'Upload a clear photo of your document',\n selectFile: 'Select File',\n uploadButton: 'Upload',\n dragDropText: 'Drag and drop your file here, or click to select',\n supportedFormats: 'Supported formats: JPG, PNG, PDF',\n maxSize: 'Max file size: 10MB',\n processing: 'Processing file...',\n success: 'File uploaded successfully',\n error: 'Failed to upload file. Please try again.'\n },\n\n // Verification Progress\n verificationProgress: {\n title: 'Verifying Your Identity',\n subtitle: 'Please wait while we verify your information',\n steps: {\n analyzing: 'Analyzing documents...',\n extracting: 'Extracting information...',\n verifying: 'Verifying identity...',\n complete: 'Verification complete'\n },\n retrying: 'Retrying ( %{current} / %{max} )',\n estimatedTime: 'Estimated time: 2-3 minutes',\n status: {\n pending: 'Pending',\n processing: 'Processing',\n completed: 'Completed',\n failed: 'Failed',\n retry: 'Retry'\n }\n },\n\n // Review and Submit\n reviewSubmit: {\n title: 'Review Your Information',\n subtitle: 'Please review the information we extracted',\n personalInfo: 'Personal Information',\n documentInfo: 'Document Information',\n editButton: 'Edit',\n submitButton: 'Submit for Verification',\n confirmMessage: 'Are you sure you want to submit this information?',\n processing: 'Submitting...',\n success: 'Information submitted successfully',\n error: 'Failed to submit information. Please try again.',\n selfieSide: {\n center: 'Center',\n right: 'Right',\n left: 'Left'\n }\n },\n\n // Cancel Confirmation\n cancelConfirmation: {\n title: 'Are you sure you want to cancel?',\n message: 'You will lose all your progress.',\n cancelButton: 'Cancel',\n confirmButton: 'OK'\n }\n },\n\n // Camera and Media\n camera: {\n permissionTitle: 'Camera Permission Required',\n permissionMessage: 'We need access to your camera to capture your ID and selfie.',\n permissionButton: 'Grant Permission',\n settingsButton: 'Open Settings',\n notAvailable: 'Camera not available',\n switchCamera: 'Switch Camera',\n flashOn: 'Flash On',\n flashOff: 'Flash Off',\n capturePhoto: 'Capture Photo',\n processing: 'Processing...',\n permissionRequired: 'Camera permission required. Please grant permission to continue.',\n deviceNotAvailable: 'Camera device not available',\n notReady: 'Camera not ready',\n analyzing: 'Analyzing...',\n errorOccurred: 'Camera error occurred',\n failedToCapture: 'Failed to capture photo',\n failedToStartRecording: 'Failed to start video recording',\n failedToStopRecording: 'Failed to stop video recording'\n },\n\n // Errors\n errors: {\n networkError: 'Network error. Please check your connection.',\n serverError: 'Server error. Please try again later.',\n validationError: 'Please check your information and try again.',\n cameraError: 'Camera error. Please try again.',\n fileError: 'File error. Please try again.',\n timeoutError: 'Request timeout. Please try again.',\n unknownError: 'An unknown error occurred. Please try again.'\n },\n\n // Validation messages\n validation: {\n required: 'This field is required',\n invalidEmail: 'Please enter a valid email address',\n invalidPhone: 'Please enter a valid phone number',\n invalidDate: 'Please enter a valid date',\n minLength: 'Must be at least %{min} characters',\n maxLength: 'Must be no more than %{max} characters',\n invalidFormat: 'Invalid format',\n fileTooLarge: 'File is too large',\n fileTypeNotSupported: 'File type not supported'\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/en/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,qBAAqB;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,aAAa;KACpB;IAED,WAAW;IACX,GAAG,EAAE;QACH,KAAK,EAAE,uBAAuB;QAC9B,QAAQ,EAAE,iDAAiD;QAC3D,IAAI,EAAE,6BAA6B;QAEnC,iBAAiB;QACjB,cAAc,EAAE;YACd,KAAK,EAAE,kCAAkC;YACzC,WAAW,EAAE,iFAAiF;YAC9F,WAAW,EAAE,oBAAoB;YACjC,YAAY,EAAE,oBAAoB;YAClC,gBAAgB,EAAE;gBAChB,4BAA4B;gBAC5B,0BAA0B;gBAC1B,4BAA4B;aAC7B;SACF;QAED,mBAAmB;QACnB,eAAe,EAAE;YACf,KAAK,EAAE,0BAA0B;YACjC,WAAW,EAAE,4GAA4G;YACzH,YAAY,EAAE,iBAAiB;YAC/B,gBAAgB,EAAE,mJAAmJ;YACrK,qBAAqB,EAAE,mBAAmB;YAC1C,uBAAuB,EAAE,8CAA8C;YACvE,qBAAqB,EAAE,mBAAmB;YAC1C,uBAAuB,EAAE,6DA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AE,kCAAkC;YAC3C,YAAY,EAAE,QAAQ;YACtB,aAAa,EAAE,IAAI;SACpB;KACF;IAED,mBAAmB;IACnB,MAAM,EAAE;QACN,eAAe,EAAE,4BAA4B;QAC7C,iBAAiB,EAAE,8DAA8D;QACjF,gBAAgB,EAAE,kBAAkB;QACpC,cAAc,EAAE,eAAe;QAC/B,YAAY,EAAE,sBAAsB;QACpC,YAAY,EAAE,eAAe;QAC7B,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,WAAW;QACrB,YAAY,EAAE,eAAe;QAC7B,UAAU,EAAE,eAAe;QAC3B,kBAAkB,EAAE,kEAAkE;QACtF,kBAAkB,EAAE,6BAA6B;QACjD,QAAQ,EAAE,kBAAkB;QAC5B,SAAS,EAAE,cAAc;QACzB,aAAa,EAAE,uBAAuB;QACtC,eAAe,EAAE,yBAAyB;QAC1C,sBAAsB,EAAE,iCAAiC;QACzD,qBAAqB,EAAE,gCAAgC;KACxD;IAED,SAAS;IACT,MAAM,EAAE;QACN,YAAY,EAAE,8CAA8C;QAC5D,WAAW,EAAE,uCAAuC;QACpD,eAAe,EAAE,8CAA8C;QAC/D,WAAW,EAAE,iCAAiC;QAC9C,SAAS,EAAE,+BAA+B;QAC1C,YAAY,EAAE,oCAAoC;QAClD,YAAY,EAAE,8CAA8C;KAC7D;IAED,sBAAsB;IACtB,UAAU,EAAE;QACV,QAAQ,EAAE,wBAAwB;QAClC,YAAY,EAAE,oCAAoC;QAClD,YAAY,EAAE,mCAAmC;QACjD,WAAW,EAAE,2BAA2B;QACxC,SAAS,EAAE,oCAAoC;QAC/C,SAAS,EAAE,wCAAwC;QACnD,aAAa,EAAE,gBAAgB;QAC/B,YAAY,EAAE,mBAAmB;QACjC,oBAAoB,EAAE,yBAAyB;KAChD;CACF,CAAC","sourcesContent":["export const en = {\n // Common UI elements\n common: {\n next: 'Next',\n previous: 'Previous',\n continue: 'Continue',\n cancel: 'Cancel',\n confirm: 'Confirm',\n submit: 'Submit',\n retry: 'Retry',\n close: 'Close',\n back: 'Back',\n loading: 'Loading...',\n error: 'Error',\n success: 'Success',\n warning: 'Warning',\n info: 'Information',\n },\n\n // KYC Flow\n kyc: {\n title: 'Identity Verification',\n subtitle: 'Complete your identity verification to continue',\n step: 'Step %{current} of %{total}',\n \n // Initialization\n initialization: {\n title: 'Welcome to Identity Verification',\n description: 'We need to verify your identity to comply with regulations and ensure security.',\n startButton: 'Start Verification',\n requirements: 'What you\\'ll need:',\n requirementsList: [\n 'Valid government-issued ID',\n 'Good lighting for photos',\n 'Stable internet connection'\n ]\n },\n\n // Location Capture\n locationCapture: {\n title: 'Secure Your Verification',\n description: 'Allow location access to help us protect your account and prevent fraudulent activity during verification.',\n howThisHelps: 'How this helps:',\n howThisHelpsList: '• Verifies your device location matches your identity\\n• Detects and prevents unauthorized access\\n• Ensures compliance with security regulations',\n permissionDeniedTitle: 'Permission denied',\n permissionDeniedMessage: 'Location permission is required to continue.',\n locationDisabledTitle: 'Location disabled',\n locationDisabledMessage: 'Please enable location services on your device to continue.',\n errorTitle: 'Error',\n errorMessage: 'Unable to retrieve your location. Please try again.',\n obtained: 'Location obtained',\n latitudeLabel: 'Latitude',\n longitudeLabel: 'Longitude',\n accuracyLabel: 'Accuracy',\n resetButton: 'Reset',\n enableButton: 'Enable Location Access',\n fetching: 'Fetching...'\n },\n\n // Country Selection\n countrySelection: {\n title: 'Select Your Country',\n subtitle: 'Choose the country that issued your ID document',\n searchPlaceholder: 'Search for your country...',\n noResults: 'No countries found',\n selectCountry: 'Select Country'\n },\n\n // ID Card Capture\n idCardCapture: {\n title: 'Capture Your ID Document',\n subtitle: 'Take a clear photo of your ID document',\n frontSide: 'Front Side',\n backSide: 'Back Side',\n instructions: {\n title: 'Instructions:',\n list: [\n 'Place your ID on a flat surface',\n 'Ensure good lighting',\n 'Keep the entire document in frame',\n 'Avoid glare and shadows'\n ]\n },\n captureButton: 'Capture Photo',\n retakeButton: 'Retake',\n usePhotoButton: 'Use This Photo',\n processing: 'Processing image...',\n success: 'ID captured successfully',\n error: 'Failed to capture ID. Please try again.',\n captureTitle: '%{side} side of your government document',\n },\n\n // Selfie Capture\n selfieCapture: {\n title: 'Take a Selfie',\n subtitle: 'Take a clear selfie for identity verification',\n instructions: {\n title: 'Instructions:',\n list: [\n 'Look directly at the camera',\n 'Ensure good lighting on your face',\n 'Remove glasses and hats',\n 'Keep a neutral expression'\n ]\n },\n captureButton: 'Take Selfie',\n retakeButton: 'Retake',\n usePhotoButton: 'Use This Photo',\n processing: 'Processing selfie...',\n success: 'Selfie captured successfully',\n error: 'Failed to capture selfie. Please try again.'\n },\n\n // File Upload\n fileUpload: {\n title: 'Upload Document',\n subtitle: 'Upload a clear photo of your document',\n selectFile: 'Select File',\n uploadButton: 'Upload',\n dragDropText: 'Drag and drop your file here, or click to select',\n supportedFormats: 'Supported formats: JPG, PNG, PDF',\n maxSize: 'Max file size: 10MB',\n processing: 'Processing file...',\n success: 'File uploaded successfully',\n error: 'Failed to upload file. Please try again.'\n },\n\n // Verification Progress\n verificationProgress: {\n title: 'Verifying Your Identity',\n subtitle: 'Please wait while we verify your information',\n steps: {\n analyzing: 'Analyzing documents...',\n extracting: 'Extracting information...',\n verifying: 'Verifying identity...',\n complete: 'Verification complete'\n },\n retrying: 'Retrying ( %{current} / %{max} )',\n estimatedTime: 'Estimated time: 2-3 minutes',\n status: {\n pending: 'Pending',\n processing: 'Processing',\n completed: 'Completed',\n failed: 'Failed',\n retry: 'Retry'\n }\n },\n\n // Review and Submit\n reviewSubmit: {\n title: 'Review Your Information',\n subtitle: 'Please review the information we extracted',\n personalInfo: 'Personal Information',\n documentInfo: 'Document Information',\n editButton: 'Edit',\n submitButton: 'Submit for Verification',\n confirmMessage: 'Are you sure you want to submit this information?',\n processing: 'Submitting...',\n success: 'Information submitted successfully',\n error: 'Failed to submit information. Please try again.',\n selfieSide: {\n center: 'Center',\n right: 'Right',\n left: 'Left'\n }\n },\n\n // Cancel Confirmation\n cancelConfirmation: {\n title: 'Are you sure you want to cancel?',\n message: 'You will lose all your progress.',\n cancelButton: 'Cancel',\n confirmButton: 'OK'\n }\n },\n\n // Camera and Media\n camera: {\n permissionTitle: 'Camera Permission Required',\n permissionMessage: 'We need access to your camera to capture your ID and selfie.',\n permissionButton: 'Grant Permission',\n settingsButton: 'Open Settings',\n notAvailable: 'Camera not available',\n switchCamera: 'Switch Camera',\n flashOn: 'Flash On',\n flashOff: 'Flash Off',\n capturePhoto: 'Capture Photo',\n processing: 'Processing...',\n permissionRequired: 'Camera permission required. Please grant permission to continue.',\n deviceNotAvailable: 'Camera device not available',\n notReady: 'Camera not ready',\n analyzing: 'Analyzing...',\n errorOccurred: 'Camera error occurred',\n failedToCapture: 'Failed to capture photo',\n failedToStartRecording: 'Failed to start video recording',\n failedToStopRecording: 'Failed to stop video recording'\n },\n\n // Errors\n errors: {\n networkError: 'Network error. Please check your connection.',\n serverError: 'Server error. Please try again later.',\n validationError: 'Please check your information and try again.',\n cameraError: 'Camera error. Please try again.',\n fileError: 'File error. Please try again.',\n timeoutError: 'Request timeout. Please try again.',\n unknownError: 'An unknown error occurred. Please try again.'\n },\n\n // Validation messages\n validation: {\n required: 'This field is required',\n invalidEmail: 'Please enter a valid email address',\n invalidPhone: 'Please enter a valid phone number',\n invalidDate: 'Please enter a valid date',\n minLength: 'Must be at least %{min} characters',\n maxLength: 'Must be no more than %{max} characters',\n invalidFormat: 'Invalid format',\n fileTooLarge: 'File is too large',\n fileTypeNotSupported: 'File type not supported'\n }\n};\n"]}
|
package/build/i18n/fr/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/fr/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/fr/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Nd,CAAC"}
|
package/build/i18n/fr/index.js
CHANGED
|
@@ -81,7 +81,8 @@ export const fr = {
|
|
|
81
81
|
usePhotoButton: 'Utiliser Cette Photo',
|
|
82
82
|
processing: 'Traitement de l\'image...',
|
|
83
83
|
success: 'Document d\'identité capturé avec succès',
|
|
84
|
-
error: 'Échec de la capture du document. Veuillez réessayer.'
|
|
84
|
+
error: 'Échec de la capture du document. Veuillez réessayer.',
|
|
85
|
+
captureTitle: '%{side} de votre document d\'identité',
|
|
85
86
|
},
|
|
86
87
|
// Selfie Capture
|
|
87
88
|
selfieCapture: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/fr/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,qBAAqB;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,WAAW;QACpB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,aAAa;KACpB;IAED,WAAW;IACX,GAAG,EAAE;QACH,KAAK,EAAE,0BAA0B;QACjC,QAAQ,EAAE,yDAAyD;QACnE,IAAI,EAAE,+BAA+B;QAErC,iBAAiB;QACjB,cAAc,EAAE;YACd,KAAK,EAAE,4CAA4C;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KACzE;IAED,UAAU,EAAE;QACV,QAAQ,EAAE,0BAA0B;QACpC,YAAY,EAAE,0CAA0C;QACxD,YAAY,EAAE,+CAA+C;QAC7D,WAAW,EAAE,iCAAiC;QAC9C,SAAS,EAAE,yCAAyC;QACpD,SAAS,EAAE,uCAAuC;QAClD,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,yBAAyB;QACvC,oBAAoB,EAAE,8BAA8B;KACrD;CAEF,CAAC","sourcesContent":["export const fr = {\n // Common UI elements\n common: {\n next: 'Suivant',\n previous: 'Précédent',\n continue: 'Continuer',\n cancel: 'Annuler',\n confirm: 'Confirmer',\n submit: 'Soumettre',\n retry: 'Réessayer',\n close: 'Fermer',\n back: 'Retour',\n loading: 'Chargement...',\n error: 'Erreur',\n success: 'Succès',\n warning: 'Avertissement',\n info: 'Information',\n },\n\n // KYC Flow\n kyc: {\n title: 'Vérification d\\'Identité',\n subtitle: 'Complétez votre vérification d\\'identité pour continuer',\n step: 'Étape %{current} sur %{total}',\n\n // Initialization\n initialization: {\n title: 'Bienvenue dans la Vérification d\\'Identité',\n description: 'Nous devons vérifier votre identité pour respecter les réglementations et assurer la sécurité.',\n startButton: 'Commencer la Vérification',\n requirements: 'Ce dont vous aurez besoin :',\n requirementsList: [\n 'Une pièce d\\'identité officielle valide',\n 'Un bon éclairage pour les photos',\n 'Une connexion internet stable'\n ]\n },\n\n // Location Capture\n locationCapture: {\n title: 'Sécurisez Votre Vérification',\n description: 'Autorisez l\\'accès à la localisation pour nous aider à protéger votre compte et à prévenir les activités frauduleuses pendant la vérification.',\n howThisHelps: 'Comment cela aide :',\n howThisHelpsList: '• Vérifie que la localisation de votre appareil correspond à votre identité\\n• Détecte et empêche les accès non autorisés\\n• Garantit la conformité aux réglementations de sécurité',\n permissionDeniedTitle: 'Permission refusée',\n permissionDeniedMessage: 'La permission de localisation est nécessaire pour continuer.',\n locationDisabledTitle: 'Localisation désactivée',\n locationDisabledMessage: 'Veuillez activer la localisation sur votre appareil pour continuer.',\n errorTitle: 'Erreur',\n errorMessage: 'Impossible de récupérer votre localisation. Veuillez réessayer.',\n obtained: 'Localisation obtenue',\n latitudeLabel: 'Latitude',\n longitudeLabel: 'Longitude',\n accuracyLabel: 'Précision',\n resetButton: 'Réinitialiser',\n enableButton: 'Activer l\\'accès à la localisation',\n fetching: 'Récupération...'\n },\n\n // Country Selection\n countrySelection: {\n title: 'Sélectionnez Votre Pays',\n subtitle: 'Choisissez le pays qui a émis votre document d\\'identité',\n searchPlaceholder: 'Recherchez votre pays...',\n noResults: 'Aucun pays trouvé',\n selectCountry: 'Sélectionner le Pays'\n },\n\n // ID Card Capture\n idCardCapture: {\n title: 'Capturez Votre Document d\\'Identité',\n subtitle: 'Prenez une photo claire de votre document d\\'identité',\n frontSide: 'Face Avant',\n backSide: 'Face Arrière',\n instructions: {\n title: 'Instructions :',\n list: [\n 'Placez votre pièce d\\'identité sur une surface plane',\n 'Assurez-vous d\\'un bon éclairage',\n 'Gardez tout le document dans le cadre',\n 'Évitez les reflets et les ombres'\n ]\n },\n captureButton: 'Prendre la Photo',\n retakeButton: 'Reprendre',\n usePhotoButton: 'Utiliser Cette Photo',\n processing: 'Traitement de l\\'image...',\n success: 'Document d\\'identité capturé avec succès',\n error: 'Échec de la capture du document. Veuillez réessayer.'\n },\n\n // Selfie Capture\n selfieCapture: {\n title: 'Prenez un Selfie',\n subtitle: 'Prenez un selfie clair pour la vérification d\\'identité',\n instructions: {\n title: 'Instructions :',\n list: [\n 'Regardez directement la caméra',\n 'Assurez-vous d\\'un bon éclairage sur votre visage',\n 'Retirez les lunettes et les chapeaux',\n 'Gardez une expression neutre'\n ]\n },\n captureButton: 'Prendre le Selfie',\n retakeButton: 'Reprendre',\n usePhotoButton: 'Utiliser Cette Photo',\n processing: 'Traitement du selfie...',\n success: 'Selfie capturé avec succès',\n error: 'Échec de la capture du selfie. Veuillez réessayer.'\n },\n\n // File Upload\n fileUpload: {\n title: 'Télécharger le Document',\n subtitle: 'Téléchargez une photo claire de votre document',\n selectFile: 'Sélectionner le Fichier',\n uploadButton: 'Télécharger',\n dragDropText: 'Glissez-déposez votre fichier ici, ou cliquez pour sélectionner',\n supportedFormats: 'Formats supportés : JPG, PNG, PDF',\n maxSize: 'Taille maximale : 10MB',\n processing: 'Traitement du fichier...',\n success: 'Fichier téléchargé avec succès',\n error: 'Échec du téléchargement. Veuillez réessayer.'\n },\n\n // Verification Progress\n verificationProgress: {\n title: 'Vérification de Votre Identité',\n subtitle: 'Veuillez patienter pendant que nous vérifions vos informations',\n steps: {\n analyzing: 'Analyse des documents...',\n extracting: 'Extraction des informations...',\n verifying: 'Vérification de l\\'identité...',\n complete: 'Vérification terminée'\n },\n retrying: 'Réessayer ( %{current}/ %{max} )',\n estimatedTime: 'Temps estimé : 2-3 minutes',\n status: {\n pending: 'En attente',\n processing: 'En cours',\n completed: 'Terminé',\n failed: 'Échoué',\n retry: 'Réessayer'\n }\n },\n\n // Review and Submit\n reviewSubmit: {\n title: 'Vérifiez Vos Informations',\n subtitle: 'Veuillez vérifier les informations que nous avons extraites',\n personalInfo: 'Informations Personnelles',\n documentInfo: 'Informations du Document',\n editButton: 'Modifier',\n submitButton: 'Soumettre pour Vérification',\n confirmMessage: 'Êtes-vous sûr de vouloir soumettre ces informations ?',\n processing: 'Soumission...',\n success: 'Informations soumises avec succès',\n error: 'Échec de la soumission. Veuillez réessayer.',\n selfieSide: {\n center: 'Face',\n right: 'Droite',\n left: 'Gauche'\n }\n },\n\n // Confirmation d'annulation\n cancelConfirmation: {\n title: 'Êtes-vous sûr de vouloir annuler ?',\n message: 'Vous perdrez tout votre progrès.',\n cancelButton: 'Annuler',\n confirmButton: 'OK'\n }\n },\n\n // Camera and Media\n camera: {\n permissionTitle: 'Permission Caméra Requise',\n permissionMessage: 'Nous avons besoin d\\'accéder à votre caméra pour capturer votre pièce d\\'identité et votre selfie.',\n permissionButton: 'Accorder la Permission',\n settingsButton: 'Ouvrir les Paramètres',\n notAvailable: 'Caméra non disponible',\n switchCamera: 'Changer de Caméra',\n flashOn: 'Flash Activé',\n flashOff: 'Flash Désactivé',\n capturePhoto: 'Prendre la Photo',\n processing: 'Traitement...',\n permissionRequired: 'Permission caméra requise. Veuillez accorder la permission pour continuer.',\n deviceNotAvailable: 'Appareil photo non disponible',\n notReady: 'Caméra pas prête',\n analyzing: 'Analyse en cours...',\n errorOccurred: 'Erreur de caméra survenue',\n failedToCapture: 'Échec de la capture photo',\n failedToStartRecording: 'Échec du démarrage de l\\'enregistrement vidéo',\n failedToStopRecording: 'Échec de l\\'arrêt de l\\'enregistrement vidéo'\n },\n\n // Errors\n errors: {\n networkError: 'Erreur réseau. Veuillez vérifier votre connexion.',\n serverError: 'Erreur serveur. Veuillez réessayer plus tard.',\n validationError: 'Veuillez vérifier vos informations et réessayer.',\n cameraError: 'Erreur caméra. Veuillez réessayer.',\n fileError: 'Erreur fichier. Veuillez réessayer.',\n timeoutError: 'Délai d\\'attente dépassé. Veuillez réessayer.',\n unknownError: 'Une erreur inconnue s\\'est produite. Veuillez réessayer.'\n },\n\n validation: {\n required: 'Ce champ est obligatoire',\n invalidEmail: 'Veuillez entrer une adresse email valide',\n invalidPhone: 'Veuillez entrer un numéro de téléphone valide',\n invalidDate: 'Veuillez entrer une date valide',\n minLength: 'Doit contenir au moins {min} caractères',\n maxLength: 'Ne doit pas dépasser {max} caractères',\n invalidFormat: 'Format invalide',\n fileTooLarge: 'Fichier trop volumineux',\n fileTypeNotSupported: 'Type de fichier non supporté'\n }\n\n};\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/fr/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,qBAAqB;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,WAAW;QACpB,MAAM,EAAE,WAAW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+B;QACnD,QAAQ,EAAE,kBAAkB;QAC5B,SAAS,EAAE,qBAAqB;QAChC,aAAa,EAAE,2BAA2B;QAC1C,eAAe,EAAE,2BAA2B;QAC5C,sBAAsB,EAAE,+CAA+C;QACvE,qBAAqB,EAAE,8CAA8C;KACtE;IAED,SAAS;IACT,MAAM,EAAE;QACN,YAAY,EAAE,mDAAmD;QACjE,WAAW,EAAE,+CAA+C;QAC5D,eAAe,EAAE,kDAAkD;QACnE,WAAW,EAAE,oCAAoC;QACjD,SAAS,EAAE,qCAAqC;QAChD,YAAY,EAAE,+CAA+C;QAC7D,YAAY,EAAE,0DAA0D;KACzE;IAED,UAAU,EAAE;QACV,QAAQ,EAAE,0BAA0B;QACpC,YAAY,EAAE,0CAA0C;QACxD,YAAY,EAAE,+CAA+C;QAC7D,WAAW,EAAE,iCAAiC;QAC9C,SAAS,EAAE,yCAAyC;QACpD,SAAS,EAAE,uCAAuC;QAClD,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,yBAAyB;QACvC,oBAAoB,EAAE,8BAA8B;KACrD;CAEF,CAAC","sourcesContent":["export const fr = {\n // Common UI elements\n common: {\n next: 'Suivant',\n previous: 'Précédent',\n continue: 'Continuer',\n cancel: 'Annuler',\n confirm: 'Confirmer',\n submit: 'Soumettre',\n retry: 'Réessayer',\n close: 'Fermer',\n back: 'Retour',\n loading: 'Chargement...',\n error: 'Erreur',\n success: 'Succès',\n warning: 'Avertissement',\n info: 'Information',\n },\n\n // KYC Flow\n kyc: {\n title: 'Vérification d\\'Identité',\n subtitle: 'Complétez votre vérification d\\'identité pour continuer',\n step: 'Étape %{current} sur %{total}',\n\n // Initialization\n initialization: {\n title: 'Bienvenue dans la Vérification d\\'Identité',\n description: 'Nous devons vérifier votre identité pour respecter les réglementations et assurer la sécurité.',\n startButton: 'Commencer la Vérification',\n requirements: 'Ce dont vous aurez besoin :',\n requirementsList: [\n 'Une pièce d\\'identité officielle valide',\n 'Un bon éclairage pour les photos',\n 'Une connexion internet stable'\n ]\n },\n\n // Location Capture\n locationCapture: {\n title: 'Sécurisez Votre Vérification',\n description: 'Autorisez l\\'accès à la localisation pour nous aider à protéger votre compte et à prévenir les activités frauduleuses pendant la vérification.',\n howThisHelps: 'Comment cela aide :',\n howThisHelpsList: '• Vérifie que la localisation de votre appareil correspond à votre identité\\n• Détecte et empêche les accès non autorisés\\n• Garantit la conformité aux réglementations de sécurité',\n permissionDeniedTitle: 'Permission refusée',\n permissionDeniedMessage: 'La permission de localisation est nécessaire pour continuer.',\n locationDisabledTitle: 'Localisation désactivée',\n locationDisabledMessage: 'Veuillez activer la localisation sur votre appareil pour continuer.',\n errorTitle: 'Erreur',\n errorMessage: 'Impossible de récupérer votre localisation. Veuillez réessayer.',\n obtained: 'Localisation obtenue',\n latitudeLabel: 'Latitude',\n longitudeLabel: 'Longitude',\n accuracyLabel: 'Précision',\n resetButton: 'Réinitialiser',\n enableButton: 'Activer l\\'accès à la localisation',\n fetching: 'Récupération...'\n },\n\n // Country Selection\n countrySelection: {\n title: 'Sélectionnez Votre Pays',\n subtitle: 'Choisissez le pays qui a émis votre document d\\'identité',\n searchPlaceholder: 'Recherchez votre pays...',\n noResults: 'Aucun pays trouvé',\n selectCountry: 'Sélectionner le Pays'\n },\n\n // ID Card Capture\n idCardCapture: {\n title: 'Capturez Votre Document d\\'Identité',\n subtitle: 'Prenez une photo claire de votre document d\\'identité',\n frontSide: 'Face Avant',\n backSide: 'Face Arrière',\n instructions: {\n title: 'Instructions :',\n list: [\n 'Placez votre pièce d\\'identité sur une surface plane',\n 'Assurez-vous d\\'un bon éclairage',\n 'Gardez tout le document dans le cadre',\n 'Évitez les reflets et les ombres'\n ]\n },\n captureButton: 'Prendre la Photo',\n retakeButton: 'Reprendre',\n usePhotoButton: 'Utiliser Cette Photo',\n processing: 'Traitement de l\\'image...',\n success: 'Document d\\'identité capturé avec succès',\n error: 'Échec de la capture du document. Veuillez réessayer.',\n captureTitle: '%{side} de votre document d\\'identité',\n },\n\n // Selfie Capture\n selfieCapture: {\n title: 'Prenez un Selfie',\n subtitle: 'Prenez un selfie clair pour la vérification d\\'identité',\n instructions: {\n title: 'Instructions :',\n list: [\n 'Regardez directement la caméra',\n 'Assurez-vous d\\'un bon éclairage sur votre visage',\n 'Retirez les lunettes et les chapeaux',\n 'Gardez une expression neutre'\n ]\n },\n captureButton: 'Prendre le Selfie',\n retakeButton: 'Reprendre',\n usePhotoButton: 'Utiliser Cette Photo',\n processing: 'Traitement du selfie...',\n success: 'Selfie capturé avec succès',\n error: 'Échec de la capture du selfie. Veuillez réessayer.'\n },\n\n // File Upload\n fileUpload: {\n title: 'Télécharger le Document',\n subtitle: 'Téléchargez une photo claire de votre document',\n selectFile: 'Sélectionner le Fichier',\n uploadButton: 'Télécharger',\n dragDropText: 'Glissez-déposez votre fichier ici, ou cliquez pour sélectionner',\n supportedFormats: 'Formats supportés : JPG, PNG, PDF',\n maxSize: 'Taille maximale : 10MB',\n processing: 'Traitement du fichier...',\n success: 'Fichier téléchargé avec succès',\n error: 'Échec du téléchargement. Veuillez réessayer.'\n },\n\n // Verification Progress\n verificationProgress: {\n title: 'Vérification de Votre Identité',\n subtitle: 'Veuillez patienter pendant que nous vérifions vos informations',\n steps: {\n analyzing: 'Analyse des documents...',\n extracting: 'Extraction des informations...',\n verifying: 'Vérification de l\\'identité...',\n complete: 'Vérification terminée'\n },\n retrying: 'Réessayer ( %{current}/ %{max} )',\n estimatedTime: 'Temps estimé : 2-3 minutes',\n status: {\n pending: 'En attente',\n processing: 'En cours',\n completed: 'Terminé',\n failed: 'Échoué',\n retry: 'Réessayer'\n }\n },\n\n // Review and Submit\n reviewSubmit: {\n title: 'Vérifiez Vos Informations',\n subtitle: 'Veuillez vérifier les informations que nous avons extraites',\n personalInfo: 'Informations Personnelles',\n documentInfo: 'Informations du Document',\n editButton: 'Modifier',\n submitButton: 'Soumettre pour Vérification',\n confirmMessage: 'Êtes-vous sûr de vouloir soumettre ces informations ?',\n processing: 'Soumission...',\n success: 'Informations soumises avec succès',\n error: 'Échec de la soumission. Veuillez réessayer.',\n selfieSide: {\n center: 'Face',\n right: 'Droite',\n left: 'Gauche'\n }\n },\n\n // Confirmation d'annulation\n cancelConfirmation: {\n title: 'Êtes-vous sûr de vouloir annuler ?',\n message: 'Vous perdrez tout votre progrès.',\n cancelButton: 'Annuler',\n confirmButton: 'OK'\n }\n },\n\n // Camera and Media\n camera: {\n permissionTitle: 'Permission Caméra Requise',\n permissionMessage: 'Nous avons besoin d\\'accéder à votre caméra pour capturer votre pièce d\\'identité et votre selfie.',\n permissionButton: 'Accorder la Permission',\n settingsButton: 'Ouvrir les Paramètres',\n notAvailable: 'Caméra non disponible',\n switchCamera: 'Changer de Caméra',\n flashOn: 'Flash Activé',\n flashOff: 'Flash Désactivé',\n capturePhoto: 'Prendre la Photo',\n processing: 'Traitement...',\n permissionRequired: 'Permission caméra requise. Veuillez accorder la permission pour continuer.',\n deviceNotAvailable: 'Appareil photo non disponible',\n notReady: 'Caméra pas prête',\n analyzing: 'Analyse en cours...',\n errorOccurred: 'Erreur de caméra survenue',\n failedToCapture: 'Échec de la capture photo',\n failedToStartRecording: 'Échec du démarrage de l\\'enregistrement vidéo',\n failedToStopRecording: 'Échec de l\\'arrêt de l\\'enregistrement vidéo'\n },\n\n // Errors\n errors: {\n networkError: 'Erreur réseau. Veuillez vérifier votre connexion.',\n serverError: 'Erreur serveur. Veuillez réessayer plus tard.',\n validationError: 'Veuillez vérifier vos informations et réessayer.',\n cameraError: 'Erreur caméra. Veuillez réessayer.',\n fileError: 'Erreur fichier. Veuillez réessayer.',\n timeoutError: 'Délai d\\'attente dépassé. Veuillez réessayer.',\n unknownError: 'Une erreur inconnue s\\'est produite. Veuillez réessayer.'\n },\n\n validation: {\n required: 'Ce champ est obligatoire',\n invalidEmail: 'Veuillez entrer une adresse email valide',\n invalidPhone: 'Veuillez entrer un numéro de téléphone valide',\n invalidDate: 'Veuillez entrer une date valide',\n minLength: 'Doit contenir au moins {min} caractères',\n maxLength: 'Ne doit pas dépasser {max} caractères',\n invalidFormat: 'Format invalide',\n fileTooLarge: 'Fichier trop volumineux',\n fileTypeNotSupported: 'Type de fichier non supporté'\n }\n\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KYCService.d.ts","sourceRoot":"","sources":["../../../src/modules/api/KYCService.ts"],"names":[],"mappings":"AACA,OAAO,EAAyD,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAExH,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAG1F,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,UAAU,GAAG,UAAU,CAAC;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAS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;AACD,eAAO,MAAM,gBAAgB,oBAoC5B,CAAA;AAID,eAAO,MAAM,YAAY,GAAI,OAAO,GAAG,QAKtC,CAAA"}
|
|
@@ -155,8 +155,8 @@ export class KYCService {
|
|
|
155
155
|
const rnFile = { uri: fileUri, type: 'image/jpeg', name: 'id_card_front.jpg' };
|
|
156
156
|
formData.append('file', rnFile);
|
|
157
157
|
const docTypeShorted = GovernmentDocumentTypeShorted[docType];
|
|
158
|
-
logger.log('checkTemplateType params', this.mrzServiceURL, JSON.stringify({ fileUri, docTypeShorted, docRegion, token, postfix }, null, 2));
|
|
159
158
|
const url = `${this.mrzServiceURL}/get_template_version/?doc_type=${encodeURIComponent(docTypeShorted)}&doc_region=${encodeURIComponent(docRegion)}&postfix=${postfix}`;
|
|
159
|
+
logger.log('checkTemplateType params', this.mrzServiceURL, JSON.stringify({ fileUri, docTypeShorted, docRegion, token, postfix, url }, null, 2));
|
|
160
160
|
try {
|
|
161
161
|
const res = await axios.post(url, formData, {
|
|
162
162
|
headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },
|
|
@@ -346,11 +346,17 @@ export class KYCService {
|
|
|
346
346
|
}
|
|
347
347
|
// reultat de la verification
|
|
348
348
|
async getVerificationResult(session_id) {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
349
|
+
try {
|
|
350
|
+
const token = await authentification();
|
|
351
|
+
const url = `${this.backendServiceURL}/verification/api/kyc/result/?session_id=${session_id}`;
|
|
352
|
+
const res = await axios.get(url, { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });
|
|
353
|
+
logger.log('getVerificationResult res', JSON.stringify(truncateFields(res.data), null, 2));
|
|
354
|
+
return res.data;
|
|
355
|
+
}
|
|
356
|
+
catch (error) {
|
|
357
|
+
logger.error('Error getting verification result:', JSON.stringify(errorMessage(error), null, 2));
|
|
358
|
+
throw error;
|
|
359
|
+
}
|
|
354
360
|
}
|
|
355
361
|
}
|
|
356
362
|
const kycService = new KYCService("", "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KYCService.js","sourceRoot":"","sources":["../../../src/modules/api/KYCService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,6BAA6B,EAA4B,MAAM,uBAAuB,CAAC;AAGxH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAqC5C,MAAM,OAAO,UAAU;IACb,OAAO,CAAS;IAChB,MAAM,CAAS;IACvB,4DAA4D;IACpD,cAAc,GAAG,4CAA4C,CAAC;IAC9D,wBAAwB,GAAG,4CAA4C,CAAC;IACxE,aAAa,GAAG,4CAA4C,CAAC;IAC7D,iBAAiB,GAAG,4CAA4C,CAAC;IACjE,qBAAqB,GAAG,4BAA4B,CAAC;IACrD,iBAAiB,GAAG,+CAA+C,CAAC;IAE5E,YAAY,OAAe,EAAE,MAAc;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEO,UAAU;QAChB,OAAO;YACL,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;YACxC,cAAc,EAAE,kBAAkB;SACnC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAgB;QAC9B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAC/B,GAAG,IAAI,CAAC,OAAO,aAAa,EAC5B,IAAI,EACJ,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAC/B,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;YAC7C,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,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M,CAAC,KAAK,CAAC,+BAA+B,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACvG,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9F,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAID,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE;IACzC,OAAO,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO;QAClC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM;QAC5B,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK;QAC3B,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;AACzB,CAAC,CAAA","sourcesContent":["import axios from 'axios';\nimport { GovernmentDocumentType, GovernmentDocumentTypeShorted, OrientationVideoResponse } from '../../types/KYC.types';\nimport { CheckTemplateTypeResponse, ExtractMrzTextResponse } from '../../components/OverLay/type';\nimport { SessionResponse, VerificationResult, VerificationSessionRequest } from './types';\nimport { logger } from '../../utils/logger';\n\nexport interface KYCRequest {\n userId: string;\n documentImage: string;\n selfieImage: string;\n documentType: 'passport' | 'id_card' | 'drivers_license';\n}\n\nexport interface KYCResponse {\n success: boolean;\n verificationId: string;\n status: 'pending' | 'approved' | 'rejected';\n message?: string;\n}\n\nexport interface FaceDetectionRequest {\n selfieImage: string;\n documentImage: string;\n}\n\nexport interface FaceDetectionResponse {\n match: boolean;\n confidence: number;\n message: string;\n}\n\nexport interface SelfieVideoResponse {\n orientation_direction: \"center\" | \"left\" | \"right\",\n turn_score: number;\n bbox: number[];\n capture: boolean;\n instruction: string;\n error: string;\n}\n\n\nexport class KYCService {\n private baseURL: string;\n private apiKey: string;\n // Additional service base URLs (fixed as per current infra)\n private faceServiceURL = 'https://kyc-engine.transfergratis.net:8000';\n private textExtractionServiceURL = 'https://kyc-engine.transfergratis.net:8006';\n private mrzServiceURL = 'https://kyc-engine.transfergratis.net:8002';\n private barcodeServiceURL = 'https://kyc-engine.transfergratis.net:8000';\n private orientationServiceURL = 'http://18.188.180.154:8080';\n private backendServiceURL = 'https://kyc-backend.transfergratis.net/api/v1';\n\n constructor(baseURL: string, apiKey: string) {\n this.baseURL = baseURL;\n this.apiKey = apiKey;\n }\n\n private getHeaders() {\n return {\n 'Authorization': `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n };\n }\n\n async submitKYC(data: KYCRequest): Promise<KYCResponse> {\n try {\n const response = await axios.post(\n `${this.baseURL}/kyc/submit`,\n data,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n logger.error('Error submitting KYC:', error);\n throw error;\n }\n }\n\n async detectFace(data: FaceDetectionRequest): Promise<FaceDetectionResponse> {\n try {\n const response = await axios.post(\n `${this.baseURL}/ai/face-detection`,\n data,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n logger.error('Error detecting face:', error);\n throw error;\n }\n }\n\n async validateDocument(documentImage: string, documentType: string): Promise<any> {\n try {\n const response = await axios.post(\n `${this.baseURL}/ai/document-validation`,\n { documentImage, documentType },\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n logger.error('Error validating document:', error);\n throw error;\n }\n }\n\n async getKYCStatus(verificationId: string): Promise<KYCResponse> {\n try {\n const response = await axios.get(\n `${this.baseURL}/kyc/status/${verificationId}`,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n logger.error('Error getting KYC status:', error);\n throw error;\n }\n }\n\n async processSelfieOrientationPicture(videoFile: string, token: string): Promise<SelfieVideoResponse[]> {\n try {\n const formData = new FormData();\n const rnFile: any = {\n uri: videoFile,\n type: 'image/jpeg',\n name: 'selfie_picture.jpg',\n };\n formData.append('file', rnFile);\n const response = await axios.post<SelfieVideoResponse[]>(\n `${this.faceServiceURL}/detect_face_orientation/`,\n formData,\n {\n timeout: 20000,\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n }\n );\n return response.data;\n } catch (error) {\n logger.error('Error processing selfie orientation:', error);\n throw error;\n }\n }\n\n async processOrientationVideo(videoFile: string): Promise<OrientationVideoResponse> {\n try {\n // Create FormData for multipart/form-data request\n const formData = new FormData();\n // In React Native, prefer the { uri, type, name } pattern rather than Blob\n const rnFile: any = {\n uri: videoFile,\n type: 'video/mp4',\n name: 'orientation_video.mp4',\n };\n formData.append('file', rnFile);\n\n const response = await axios.post(\n `${this.orientationServiceURL}/process_orientation_video_stream/`,\n formData,\n {\n // Let axios set the proper multipart boundary header automatically\n timeout: 90000,\n }\n );\n\n return {\n success: true,\n data: response.data,\n message: 'Orientation video processed successfully'\n };\n } catch (error: any) {\n logger.error('Error processing orientation video:', JSON.stringify(error, null, 2));\n\n // Handle specific error cases\n if (error.response?.status === 503) {\n return {\n success: false,\n error: {\n code: 'SERVICE_UNAVAILABLE',\n message: 'Service not ready, model not initialized.',\n details: error.response.data\n },\n message: 'Service temporarily unavailable'\n };\n }\n\n return {\n success: false,\n error: {\n code: 'PROCESSING_ERROR',\n message: error.response?.data?.detail || error.message || 'Unknown error occurred',\n details: error.response?.data\n },\n message: 'Failed to process orientation video'\n };\n }\n }\n\n // STEP 1 - ID CARD VALIDATION\n async detectFaceOnId(idCardImageUri: string, token: string, docType: string): Promise<{ result: boolean, detail: any[] }> {\n const formData = new FormData();\n const rnFile: any = { uri: idCardImageUri, type: 'image/jpeg', name: 'id_card_photo.jpg' };\n formData.append('file', rnFile);\n\n const docTypeShorted = GovernmentDocumentTypeShorted[docType as GovernmentDocumentType];\n\n try {\n const res = await axios.post(`${this.faceServiceURL}/detect_face/?doc_type=${docTypeShorted}`, formData,\n {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 20000\n });\n logger.log('detectFaceOnId res', JSON.stringify(res.data, null, 2));\n\n if (res.data?.result) return res.data;\n throw new Error(res.data?.detail || 'detect_face failed');\n } catch (error) {\n logger.error('Error detecting face on id:', JSON.stringify(error));\n throw error;\n }\n }\n\n //check templatetemplate_type\n async checkTemplateType(params: { fileUri: string; docType: string; docRegion: string; token: string; postfix: string }): Promise<any> {\n const { fileUri, docType, docRegion, token, postfix } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_front.jpg' };\n formData.append('file', rnFile);\n const docTypeShorted = GovernmentDocumentTypeShorted[docType as GovernmentDocumentType];\n logger.log('checkTemplateType params', this.mrzServiceURL, JSON.stringify({ fileUri, docTypeShorted, docRegion, token, postfix }, null, 2));\n const url = `${this.mrzServiceURL}/get_template_version/?doc_type=${encodeURIComponent(docTypeShorted)}&doc_region=${encodeURIComponent(docRegion)}&postfix=${postfix}`;\n\n try {\n const res = await axios.post<CheckTemplateTypeResponse>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n logger.log('checkTemplateType res', JSON.stringify(res.data, null, 2));\n return res.data;\n } catch (e: any) {\n logger.error('Error checking template type:', JSON.stringify(e));\n throw e;\n }\n\n }\n\n async extractDocumentInformation(params: { fileUri: string; docType: string; docRegion: string; token: string }): Promise<any> {\n const { fileUri, docType, docRegion, token } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_front.jpg' };\n formData.append('file', rnFile);\n\n const url = `${this.textExtractionServiceURL}/extract_doc_information/?doc_type=${encodeURIComponent(docType)}&doc_region=${encodeURIComponent(docRegion)}`;\n const attempt = async () => {\n const res = await axios.post(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n logger.log('extractDocumentInformation res', JSON.stringify(truncateFields(res)));\n\n if (res.data?.detail) throw new Error(res.data.detail);\n return res.data;\n };\n try {\n return await attempt();\n } catch (e) {\n logger.error('Error extracting document information:', JSON.stringify(truncateFields(e)));\n throw e;\n // await new Promise(r => setTimeout(r, 1500));\n // return await attempt();\n }\n }\n // STEP 2 - barcode extraction\n async extractBarcode(params: { fileUri: string; token: string }): Promise<any> {\n const { fileUri, token } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_back.jpg' };\n formData.append('file', rnFile);\n\n const url = `${this.barcodeServiceURL}/decode_barcode/`;\n const attempt = async () => {\n try {\n const res = await axios.post(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n logger.log('extractBarcode res', JSON.stringify(res.data, null, 2));\n //check if res.data has aleast one key\n if (Object.keys(res.data).length === 0) throw new Error('No data found');\n return res.data;\n } catch (e: any) {\n throw new Error(e?.message || 'Erreur de détection du barcode');\n }\n };\n try {\n return await attempt();\n } catch (e) {\n logger.error('Error extracting Barcode text:', JSON.stringify(e));\n throw e;\n }\n }\n // STEP 3 - MRZ TEXT EXTRACTION\n async extractMrzText(params: { fileUri: string; docType: string; docRegion: string; postfix?: string; token: string; template_path: string; mrz_type: string }): Promise<any> {\n const { fileUri, docType, docRegion, postfix = 'back', token, template_path, mrz_type } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_back.jpg' };\n formData.append('file', rnFile);\n const docTypeShorted = GovernmentDocumentTypeShorted[docType as GovernmentDocumentType];\n logger.log(\"docTypeShorted\", docTypeShorted, docRegion, postfix);\n\n const url = `${this.mrzServiceURL}/extract_mrz_text/?doc_type=${docTypeShorted}&doc_region=${docRegion}&postfix=${postfix}&template_path=${template_path}&mrz_type=${mrz_type}`;\n logger.log(\"url\", url);\n\n const attempt = async () => {\n try {\n const res = await axios.post<ExtractMrzTextResponse>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n logger.log('extractMrzText res', JSON.stringify(res.data, null, 2));\n //check if res.data has aleast one key\n if (Object.keys(res.data).length === 0) throw new Error('No data found');\n if (res.data?.success === false) throw new Error(res.data.parsed_data.status);\n return res.data;\n } catch (e: any) {\n throw new Error(e?.message || 'Erreur de détection du MRZ');\n }\n };\n try {\n return await attempt();\n } catch (e) {\n logger.error('Error extracting MRZ text:', JSON.stringify(errorMessage(e), null, 2));\n throw e;\n }\n }\n\n // STEP 2 - SELFIE VALIDATION\n async recognizeFace(params: { idPhotoUri: string; selfiePhotoUri: string }): Promise<{ is_match: boolean; similarity: number; id_bbox?: number[]; selfie_bbox?: number[] }> {\n const { idPhotoUri, selfiePhotoUri } = params;\n const formData = new FormData();\n const idFile: any = { uri: idPhotoUri, type: 'image/jpeg', name: 'id_card_photo.jpg' };\n const selfieFile: any = { uri: selfiePhotoUri, type: 'image/jpeg', name: 'selfie_final.jpg' };\n formData.append('id_photo', idFile);\n formData.append('selfie_photo', selfieFile);\n\n const res = await axios.post(`${this.faceServiceURL}/recognize_face/`, formData, { timeout: 45000 });\n if (res.data?.detail) throw new Error(res.data.detail);\n return res.data;\n }\n\n // HEALTH CHECKS\n async healthFaceDetection(): Promise<any> {\n const res = await axios.get(`${this.faceServiceURL}/health`);\n return res.data;\n }\n\n async healthTextExtraction(): Promise<any> {\n const res = await axios.get(`${this.textExtractionServiceURL}/health`);\n return res.data;\n }\n\n async healthMrzService(): Promise<any> {\n const res = await axios.get(`${this.mrzServiceURL}/health`);\n return res.data;\n }\n\n async healthOrientationService(): Promise<any> {\n const res = await axios.get(`${this.orientationServiceURL}/health`);\n return res.data;\n }\n\n async newSession(token: string): Promise<SessionResponse> {\n try {\n const data = {\n \"status\": \"PENDING\",\n \"metadata\": {},\n }\n const res = await axios.post<SessionResponse>(`${this.backendServiceURL}/verification/sessions/`,\n data, { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });\n return res.data;\n } catch (error: any) {\n logger.error('Error creating session:', JSON.stringify(errorMessage(error), null, 2));\n\n // Extract backend error message if available\n const backendMessage = errorMessage(error);\n\n if (backendMessage) {\n logger.error('Backend error message:', JSON.stringify(truncateFields(backendMessage), null, 2));\n throw new Error(`Backend error: ${JSON.stringify(truncateFields(backendMessage))}`);\n }\n\n throw error;\n }\n }\n\n async verificationSession(payload: VerificationSessionRequest): Promise<any> {\n\n try {\n\n const token = await authentification();\n\n // /api/v1/verification/api/kyc/sessions/{session_id}/steps/{step}/\n const { session_id, step, data, templateId, action } = payload;\n // const session_id = \"kyc-8b4e069258d8\";\n const payloadData = {\n action: action,\n data: {\n step,\n templateId,\n ...(action === \"location_permission\" ? { permissionGranted: true, } : {}),\n ...data,\n },\n ...({ session_id: session_id }),\n timestamp: new Date().toISOString()\n }\n const url = `${this.backendServiceURL}/verification/api/kyc/sessions/${session_id}/steps/${step}/`;\n\n\n const logPayload = truncateFields({ payloadData, session_id, step });\n logger.log('verificationSession payload',\n JSON.stringify(truncateFields({ logPayload, token, path: url }),\n null, 2))\n\n const res = await axios.post<SessionResponse>(url,\n payloadData,\n {\n headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }\n });\n logger.log('verificationSession res', JSON.stringify(truncateFields(res.data), null, 2));\n return res.data;\n\n\n } catch (error) {\n logger.error('Error validating component:', JSON.stringify(errorMessage(error), null, 2));\n throw new Error(errorMessage(error));\n }\n }\n // reultat de la verification\n async getVerificationResult(session_id: string): Promise<VerificationResult> {\n const token = await authentification();\n const url = `${this.backendServiceURL}/verification/api/kyc/result/?session_id=${session_id}`;\n const res = await axios.get<VerificationResult>(url,\n { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });\n logger.log('getVerificationResult res', JSON.stringify(truncateFields(res.data), null, 2));\n return res.data;\n }\n}\n\n\nconst kycService = new KYCService(\"\", \"\");\nexport default kycService;\n\n\n// Pour éviter d'afficher des champs trop longs, on tronque les valeurs longues dans le log\nexport function truncateFields(obj: any, maxLength = 420): any {\n if (typeof obj !== 'object' || obj === null) return obj;\n if (Array.isArray(obj)) return obj.map(item => truncateFields(item, maxLength));\n const truncated: any = {};\n for (const key in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;\n const value = obj[key];\n if (typeof value === 'string' && value.length > maxLength) {\n truncated[key] = value.slice(0, maxLength) + '... [truncated]';\n } else if (typeof value === 'object' && value !== null) {\n truncated[key] = truncateFields(value, maxLength);\n } else {\n truncated[key] = value;\n }\n }\n return truncated;\n}\nexport const authentification = async () => {\n try {\n const params = new URLSearchParams();\n params.append('client_id', 'kyc_frontend');\n params.append('client_secret', 'ZCW4mGaJXWR0UuI40lM1pHNQmYLw2xvX');\n params.append('grant_type', 'client_credentials');\n const res = await axios.post(`https://keycloak.transfergratis.net/realms/kyc/protocol/openid-connect/token`,\n params,\n {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }\n );\n logger.log('authentification res', JSON.stringify(truncateFields(res.data)));\n return res.data.access_token;\n } catch (error: any) {\n logger.error('Error authentifying:', {\n message: error.message,\n status: error.response?.status,\n statusText: error.response?.statusText,\n data: error.response?.data,\n url: error.config?.url,\n method: error.config?.method\n });\n\n // Extract backend error message if available\n const backendMessage = errorMessage(error);\n\n if (backendMessage) {\n logger.error('Backend authentication error:', JSON.stringify(truncateFields(backendMessage), null, 2));\n throw new Error(`Authentication failed: ${JSON.stringify(truncateFields(backendMessage))}`);\n }\n\n throw error;\n }\n}\n\n\n\nexport const errorMessage = (error: any) => {\n return error.response?.data?.message ||\n error.response?.data?.detail ||\n error.response?.data?.error ||\n error.response?.data;\n}"]}
|
|
1
|
+
{"version":3,"file":"KYCService.js","sourceRoot":"","sources":["../../../src/modules/api/KYCService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,6BAA6B,EAA4B,MAAM,uBAAuB,CAAC;AAGxH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAqC5C,MAAM,OAAO,UAAU;IACb,OAAO,CAAS;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I,EAAE,CAAC,CAAC,CAAC,CAAC;YACvG,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9F,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAID,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE;IACzC,OAAO,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO;QAClC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM;QAC5B,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK;QAC3B,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;AACzB,CAAC,CAAA","sourcesContent":["import axios from 'axios';\nimport { GovernmentDocumentType, GovernmentDocumentTypeShorted, OrientationVideoResponse } from '../../types/KYC.types';\nimport { CheckTemplateTypeResponse, ExtractMrzTextResponse } from '../../components/OverLay/type';\nimport { SessionResponse, VerificationResult, VerificationSessionRequest } from './types';\nimport { logger } from '../../utils/logger';\n\nexport interface KYCRequest {\n userId: string;\n documentImage: string;\n selfieImage: string;\n documentType: 'passport' | 'id_card' | 'drivers_license';\n}\n\nexport interface KYCResponse {\n success: boolean;\n verificationId: string;\n status: 'pending' | 'approved' | 'rejected';\n message?: string;\n}\n\nexport interface FaceDetectionRequest {\n selfieImage: string;\n documentImage: string;\n}\n\nexport interface FaceDetectionResponse {\n match: boolean;\n confidence: number;\n message: string;\n}\n\nexport interface SelfieVideoResponse {\n orientation_direction: \"center\" | \"left\" | \"right\",\n turn_score: number;\n bbox: number[];\n capture: boolean;\n instruction: string;\n error: string;\n}\n\n\nexport class KYCService {\n private baseURL: string;\n private apiKey: string;\n // Additional service base URLs (fixed as per current infra)\n private faceServiceURL = 'https://kyc-engine.transfergratis.net:8000';\n private textExtractionServiceURL = 'https://kyc-engine.transfergratis.net:8006';\n private mrzServiceURL = 'https://kyc-engine.transfergratis.net:8002';\n private barcodeServiceURL = 'https://kyc-engine.transfergratis.net:8000';\n private orientationServiceURL = 'http://18.188.180.154:8080';\n private backendServiceURL = 'https://kyc-backend.transfergratis.net/api/v1';\n\n constructor(baseURL: string, apiKey: string) {\n this.baseURL = baseURL;\n this.apiKey = apiKey;\n }\n\n private getHeaders() {\n return {\n 'Authorization': `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json',\n };\n }\n\n async submitKYC(data: KYCRequest): Promise<KYCResponse> {\n try {\n const response = await axios.post(\n `${this.baseURL}/kyc/submit`,\n data,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n logger.error('Error submitting KYC:', error);\n throw error;\n }\n }\n\n async detectFace(data: FaceDetectionRequest): Promise<FaceDetectionResponse> {\n try {\n const response = await axios.post(\n `${this.baseURL}/ai/face-detection`,\n data,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n logger.error('Error detecting face:', error);\n throw error;\n }\n }\n\n async validateDocument(documentImage: string, documentType: string): Promise<any> {\n try {\n const response = await axios.post(\n `${this.baseURL}/ai/document-validation`,\n { documentImage, documentType },\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n logger.error('Error validating document:', error);\n throw error;\n }\n }\n\n async getKYCStatus(verificationId: string): Promise<KYCResponse> {\n try {\n const response = await axios.get(\n `${this.baseURL}/kyc/status/${verificationId}`,\n { headers: this.getHeaders() }\n );\n return response.data;\n } catch (error) {\n logger.error('Error getting KYC status:', error);\n throw error;\n }\n }\n\n async processSelfieOrientationPicture(videoFile: string, token: string): Promise<SelfieVideoResponse[]> {\n try {\n const formData = new FormData();\n const rnFile: any = {\n uri: videoFile,\n type: 'image/jpeg',\n name: 'selfie_picture.jpg',\n };\n formData.append('file', rnFile);\n const response = await axios.post<SelfieVideoResponse[]>(\n `${this.faceServiceURL}/detect_face_orientation/`,\n formData,\n {\n timeout: 20000,\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n }\n );\n return response.data;\n } catch (error) {\n logger.error('Error processing selfie orientation:', error);\n throw error;\n }\n }\n\n async processOrientationVideo(videoFile: string): Promise<OrientationVideoResponse> {\n try {\n // Create FormData for multipart/form-data request\n const formData = new FormData();\n // In React Native, prefer the { uri, type, name } pattern rather than Blob\n const rnFile: any = {\n uri: videoFile,\n type: 'video/mp4',\n name: 'orientation_video.mp4',\n };\n formData.append('file', rnFile);\n\n const response = await axios.post(\n `${this.orientationServiceURL}/process_orientation_video_stream/`,\n formData,\n {\n // Let axios set the proper multipart boundary header automatically\n timeout: 90000,\n }\n );\n\n return {\n success: true,\n data: response.data,\n message: 'Orientation video processed successfully'\n };\n } catch (error: any) {\n logger.error('Error processing orientation video:', JSON.stringify(error, null, 2));\n\n // Handle specific error cases\n if (error.response?.status === 503) {\n return {\n success: false,\n error: {\n code: 'SERVICE_UNAVAILABLE',\n message: 'Service not ready, model not initialized.',\n details: error.response.data\n },\n message: 'Service temporarily unavailable'\n };\n }\n\n return {\n success: false,\n error: {\n code: 'PROCESSING_ERROR',\n message: error.response?.data?.detail || error.message || 'Unknown error occurred',\n details: error.response?.data\n },\n message: 'Failed to process orientation video'\n };\n }\n }\n\n // STEP 1 - ID CARD VALIDATION\n async detectFaceOnId(idCardImageUri: string, token: string, docType: string): Promise<{ result: boolean, detail: any[] }> {\n const formData = new FormData();\n const rnFile: any = { uri: idCardImageUri, type: 'image/jpeg', name: 'id_card_photo.jpg' };\n formData.append('file', rnFile);\n\n const docTypeShorted = GovernmentDocumentTypeShorted[docType as GovernmentDocumentType];\n\n try {\n const res = await axios.post(`${this.faceServiceURL}/detect_face/?doc_type=${docTypeShorted}`, formData,\n {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 20000\n });\n logger.log('detectFaceOnId res', JSON.stringify(res.data, null, 2));\n\n if (res.data?.result) return res.data;\n throw new Error(res.data?.detail || 'detect_face failed');\n } catch (error) {\n logger.error('Error detecting face on id:', JSON.stringify(error));\n throw error;\n }\n }\n\n //check templatetemplate_type\n async checkTemplateType(params: { fileUri: string; docType: string; docRegion: string; token: string; postfix: string }): Promise<any> {\n const { fileUri, docType, docRegion, token, postfix } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_front.jpg' };\n formData.append('file', rnFile);\n const docTypeShorted = GovernmentDocumentTypeShorted[docType as GovernmentDocumentType];\n const url = `${this.mrzServiceURL}/get_template_version/?doc_type=${encodeURIComponent(docTypeShorted)}&doc_region=${encodeURIComponent(docRegion)}&postfix=${postfix}`;\n\n logger.log('checkTemplateType params', this.mrzServiceURL, JSON.stringify({ fileUri, docTypeShorted, docRegion, token, postfix, url }, null, 2));\n try {\n const res = await axios.post<CheckTemplateTypeResponse>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n logger.log('checkTemplateType res', JSON.stringify(res.data, null, 2));\n return res.data;\n } catch (e: any) {\n logger.error('Error checking template type:', JSON.stringify(e));\n throw e;\n }\n\n }\n\n async extractDocumentInformation(params: { fileUri: string; docType: string; docRegion: string; token: string }): Promise<any> {\n const { fileUri, docType, docRegion, token } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_front.jpg' };\n formData.append('file', rnFile);\n\n const url = `${this.textExtractionServiceURL}/extract_doc_information/?doc_type=${encodeURIComponent(docType)}&doc_region=${encodeURIComponent(docRegion)}`;\n const attempt = async () => {\n const res = await axios.post(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n logger.log('extractDocumentInformation res', JSON.stringify(truncateFields(res)));\n\n if (res.data?.detail) throw new Error(res.data.detail);\n return res.data;\n };\n try {\n return await attempt();\n } catch (e) {\n logger.error('Error extracting document information:', JSON.stringify(truncateFields(e)));\n throw e;\n // await new Promise(r => setTimeout(r, 1500));\n // return await attempt();\n }\n }\n // STEP 2 - barcode extraction\n async extractBarcode(params: { fileUri: string; token: string }): Promise<any> {\n const { fileUri, token } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_back.jpg' };\n formData.append('file', rnFile);\n\n const url = `${this.barcodeServiceURL}/decode_barcode/`;\n const attempt = async () => {\n try {\n const res = await axios.post(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n logger.log('extractBarcode res', JSON.stringify(res.data, null, 2));\n //check if res.data has aleast one key\n if (Object.keys(res.data).length === 0) throw new Error('No data found');\n return res.data;\n } catch (e: any) {\n throw new Error(e?.message || 'Erreur de détection du barcode');\n }\n };\n try {\n return await attempt();\n } catch (e) {\n logger.error('Error extracting Barcode text:', JSON.stringify(e));\n throw e;\n }\n }\n // STEP 3 - MRZ TEXT EXTRACTION\n async extractMrzText(params: { fileUri: string; docType: string; docRegion: string; postfix?: string; token: string; template_path: string; mrz_type: string }): Promise<any> {\n const { fileUri, docType, docRegion, postfix = 'back', token, template_path, mrz_type } = params;\n const formData = new FormData();\n const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_back.jpg' };\n formData.append('file', rnFile);\n const docTypeShorted = GovernmentDocumentTypeShorted[docType as GovernmentDocumentType];\n logger.log(\"docTypeShorted\", docTypeShorted, docRegion, postfix);\n\n const url = `${this.mrzServiceURL}/extract_mrz_text/?doc_type=${docTypeShorted}&doc_region=${docRegion}&postfix=${postfix}&template_path=${template_path}&mrz_type=${mrz_type}`;\n logger.log(\"url\", url);\n\n const attempt = async () => {\n try {\n const res = await axios.post<ExtractMrzTextResponse>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },\n timeout: 60000,\n });\n logger.log('extractMrzText res', JSON.stringify(res.data, null, 2));\n //check if res.data has aleast one key\n if (Object.keys(res.data).length === 0) throw new Error('No data found');\n if (res.data?.success === false) throw new Error(res.data.parsed_data.status);\n return res.data;\n } catch (e: any) {\n throw new Error(e?.message || 'Erreur de détection du MRZ');\n }\n };\n try {\n return await attempt();\n } catch (e) {\n logger.error('Error extracting MRZ text:', JSON.stringify(errorMessage(e), null, 2));\n throw e;\n }\n }\n\n // STEP 2 - SELFIE VALIDATION\n async recognizeFace(params: { idPhotoUri: string; selfiePhotoUri: string }): Promise<{ is_match: boolean; similarity: number; id_bbox?: number[]; selfie_bbox?: number[] }> {\n const { idPhotoUri, selfiePhotoUri } = params;\n const formData = new FormData();\n const idFile: any = { uri: idPhotoUri, type: 'image/jpeg', name: 'id_card_photo.jpg' };\n const selfieFile: any = { uri: selfiePhotoUri, type: 'image/jpeg', name: 'selfie_final.jpg' };\n formData.append('id_photo', idFile);\n formData.append('selfie_photo', selfieFile);\n\n const res = await axios.post(`${this.faceServiceURL}/recognize_face/`, formData, { timeout: 45000 });\n if (res.data?.detail) throw new Error(res.data.detail);\n return res.data;\n }\n\n // HEALTH CHECKS\n async healthFaceDetection(): Promise<any> {\n const res = await axios.get(`${this.faceServiceURL}/health`);\n return res.data;\n }\n\n async healthTextExtraction(): Promise<any> {\n const res = await axios.get(`${this.textExtractionServiceURL}/health`);\n return res.data;\n }\n\n async healthMrzService(): Promise<any> {\n const res = await axios.get(`${this.mrzServiceURL}/health`);\n return res.data;\n }\n\n async healthOrientationService(): Promise<any> {\n const res = await axios.get(`${this.orientationServiceURL}/health`);\n return res.data;\n }\n\n async newSession(token: string): Promise<SessionResponse> {\n try {\n const data = {\n \"status\": \"PENDING\",\n \"metadata\": {},\n }\n const res = await axios.post<SessionResponse>(`${this.backendServiceURL}/verification/sessions/`,\n data, { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });\n return res.data;\n } catch (error: any) {\n logger.error('Error creating session:', JSON.stringify(errorMessage(error), null, 2));\n\n // Extract backend error message if available\n const backendMessage = errorMessage(error);\n\n if (backendMessage) {\n logger.error('Backend error message:', JSON.stringify(truncateFields(backendMessage), null, 2));\n throw new Error(`Backend error: ${JSON.stringify(truncateFields(backendMessage))}`);\n }\n\n throw error;\n }\n }\n\n async verificationSession(payload: VerificationSessionRequest): Promise<any> {\n\n try {\n\n const token = await authentification();\n\n // /api/v1/verification/api/kyc/sessions/{session_id}/steps/{step}/\n const { session_id, step, data, templateId, action } = payload;\n // const session_id = \"kyc-8b4e069258d8\";\n const payloadData = {\n action: action,\n data: {\n step,\n templateId,\n ...(action === \"location_permission\" ? { permissionGranted: true, } : {}),\n ...data,\n },\n ...({ session_id: session_id }),\n timestamp: new Date().toISOString()\n }\n const url = `${this.backendServiceURL}/verification/api/kyc/sessions/${session_id}/steps/${step}/`;\n\n\n const logPayload = truncateFields({ payloadData, session_id, step });\n logger.log('verificationSession payload',\n JSON.stringify(truncateFields({ logPayload, token, path: url }),\n null, 2))\n\n const res = await axios.post<SessionResponse>(url,\n payloadData,\n {\n headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }\n });\n logger.log('verificationSession res', JSON.stringify(truncateFields(res.data), null, 2));\n return res.data;\n\n\n } catch (error) {\n logger.error('Error validating component:', JSON.stringify(errorMessage(error), null, 2));\n throw new Error(errorMessage(error));\n }\n }\n // reultat de la verification\n async getVerificationResult(session_id: string): Promise<VerificationResult> {\n try {\n const token = await authentification();\n const url = `${this.backendServiceURL}/verification/api/kyc/result/?session_id=${session_id}`;\n const res = await axios.get<VerificationResult>(url,\n { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });\n logger.log('getVerificationResult res', JSON.stringify(truncateFields(res.data), null, 2));\n return res.data;\n } catch (error) {\n logger.error('Error getting verification result:', JSON.stringify(errorMessage(error), null, 2));\n throw error;\n }\n }\n}\n\n\nconst kycService = new KYCService(\"\", \"\");\nexport default kycService;\n\n\n// Pour éviter d'afficher des champs trop longs, on tronque les valeurs longues dans le log\nexport function truncateFields(obj: any, maxLength = 420): any {\n if (typeof obj !== 'object' || obj === null) return obj;\n if (Array.isArray(obj)) return obj.map(item => truncateFields(item, maxLength));\n const truncated: any = {};\n for (const key in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;\n const value = obj[key];\n if (typeof value === 'string' && value.length > maxLength) {\n truncated[key] = value.slice(0, maxLength) + '... [truncated]';\n } else if (typeof value === 'object' && value !== null) {\n truncated[key] = truncateFields(value, maxLength);\n } else {\n truncated[key] = value;\n }\n }\n return truncated;\n}\nexport const authentification = async () => {\n try {\n const params = new URLSearchParams();\n params.append('client_id', 'kyc_frontend');\n params.append('client_secret', 'ZCW4mGaJXWR0UuI40lM1pHNQmYLw2xvX');\n params.append('grant_type', 'client_credentials');\n const res = await axios.post(`https://keycloak.transfergratis.net/realms/kyc/protocol/openid-connect/token`,\n params,\n {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }\n );\n logger.log('authentification res', JSON.stringify(truncateFields(res.data)));\n return res.data.access_token;\n } catch (error: any) {\n logger.error('Error authentifying:', {\n message: error.message,\n status: error.response?.status,\n statusText: error.response?.statusText,\n data: error.response?.data,\n url: error.config?.url,\n method: error.config?.method\n });\n\n // Extract backend error message if available\n const backendMessage = errorMessage(error);\n\n if (backendMessage) {\n logger.error('Backend authentication error:', JSON.stringify(truncateFields(backendMessage), null, 2));\n throw new Error(`Authentication failed: ${JSON.stringify(truncateFields(backendMessage))}`);\n }\n\n throw error;\n }\n}\n\n\n\nexport const errorMessage = (error: any) => {\n return error.response?.data?.message ||\n error.response?.data?.detail ||\n error.response?.data?.error ||\n error.response?.data;\n}"]}
|
package/build/utils/cropByObb.js
CHANGED
|
@@ -66,9 +66,9 @@ export async function cropImageWithBBox(uri, bbox) {
|
|
|
66
66
|
// 3️⃣ Convertir le bbox à la taille réelle scale 0.10 = 10%
|
|
67
67
|
const crop = {
|
|
68
68
|
originX: bbox.minX,
|
|
69
|
-
originY: bbox.minY
|
|
70
|
-
width: bbox.width
|
|
71
|
-
height: bbox.height
|
|
69
|
+
originY: bbox.minY,
|
|
70
|
+
width: bbox.width,
|
|
71
|
+
height: bbox.height,
|
|
72
72
|
};
|
|
73
73
|
// 4️⃣ Appliquer le crop
|
|
74
74
|
const result = await ImageManipulator.manipulateAsync(uri, [{ crop }], { compress: 1, format: ImageManipulator.SaveFormat.PNG });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cropByObb.js","sourceRoot":"","sources":["../../src/utils/cropByObb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAI3D,gEAAgE;AAChE,SAAS,WAAW,CAAC,MAAe;IAClC,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC;AAC7E,CAAC;AAED,uDAAuD;AACvD,KAAK,UAAU,OAAO,CAAC,GAAW,EAAE,MAAe;IACjD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM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AsD;IACtD,wDAAwD;IAExD,4DAA4D;IAC5D,MAAM,IAAI,GAAG;QACX,OAAO,EAAE,IAAI,CAAC,IAAI;QAClB,OAAO,EAAE,IAAI,CAAC,IAAI;QAClB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC;IAEF,wBAAwB;IACxB,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,eAAe,CACnD,GAAG,EACH,CAAC,EAAE,IAAI,EAAE,CAAC,EACV,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,EAAE,CACzD,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC,GAAG,CAAC;AACpB,CAAC","sourcesContent":["import { Image as RNImage, Platform } from 'react-native';\nimport * as ImageManipulator from \"expo-image-manipulator\";\n\ntype Point = [number, number];\n\n// Compute axis-aligned bounding box from oriented quadrilateral\nfunction computeAabb(points: Point[]) {\n const xs = points.map(p => p[0]);\n const ys = points.map(p => p[1]);\n const minX = Math.min(...xs);\n const minY = Math.min(...ys);\n const maxX = Math.max(...xs);\n const maxY = Math.max(...ys);\n return { minX, minY, maxX, maxY, width: maxX - minX, height: maxY - minY };\n}\n\n// Web-only crop using Canvas; returns dataURL (base64)\nasync function cropWeb(uri: string, points: Point[]): Promise<string> {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.crossOrigin = 'anonymous';\n img.onload = () => {\n const { minX, minY, width, height } = computeAabb(points);\n const canvas = document.createElement('canvas');\n canvas.width = Math.max(1, Math.round(width));\n canvas.height = Math.max(1, Math.round(height));\n const ctx = canvas.getContext('2d');\n if (!ctx) return reject(new Error('Canvas context not available'));\n ctx.drawImage(\n img,\n minX, // sx\n minY, // sy\n width, // sw\n height, // sh\n 0,\n 0,\n canvas.width,\n canvas.height\n );\n resolve(canvas.toDataURL('image/jpeg', 0.92));\n };\n img.onerror = (e) => reject(e);\n img.src = uri;\n });\n}\n\n// Fallback: return original for native (no dependency added); caller can still use bbox to draw overlay\nexport async function cropByObb(uri: string, cardObb: any): Promise<{ base64?: string; bbox?: { minX: number; minY: number; width: number; height: number } }> {\n try {\n // card_obb format: [ [ [p1,p2,p3,p4], score ] ]\n const first = Array.isArray(cardObb) ? cardObb[0] : null;\n const points = Array.isArray(first?.[0]) ? (first[0] as Point[]) : null;\n if (!points || points.length !== 4) return {};\n\n const { minX, minY, width, height } = computeAabb(points);\n\n if (Platform.OS === 'web') {\n const base64 = await cropWeb(uri, points);\n return { base64, bbox: { minX, minY, width, height } };\n }\n // Native: return bbox only; keep base64 undefined\n return { bbox: { minX, minY, width, height } };\n } catch (e) {\n return {};\n }\n}\n\n\n\n\n// exemple d'appel :\nexport async function cropImageWithBBox(uri: string, bbox: any) {\n // 1️⃣ Récupère la taille originale de l'image\n await RNImage.getSize(uri, (width, height) => {\n console.log(\"Image originale:\", width, height);\n });\n\n // // 2️⃣ Suppose que ton bbox vient d'une image affichée dans `displayedSize`\n // const scaleX = originalWidth / displayedSize.width;\n // const scaleY = originalHeight / displayedSize.height;\n\n // 3️⃣ Convertir le bbox à la taille réelle scale 0.10 = 10%\n const crop = {\n originX: bbox.minX ,\n originY: bbox.minY ,\n width: bbox.width ,\n height: bbox.height,\n };\n\n // 4️⃣ Appliquer le crop\n const result = await ImageManipulator.manipulateAsync(\n uri,\n [{ crop }],\n { compress: 1, format: ImageManipulator.SaveFormat.PNG }\n );\n\n console.log(\"Image recadrée:\", result.uri);\n return result.uri;\n}\n"]}
|