@transfergratis/react-native-sdk 0.1.2
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/README.md +539 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +14 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/runConfigurations.xml +17 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build/.transforms/7ec900c0f64f5f1a7c88998dd44001b8/results.bin +1 -0
- package/android/build/.transforms/7ec900c0f64f5f1a7c88998dd44001b8/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/results.bin +1 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/BuildConfig.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkView.dex +0 -0
- package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/generated/source/buildConfig/debug/kyc/transfergratis/com/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +35 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +1 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_file_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/transfergratis-sdk_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/kyc/transfergratis/com/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +3 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +58 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +35 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/file_paths.xml +15 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/transfergratis-sdk_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +63 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/transfergratis-sdk_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkView.class +0 -0
- package/android/build.gradle +47 -0
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +28 -0
- package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkModule.kt +131 -0
- package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkView.kt +161 -0
- package/android/src/main/res/xml/file_paths.xml +15 -0
- package/build/App.d.ts +3 -0
- package/build/App.d.ts.map +1 -0
- package/build/App.js +9 -0
- package/build/App.js.map +1 -0
- package/build/TransfergratisSdk.types.d.ts +32 -0
- package/build/TransfergratisSdk.types.d.ts.map +1 -0
- package/build/TransfergratisSdk.types.js +2 -0
- package/build/TransfergratisSdk.types.js.map +1 -0
- package/build/TransfergratisSdkModule.d.ts +21 -0
- package/build/TransfergratisSdkModule.d.ts.map +1 -0
- package/build/TransfergratisSdkModule.js +4 -0
- package/build/TransfergratisSdkModule.js.map +1 -0
- package/build/TransfergratisSdkModule.web.d.ts +20 -0
- package/build/TransfergratisSdkModule.web.d.ts.map +1 -0
- package/build/TransfergratisSdkModule.web.js +25 -0
- package/build/TransfergratisSdkModule.web.js.map +1 -0
- package/build/TransfergratisSdkView.d.ts +4 -0
- package/build/TransfergratisSdkView.d.ts.map +1 -0
- package/build/TransfergratisSdkView.js +7 -0
- package/build/TransfergratisSdkView.js.map +1 -0
- package/build/TransfergratisSdkView.web.d.ts +4 -0
- package/build/TransfergratisSdkView.web.d.ts.map +1 -0
- package/build/TransfergratisSdkView.web.js +11 -0
- package/build/TransfergratisSdkView.web.js.map +1 -0
- package/build/components/Camera/index.d.ts +2 -0
- package/build/components/Camera/index.d.ts.map +1 -0
- package/build/components/Camera/index.js +2 -0
- package/build/components/Camera/index.js.map +1 -0
- package/build/components/Camera/index.web.d.ts +2 -0
- package/build/components/Camera/index.web.d.ts.map +1 -0
- package/build/components/Camera/index.web.js +2 -0
- package/build/components/Camera/index.web.js.map +1 -0
- package/build/components/Camera/types.d.ts +2 -0
- package/build/components/Camera/types.d.ts.map +1 -0
- package/build/components/Camera/types.js +2 -0
- package/build/components/Camera/types.js.map +1 -0
- package/build/components/ConfigurableKYCFlow.d.ts +11 -0
- package/build/components/ConfigurableKYCFlow.d.ts.map +1 -0
- package/build/components/ConfigurableKYCFlow.js +257 -0
- package/build/components/ConfigurableKYCFlow.js.map +1 -0
- package/build/components/CustomCameraExample.d.ts +10 -0
- package/build/components/CustomCameraExample.d.ts.map +1 -0
- package/build/components/CustomCameraExample.js +232 -0
- package/build/components/CustomCameraExample.js.map +1 -0
- package/build/components/EnhancedCameraView.d.ts +44 -0
- package/build/components/EnhancedCameraView.d.ts.map +1 -0
- package/build/components/EnhancedCameraView.js +316 -0
- package/build/components/EnhancedCameraView.js.map +1 -0
- package/build/components/EnhancedCameraView.web.d.ts +44 -0
- package/build/components/EnhancedCameraView.web.d.ts.map +1 -0
- package/build/components/EnhancedCameraView.web.js +399 -0
- package/build/components/EnhancedCameraView.web.js.map +1 -0
- package/build/components/FileUpload.d.ts +13 -0
- package/build/components/FileUpload.d.ts.map +1 -0
- package/build/components/FileUpload.js +216 -0
- package/build/components/FileUpload.js.map +1 -0
- package/build/components/KYCElementRenderer.d.ts +14 -0
- package/build/components/KYCElementRenderer.d.ts.map +1 -0
- package/build/components/KYCElementRenderer.js +31 -0
- package/build/components/KYCElementRenderer.js.map +1 -0
- package/build/components/KYCElements/CameraCapture.d.ts +11 -0
- package/build/components/KYCElements/CameraCapture.d.ts.map +1 -0
- package/build/components/KYCElements/CameraCapture.js +218 -0
- package/build/components/KYCElements/CameraCapture.js.map +1 -0
- package/build/components/KYCElements/CompletionStep.d.ts +10 -0
- package/build/components/KYCElements/CompletionStep.d.ts.map +1 -0
- package/build/components/KYCElements/CompletionStep.js +147 -0
- package/build/components/KYCElements/CompletionStep.js.map +1 -0
- package/build/components/KYCElements/CountrySelection.d.ts +11 -0
- package/build/components/KYCElements/CountrySelection.d.ts.map +1 -0
- package/build/components/KYCElements/CountrySelection.js +147 -0
- package/build/components/KYCElements/CountrySelection.js.map +1 -0
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts +12 -0
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/CountrySelectionTemplate.js +245 -0
- package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -0
- package/build/components/KYCElements/DocumentTypeSelection.d.ts +11 -0
- package/build/components/KYCElements/DocumentTypeSelection.d.ts.map +1 -0
- package/build/components/KYCElements/DocumentTypeSelection.js +143 -0
- package/build/components/KYCElements/DocumentTypeSelection.js.map +1 -0
- package/build/components/KYCElements/FileUpload.d.ts +11 -0
- package/build/components/KYCElements/FileUpload.d.ts.map +1 -0
- package/build/components/KYCElements/FileUpload.js +267 -0
- package/build/components/KYCElements/FileUpload.js.map +1 -0
- package/build/components/KYCElements/FileUploadTemplate.d.ts +12 -0
- package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/FileUploadTemplate.js +326 -0
- package/build/components/KYCElements/FileUploadTemplate.js.map +1 -0
- package/build/components/KYCElements/IDCardCapture.d.ts +13 -0
- package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -0
- package/build/components/KYCElements/IDCardCapture.js +421 -0
- package/build/components/KYCElements/IDCardCapture.js.map +1 -0
- package/build/components/KYCElements/LocationCaptureTemplate.d.ts +20 -0
- package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/LocationCaptureTemplate.js +275 -0
- package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -0
- package/build/components/KYCElements/OrientationVideoCapture.d.ts +12 -0
- package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -0
- package/build/components/KYCElements/OrientationVideoCapture.js +533 -0
- package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +12 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js +503 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +12 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js +429 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -0
- package/build/components/KYCElements/SelfieCapture.d.ts +11 -0
- package/build/components/KYCElements/SelfieCapture.d.ts.map +1 -0
- package/build/components/KYCElements/SelfieCapture.js +235 -0
- package/build/components/KYCElements/SelfieCapture.js.map +1 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +12 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.js +321 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -0
- package/build/components/KYCElements/VerificationStep.d.ts +10 -0
- package/build/components/KYCElements/VerificationStep.d.ts.map +1 -0
- package/build/components/KYCElements/VerificationStep.js +199 -0
- package/build/components/KYCElements/VerificationStep.js.map +1 -0
- package/build/components/KYCExample.d.ts +3 -0
- package/build/components/KYCExample.d.ts.map +1 -0
- package/build/components/KYCExample.js +247 -0
- package/build/components/KYCExample.js.map +1 -0
- package/build/components/KYCFlow.d.ts +3 -0
- package/build/components/KYCFlow.d.ts.map +1 -0
- package/build/components/KYCFlow.js +308 -0
- package/build/components/KYCFlow.js.map +1 -0
- package/build/components/NativeCameraView.d.ts +11 -0
- package/build/components/NativeCameraView.d.ts.map +1 -0
- package/build/components/NativeCameraView.js +27 -0
- package/build/components/NativeCameraView.js.map +1 -0
- package/build/components/OverLay/IdCard.d.ts +4 -0
- package/build/components/OverLay/IdCard.d.ts.map +1 -0
- package/build/components/OverLay/IdCard.js +181 -0
- package/build/components/OverLay/IdCard.js.map +1 -0
- package/build/components/OverLay/SelfieOverlay.d.ts +4 -0
- package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -0
- package/build/components/OverLay/SelfieOverlay.js +168 -0
- package/build/components/OverLay/SelfieOverlay.js.map +1 -0
- package/build/components/OverLay/StepOverlay.d.ts +9 -0
- package/build/components/OverLay/StepOverlay.d.ts.map +1 -0
- package/build/components/OverLay/StepOverlay.js +51 -0
- package/build/components/OverLay/StepOverlay.js.map +1 -0
- package/build/components/OverLay/type.d.ts +21 -0
- package/build/components/OverLay/type.d.ts.map +1 -0
- package/build/components/OverLay/type.js +2 -0
- package/build/components/OverLay/type.js.map +1 -0
- package/build/components/ProgressIndicator.d.ts +8 -0
- package/build/components/ProgressIndicator.d.ts.map +1 -0
- package/build/components/ProgressIndicator.js +48 -0
- package/build/components/ProgressIndicator.js.map +1 -0
- package/build/components/SelfieCapture.d.ts +3 -0
- package/build/components/SelfieCapture.d.ts.map +1 -0
- package/build/components/SelfieCapture.js +197 -0
- package/build/components/SelfieCapture.js.map +1 -0
- package/build/components/SimpleExample.d.ts +3 -0
- package/build/components/SimpleExample.d.ts.map +1 -0
- package/build/components/SimpleExample.js +89 -0
- package/build/components/SimpleExample.js.map +1 -0
- package/build/components/Svgs/GpsIcon.d.ts +3 -0
- package/build/components/Svgs/GpsIcon.d.ts.map +1 -0
- package/build/components/Svgs/GpsIcon.js +9 -0
- package/build/components/Svgs/GpsIcon.js.map +1 -0
- package/build/components/Svgs/Schield.d.ts +3 -0
- package/build/components/Svgs/Schield.d.ts.map +1 -0
- package/build/components/Svgs/Schield.js +22 -0
- package/build/components/Svgs/Schield.js.map +1 -0
- package/build/components/Svgs/frontSelfieIcon.d.ts +3 -0
- package/build/components/Svgs/frontSelfieIcon.d.ts.map +1 -0
- package/build/components/Svgs/frontSelfieIcon.js +11 -0
- package/build/components/Svgs/frontSelfieIcon.js.map +1 -0
- package/build/components/Svgs/scanningLine.d.ts +9 -0
- package/build/components/Svgs/scanningLine.d.ts.map +1 -0
- package/build/components/Svgs/scanningLine.js +61 -0
- package/build/components/Svgs/scanningLine.js.map +1 -0
- package/build/components/Svgs/sideSelfieIcon.d.ts +3 -0
- package/build/components/Svgs/sideSelfieIcon.d.ts.map +1 -0
- package/build/components/Svgs/sideSelfieIcon.js +9 -0
- package/build/components/Svgs/sideSelfieIcon.js.map +1 -0
- package/build/components/TemplateKYCExample.d.ts +7 -0
- package/build/components/TemplateKYCExample.d.ts.map +1 -0
- package/build/components/TemplateKYCExample.js +433 -0
- package/build/components/TemplateKYCExample.js.map +1 -0
- package/build/components/TemplateKYCFlowRefactored.d.ts +12 -0
- package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -0
- package/build/components/TemplateKYCFlowRefactored.js +210 -0
- package/build/components/TemplateKYCFlowRefactored.js.map +1 -0
- package/build/components/VisionCameraView.d.ts +22 -0
- package/build/components/VisionCameraView.d.ts.map +1 -0
- package/build/components/VisionCameraView.js +142 -0
- package/build/components/VisionCameraView.js.map +1 -0
- package/build/components/example/CameraCaptureEx.d.ts +4 -0
- package/build/components/example/CameraCaptureEx.d.ts.map +1 -0
- package/build/components/example/CameraCaptureEx.js +219 -0
- package/build/components/example/CameraCaptureEx.js.map +1 -0
- package/build/components/example/CameraCaptureExAdvanced.d.ts +3 -0
- package/build/components/example/CameraCaptureExAdvanced.d.ts.map +1 -0
- package/build/components/example/CameraCaptureExAdvanced.js +229 -0
- package/build/components/example/CameraCaptureExAdvanced.js.map +1 -0
- package/build/components/example/CameraCaptureExScan.d.ts +3 -0
- package/build/components/example/CameraCaptureExScan.d.ts.map +1 -0
- package/build/components/example/CameraCaptureExScan.js +213 -0
- package/build/components/example/CameraCaptureExScan.js.map +1 -0
- package/build/components/example/CameraCaptureExSimple.d.ts +3 -0
- package/build/components/example/CameraCaptureExSimple.d.ts.map +1 -0
- package/build/components/example/CameraCaptureExSimple.js +138 -0
- package/build/components/example/CameraCaptureExSimple.js.map +1 -0
- package/build/components/example/OrientationVideoExample.d.ts +4 -0
- package/build/components/example/OrientationVideoExample.d.ts.map +1 -0
- package/build/components/example/OrientationVideoExample.js +329 -0
- package/build/components/example/OrientationVideoExample.js.map +1 -0
- package/build/components/example/SelfieCaptureEx.d.ts +4 -0
- package/build/components/example/SelfieCaptureEx.d.ts.map +1 -0
- package/build/components/example/SelfieCaptureEx.js +238 -0
- package/build/components/example/SelfieCaptureEx.js.map +1 -0
- package/build/components/ui/Button.d.ts +37 -0
- package/build/components/ui/Button.d.ts.map +1 -0
- package/build/components/ui/Button.js +194 -0
- package/build/components/ui/Button.js.map +1 -0
- package/build/components/ui/ButtonExample.d.ts +4 -0
- package/build/components/ui/ButtonExample.d.ts.map +1 -0
- package/build/components/ui/ButtonExample.js +209 -0
- package/build/components/ui/ButtonExample.js.map +1 -0
- package/build/components/ui/ButtonStyles.d.ts +521 -0
- package/build/components/ui/ButtonStyles.d.ts.map +1 -0
- package/build/components/ui/ButtonStyles.js +429 -0
- package/build/components/ui/ButtonStyles.js.map +1 -0
- package/build/config/KYCConfigs.d.ts +7 -0
- package/build/config/KYCConfigs.d.ts.map +1 -0
- package/build/config/KYCConfigs.js +516 -0
- package/build/config/KYCConfigs.js.map +1 -0
- package/build/hooks/useKYC.d.ts +15 -0
- package/build/hooks/useKYC.d.ts.map +1 -0
- package/build/hooks/useKYC.js +103 -0
- package/build/hooks/useKYC.js.map +1 -0
- package/build/hooks/useKYCFlow.d.ts +3 -0
- package/build/hooks/useKYCFlow.d.ts.map +1 -0
- package/build/hooks/useKYCFlow.js +221 -0
- package/build/hooks/useKYCFlow.js.map +1 -0
- package/build/hooks/useLocation.d.ts +32 -0
- package/build/hooks/useLocation.d.ts.map +1 -0
- package/build/hooks/useLocation.js +165 -0
- package/build/hooks/useLocation.js.map +1 -0
- package/build/hooks/useOrientationVideo.d.ts +10 -0
- package/build/hooks/useOrientationVideo.d.ts.map +1 -0
- package/build/hooks/useOrientationVideo.js +117 -0
- package/build/hooks/useOrientationVideo.js.map +1 -0
- package/build/hooks/useTemplateKYCFlow.d.ts +28 -0
- package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -0
- package/build/hooks/useTemplateKYCFlow.js +221 -0
- package/build/hooks/useTemplateKYCFlow.js.map +1 -0
- package/build/index.d.ts +34 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +45 -0
- package/build/index.js.map +1 -0
- package/build/modules/api/KYCService.d.ts +35 -0
- package/build/modules/api/KYCService.d.ts.map +1 -0
- package/build/modules/api/KYCService.js +119 -0
- package/build/modules/api/KYCService.js.map +1 -0
- package/build/modules/camera/NativeCameraModule.d.ts +52 -0
- package/build/modules/camera/NativeCameraModule.d.ts.map +1 -0
- package/build/modules/camera/NativeCameraModule.js +149 -0
- package/build/modules/camera/NativeCameraModule.js.map +1 -0
- package/build/modules/camera/UnifiedCameraModule.d.ts +70 -0
- package/build/modules/camera/UnifiedCameraModule.d.ts.map +1 -0
- package/build/modules/camera/UnifiedCameraModule.js +125 -0
- package/build/modules/camera/UnifiedCameraModule.js.map +1 -0
- package/build/modules/camera/VisionCameraModule.d.ts +62 -0
- package/build/modules/camera/VisionCameraModule.d.ts.map +1 -0
- package/build/modules/camera/VisionCameraModule.js +198 -0
- package/build/modules/camera/VisionCameraModule.js.map +1 -0
- package/build/modules/camera/VisionCameraModule.web.d.ts +145 -0
- package/build/modules/camera/VisionCameraModule.web.d.ts.map +1 -0
- package/build/modules/camera/VisionCameraModule.web.js +570 -0
- package/build/modules/camera/VisionCameraModule.web.js.map +1 -0
- package/build/modules/camera/index.d.ts +5 -0
- package/build/modules/camera/index.d.ts.map +1 -0
- package/build/modules/camera/index.js +4 -0
- package/build/modules/camera/index.js.map +1 -0
- package/build/stores/kycStore.d.ts +55 -0
- package/build/stores/kycStore.d.ts.map +1 -0
- package/build/stores/kycStore.js +98 -0
- package/build/stores/kycStore.js.map +1 -0
- package/build/types/KYC.types.d.ts +326 -0
- package/build/types/KYC.types.d.ts.map +1 -0
- package/build/types/KYC.types.js +2 -0
- package/build/types/KYC.types.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/TransfergratisSdk.podspec +31 -0
- package/ios/TransfergratisSdkModule.swift +409 -0
- package/package.json +67 -0
- package/plugin/build/index.d.ts +4 -0
- package/plugin/build/index.js +10 -0
- package/plugin/build/withLocation.d.ts +9 -0
- package/plugin/build/withLocation.js +77 -0
- package/plugin/build/withVisionCamera.d.ts +8 -0
- package/plugin/build/withVisionCamera.js +69 -0
- package/plugin/src/index.ts +4 -0
- package/plugin/src/withLocation.ts +109 -0
- package/plugin/src/withVisionCamera.js +89 -0
- package/plugin/src/withVisionCamera.ts +98 -0
- package/plugin/tsconfig.json +17 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/plugin.js +14 -0
- package/src/App.tsx +9 -0
- package/src/TransfergratisSdk.types.ts +30 -0
- package/src/TransfergratisSdkModule.ts +16 -0
- package/src/TransfergratisSdkModule.web.ts +31 -0
- package/src/TransfergratisSdkView.tsx +11 -0
- package/src/TransfergratisSdkView.web.tsx +15 -0
- package/src/components/Camera/index.tsx +0 -0
- package/src/components/Camera/index.web.tsx +0 -0
- package/src/components/Camera/types.ts +0 -0
- package/src/components/ConfigurableKYCFlow.tsx +334 -0
- package/src/components/CustomCameraExample.tsx +274 -0
- package/src/components/EnhancedCameraView.tsx +421 -0
- package/src/components/EnhancedCameraView.web.tsx +517 -0
- package/src/components/FileUpload.tsx +249 -0
- package/src/components/KYCElementRenderer.tsx +106 -0
- package/src/components/KYCElements/CameraCapture.tsx +267 -0
- package/src/components/KYCElements/CompletionStep.tsx +161 -0
- package/src/components/KYCElements/CountrySelection.tsx +177 -0
- package/src/components/KYCElements/CountrySelectionTemplate.tsx +282 -0
- package/src/components/KYCElements/DocumentTypeSelection.tsx +173 -0
- package/src/components/KYCElements/FileUpload.tsx +317 -0
- package/src/components/KYCElements/FileUploadTemplate.tsx +388 -0
- package/src/components/KYCElements/IDCardCapture.tsx +519 -0
- package/src/components/KYCElements/LocationCaptureTemplate.tsx +325 -0
- package/src/components/KYCElements/OrientationVideoCapture.tsx +646 -0
- package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +613 -0
- package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +531 -0
- package/src/components/KYCElements/SelfieCapture.tsx +283 -0
- package/src/components/KYCElements/SelfieCaptureTemplate.tsx +388 -0
- package/src/components/KYCElements/VerificationStep.tsx +234 -0
- package/src/components/KYCExample.tsx +297 -0
- package/src/components/KYCFlow.tsx +377 -0
- package/src/components/NativeCameraView.tsx +47 -0
- package/src/components/OverLay/IdCard.tsx +269 -0
- package/src/components/OverLay/SelfieOverlay.tsx +210 -0
- package/src/components/OverLay/StepOverlay.tsx +62 -0
- package/src/components/OverLay/type.ts +21 -0
- package/src/components/ProgressIndicator.tsx +62 -0
- package/src/components/SelfieCapture.tsx +244 -0
- package/src/components/SimpleExample.tsx +92 -0
- package/src/components/Svgs/GpsIcon.tsx +12 -0
- package/src/components/Svgs/Schield.tsx +26 -0
- package/src/components/Svgs/directionArrow.gif +0 -0
- package/src/components/Svgs/frontSelfieIcon.tsx +13 -0
- package/src/components/Svgs/scanningLine.tsx +88 -0
- package/src/components/Svgs/sideSelfieIcon.tsx +10 -0
- package/src/components/TemplateKYCExample.tsx +447 -0
- package/src/components/TemplateKYCFlowRefactored.tsx +263 -0
- package/src/components/VisionCameraView.tsx +197 -0
- package/src/components/example/CameraCaptureEx.tsx +335 -0
- package/src/components/example/CameraCaptureExAdvanced.tsx +357 -0
- package/src/components/example/CameraCaptureExScan.tsx +336 -0
- package/src/components/example/CameraCaptureExSimple.tsx +215 -0
- package/src/components/example/OrientationVideoExample.tsx +384 -0
- package/src/components/example/SelfieCaptureEx.tsx +358 -0
- package/src/components/ui/Button.tsx +328 -0
- package/src/components/ui/ButtonExample.tsx +318 -0
- package/src/components/ui/ButtonStyles.ts +465 -0
- package/src/config/KYCConfigs.ts +528 -0
- package/src/hooks/useKYC.ts +131 -0
- package/src/hooks/useKYCFlow.ts +248 -0
- package/src/hooks/useLocation.ts +221 -0
- package/src/hooks/useOrientationVideo.ts +148 -0
- package/src/hooks/useTemplateKYCFlow.tsx +292 -0
- package/src/index.ts +72 -0
- package/src/modules/api/KYCService.ts +171 -0
- package/src/modules/camera/NativeCameraModule.ts +170 -0
- package/src/modules/camera/UnifiedCameraModule.ts +160 -0
- package/src/modules/camera/VisionCameraModule.ts +217 -0
- package/src/modules/camera/VisionCameraModule.web.ts +661 -0
- package/src/modules/camera/index.ts +6 -0
- package/src/stores/kycStore.ts +161 -0
- package/src/types/KYC.types.ts +434 -0
- package/src/types/nativewind.d.ts +2 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useKYCStore } from '../stores/kycStore';
|
|
3
|
+
export const useKYC = () => {
|
|
4
|
+
const { currentSession, currentStep, isProcessing, error, initializeSession, setCurrentStep, addDocument, setSelfie, setProcessing, setError, clearSession, updateSession } = useKYCStore();
|
|
5
|
+
const startSession = useCallback((userId) => {
|
|
6
|
+
try {
|
|
7
|
+
initializeSession(userId);
|
|
8
|
+
setError(null);
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
setError('Impossible de démarrer la session KYC');
|
|
12
|
+
}
|
|
13
|
+
}, [initializeSession, setError]);
|
|
14
|
+
const nextStep = useCallback(() => {
|
|
15
|
+
if (currentStep < 4) {
|
|
16
|
+
setCurrentStep(currentStep + 1);
|
|
17
|
+
}
|
|
18
|
+
}, [currentStep, setCurrentStep]);
|
|
19
|
+
const previousStep = useCallback(() => {
|
|
20
|
+
if (currentStep > 0) {
|
|
21
|
+
setCurrentStep(currentStep - 1);
|
|
22
|
+
}
|
|
23
|
+
}, [currentStep, setCurrentStep]);
|
|
24
|
+
const uploadDocument = useCallback(async (document) => {
|
|
25
|
+
try {
|
|
26
|
+
setProcessing(true);
|
|
27
|
+
setError(null);
|
|
28
|
+
// Ajouter le document au store
|
|
29
|
+
addDocument({
|
|
30
|
+
id: document.id,
|
|
31
|
+
type: document.type,
|
|
32
|
+
imageUri: document.imageUri,
|
|
33
|
+
uploadedAt: document.uploadedAt,
|
|
34
|
+
validated: false
|
|
35
|
+
});
|
|
36
|
+
// Ici vous pourriez appeler l'API pour valider le document
|
|
37
|
+
// const kycService = new KYCService(apiBaseUrl, apiKey);
|
|
38
|
+
// const validation = await kycService.validateDocument(document.imageUri, document.type);
|
|
39
|
+
setProcessing(false);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
setProcessing(false);
|
|
43
|
+
setError('Erreur lors de l\'upload du document');
|
|
44
|
+
}
|
|
45
|
+
}, [addDocument, setProcessing, setError]);
|
|
46
|
+
const captureSelfie = useCallback(async (selfie) => {
|
|
47
|
+
try {
|
|
48
|
+
setProcessing(true);
|
|
49
|
+
setError(null);
|
|
50
|
+
// Ajouter la selfie au store
|
|
51
|
+
setSelfie(selfie.imageUri);
|
|
52
|
+
setProcessing(false);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
setProcessing(false);
|
|
56
|
+
setError('Erreur lors de la capture de la selfie');
|
|
57
|
+
}
|
|
58
|
+
}, [setSelfie, setProcessing, setError]);
|
|
59
|
+
const submitVerification = useCallback(async () => {
|
|
60
|
+
try {
|
|
61
|
+
setProcessing(true);
|
|
62
|
+
setError(null);
|
|
63
|
+
if (!currentSession) {
|
|
64
|
+
throw new Error('Aucune session KYC active');
|
|
65
|
+
}
|
|
66
|
+
// Ici vous appelleriez l'API pour soumettre la vérification complète
|
|
67
|
+
// const kycService = new KYCService(apiBaseUrl, apiKey);
|
|
68
|
+
// const response = await kycService.submitKYC({
|
|
69
|
+
// userId: currentSession.userId,
|
|
70
|
+
// documentImage: currentSession.documents[0]?.imageUri,
|
|
71
|
+
// selfieImage: currentSession.selfie?.imageUri,
|
|
72
|
+
// documentType: currentSession.documents[0]?.type
|
|
73
|
+
// });
|
|
74
|
+
// Mettre à jour la session
|
|
75
|
+
updateSession({
|
|
76
|
+
status: 'completed',
|
|
77
|
+
// completedAt: new Date()
|
|
78
|
+
});
|
|
79
|
+
setProcessing(false);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
setProcessing(false);
|
|
83
|
+
setError('Erreur lors de la soumission de la vérification');
|
|
84
|
+
}
|
|
85
|
+
}, [currentSession, setProcessing, setError, updateSession]);
|
|
86
|
+
const resetSession = useCallback(() => {
|
|
87
|
+
clearSession();
|
|
88
|
+
}, [clearSession]);
|
|
89
|
+
return {
|
|
90
|
+
session: currentSession,
|
|
91
|
+
currentStep,
|
|
92
|
+
isProcessing,
|
|
93
|
+
error,
|
|
94
|
+
startSession,
|
|
95
|
+
nextStep,
|
|
96
|
+
previousStep,
|
|
97
|
+
uploadDocument,
|
|
98
|
+
captureSelfie,
|
|
99
|
+
submitVerification,
|
|
100
|
+
resetSession
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=useKYC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKYC.js","sourceRoot":"","sources":["../../src/hooks/useKYC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE;IACzB,MAAM,EACJ,cAAc,EACd,WAAW,EACX,YAAY,EACZ,KAAK,EACL,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,SAAS,EACT,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,aAAa,EACd,GAAG,WAAW,EAAE,CAAC;IAElB,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,MAAc,EAAE,EAAE;QAClD,IAAI,CAAC;YACH,iBAAiB,CAAC,MAAM,CAAC,CAAC;YAC1B,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,uCAAuC,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,CAAC;IAElC,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;QAChC,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;YACpB,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;IAElC,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;YACpB,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;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I,CAAC,CAAC;YACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;YAEf,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YAC/C,CAAC;YAED,qEAAqE;YACrE,yDAAyD;YACzD,gDAAgD;YAChD,mCAAmC;YACnC,0DAA0D;YAC1D,kDAAkD;YAClD,oDAAoD;YACpD,MAAM;YAEN,2BAA2B;YAC3B,aAAa,CAAC;gBACZ,MAAM,EAAE,WAAW;gBACnB,0BAA0B;aAC3B,CAAC,CAAC;YAEH,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,aAAa,CAAC,KAAK,CAAC,CAAC;YACrB,QAAQ,CAAC,iDAAiD,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAE7D,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,YAAY,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO;QACL,OAAO,EAAE,cAAc;QACvB,WAAW;QACX,YAAY;QACZ,KAAK;QACL,YAAY;QACZ,QAAQ;QACR,YAAY;QACZ,cAAc;QACd,aAAa;QACb,kBAAkB;QAClB,YAAY;KACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useCallback } from 'react';\nimport { useKYCStore } from '../stores/kycStore';\n// import { KYCService } from '../modules/api/KYCService';\nimport { Document, Selfie } from '../types/KYC.types';\n\nexport const useKYC = () => {\n const {\n currentSession,\n currentStep,\n isProcessing,\n error,\n initializeSession,\n setCurrentStep,\n addDocument,\n setSelfie,\n setProcessing,\n setError,\n clearSession,\n updateSession\n } = useKYCStore();\n\n const startSession = useCallback((userId: string) => {\n try {\n initializeSession(userId);\n setError(null);\n } catch (error) {\n setError('Impossible de démarrer la session KYC');\n }\n }, [initializeSession, setError]);\n\n const nextStep = useCallback(() => {\n if (currentStep < 4) {\n setCurrentStep(currentStep + 1);\n }\n }, [currentStep, setCurrentStep]);\n\n const previousStep = useCallback(() => {\n if (currentStep > 0) {\n setCurrentStep(currentStep - 1);\n }\n }, [currentStep, setCurrentStep]);\n\n const uploadDocument = useCallback(async (document: Document) => {\n try {\n setProcessing(true);\n setError(null);\n\n // Ajouter le document au store\n addDocument({\n id: document.id,\n type: document.type,\n imageUri: document.imageUri,\n uploadedAt: document.uploadedAt,\n validated: false\n });\n\n // Ici vous pourriez appeler l'API pour valider le document\n // const kycService = new KYCService(apiBaseUrl, apiKey);\n // const validation = await kycService.validateDocument(document.imageUri, document.type);\n\n setProcessing(false);\n } catch (error) {\n setProcessing(false);\n setError('Erreur lors de l\\'upload du document');\n }\n }, [addDocument, setProcessing, setError]);\n\n const captureSelfie = useCallback(async (selfie: Selfie) => {\n try {\n setProcessing(true);\n setError(null);\n\n // Ajouter la selfie au store\n setSelfie(selfie.imageUri);\n\n setProcessing(false);\n } catch (error) {\n setProcessing(false);\n setError('Erreur lors de la capture de la selfie');\n }\n }, [setSelfie, setProcessing, setError]);\n\n const submitVerification = useCallback(async () => {\n try {\n setProcessing(true);\n setError(null);\n\n if (!currentSession) {\n throw new Error('Aucune session KYC active');\n }\n\n // Ici vous appelleriez l'API pour soumettre la vérification complète\n // const kycService = new KYCService(apiBaseUrl, apiKey);\n // const response = await kycService.submitKYC({\n // userId: currentSession.userId,\n // documentImage: currentSession.documents[0]?.imageUri,\n // selfieImage: currentSession.selfie?.imageUri,\n // documentType: currentSession.documents[0]?.type\n // });\n\n // Mettre à jour la session\n updateSession({\n status: 'completed',\n // completedAt: new Date()\n });\n\n setProcessing(false);\n } catch (error) {\n setProcessing(false);\n setError('Erreur lors de la soumission de la vérification');\n }\n }, [currentSession, setProcessing, setError, updateSession]);\n\n const resetSession = useCallback(() => {\n clearSession();\n }, [clearSession]);\n\n return {\n session: currentSession,\n currentStep,\n isProcessing,\n error,\n startSession,\n nextStep,\n previousStep,\n uploadDocument,\n captureSelfie,\n submitVerification,\n resetSession\n };\n}; "]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKYCFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useKYCFlow.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,UAAU,QAAO,gBA+O7B,CAAC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
2
|
+
export const useKYCFlow = () => {
|
|
3
|
+
const [state, setState] = useState({
|
|
4
|
+
config: {
|
|
5
|
+
id: '',
|
|
6
|
+
name: '',
|
|
7
|
+
description: '',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
elements: [],
|
|
10
|
+
settings: {
|
|
11
|
+
allowBackNavigation: true,
|
|
12
|
+
showProgressBar: true,
|
|
13
|
+
showStepNumbers: true,
|
|
14
|
+
autoAdvance: false,
|
|
15
|
+
enableRetry: true,
|
|
16
|
+
maxRetries: 3,
|
|
17
|
+
},
|
|
18
|
+
styling: {
|
|
19
|
+
primaryColor: '#4CAF50',
|
|
20
|
+
secondaryColor: '#2196F3',
|
|
21
|
+
backgroundColor: '#f8f9fa',
|
|
22
|
+
textColor: '#333',
|
|
23
|
+
borderRadius: 8,
|
|
24
|
+
},
|
|
25
|
+
localization: {
|
|
26
|
+
language: 'fr',
|
|
27
|
+
translations: {},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
currentElementIndex: 0,
|
|
31
|
+
completedElements: [],
|
|
32
|
+
elementData: {},
|
|
33
|
+
errors: {},
|
|
34
|
+
isProcessing: false,
|
|
35
|
+
});
|
|
36
|
+
// Élément actuel
|
|
37
|
+
const currentElement = useMemo(() => {
|
|
38
|
+
if (state.config.elements.length === 0)
|
|
39
|
+
return null;
|
|
40
|
+
return state.config.elements[state.currentElementIndex] || null;
|
|
41
|
+
}, [state.config.elements, state.currentElementIndex]);
|
|
42
|
+
// Progression
|
|
43
|
+
const progress = useMemo(() => {
|
|
44
|
+
if (state.config.elements.length === 0)
|
|
45
|
+
return 0;
|
|
46
|
+
return (state.currentElementIndex / (state.config.elements.length - 1)) * 100;
|
|
47
|
+
}, [state.currentElementIndex, state.config.elements.length]);
|
|
48
|
+
// Navigation - validation simple sans dépendances complexes
|
|
49
|
+
const canGoNext = useMemo(() => {
|
|
50
|
+
if (!currentElement)
|
|
51
|
+
return false;
|
|
52
|
+
if (state.isProcessing)
|
|
53
|
+
return false;
|
|
54
|
+
// Validation simple
|
|
55
|
+
const data = state.elementData[currentElement.id];
|
|
56
|
+
const validation = currentElement.validation;
|
|
57
|
+
if (validation?.required && (!data || (typeof data === 'string' && data.trim() === ''))) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return state.currentElementIndex < state.config.elements.length - 1;
|
|
61
|
+
}, [currentElement, state.isProcessing, state.currentElementIndex, state.config.elements.length, state.elementData]);
|
|
62
|
+
const canGoPrevious = useMemo(() => {
|
|
63
|
+
return state.config.settings.allowBackNavigation &&
|
|
64
|
+
state.currentElementIndex > 0 &&
|
|
65
|
+
!state.isProcessing;
|
|
66
|
+
}, [state.config.settings.allowBackNavigation, state.currentElementIndex, state.isProcessing]);
|
|
67
|
+
const isComplete = useMemo(() => {
|
|
68
|
+
return state.currentElementIndex === state.config.elements.length - 1 &&
|
|
69
|
+
state.completedElements.length === state.config.elements.length;
|
|
70
|
+
}, [state.currentElementIndex, state.config.elements.length, state.completedElements.length]);
|
|
71
|
+
// Actions
|
|
72
|
+
const actions = {
|
|
73
|
+
initializeFlow: useCallback((config) => {
|
|
74
|
+
setState({
|
|
75
|
+
config,
|
|
76
|
+
currentElementIndex: 0,
|
|
77
|
+
completedElements: [],
|
|
78
|
+
elementData: {},
|
|
79
|
+
errors: {},
|
|
80
|
+
isProcessing: false,
|
|
81
|
+
});
|
|
82
|
+
}, []),
|
|
83
|
+
nextElement: useCallback(() => {
|
|
84
|
+
const currentEl = currentElement;
|
|
85
|
+
if (currentEl) {
|
|
86
|
+
setState(prev => ({
|
|
87
|
+
...prev,
|
|
88
|
+
completedElements: [...prev.completedElements, currentEl.id],
|
|
89
|
+
currentElementIndex: prev.currentElementIndex + 1,
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
}, [currentElement]),
|
|
93
|
+
previousElement: useCallback(() => {
|
|
94
|
+
setState(prev => ({
|
|
95
|
+
...prev,
|
|
96
|
+
currentElementIndex: prev.currentElementIndex - 1,
|
|
97
|
+
}));
|
|
98
|
+
}, []),
|
|
99
|
+
goToElement: useCallback((elementId) => {
|
|
100
|
+
const elementIndex = state.config.elements.findIndex(el => el.id === elementId);
|
|
101
|
+
if (elementIndex !== -1) {
|
|
102
|
+
setState(prev => ({
|
|
103
|
+
...prev,
|
|
104
|
+
currentElementIndex: elementIndex,
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
}, [state.config.elements]),
|
|
108
|
+
updateElementData: useCallback((elementId, data) => {
|
|
109
|
+
setState(prev => ({
|
|
110
|
+
...prev,
|
|
111
|
+
elementData: { ...prev.elementData, [elementId]: data },
|
|
112
|
+
}));
|
|
113
|
+
}, []),
|
|
114
|
+
validateElement: useCallback((elementId) => {
|
|
115
|
+
const element = state.config.elements.find(el => el.id === elementId);
|
|
116
|
+
if (!element)
|
|
117
|
+
return false;
|
|
118
|
+
const data = state.elementData[elementId];
|
|
119
|
+
const validation = element.validation;
|
|
120
|
+
if (!validation)
|
|
121
|
+
return true;
|
|
122
|
+
// Validation requise
|
|
123
|
+
if (validation.required && (!data || (typeof data === 'string' && data.trim() === ''))) {
|
|
124
|
+
setState(prev => ({
|
|
125
|
+
...prev,
|
|
126
|
+
errors: { ...prev.errors, [elementId]: 'Ce champ est requis' }
|
|
127
|
+
}));
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
// Validation de longueur
|
|
131
|
+
if (validation.minLength && data && data.length < validation.minLength) {
|
|
132
|
+
setState(prev => ({
|
|
133
|
+
...prev,
|
|
134
|
+
errors: { ...prev.errors, [elementId]: `Minimum ${validation.minLength} caractères` }
|
|
135
|
+
}));
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
if (validation.maxLength && data && data.length > validation.maxLength) {
|
|
139
|
+
setState(prev => ({
|
|
140
|
+
...prev,
|
|
141
|
+
errors: { ...prev.errors, [elementId]: `Maximum ${validation.maxLength} caractères` }
|
|
142
|
+
}));
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
// Validation par pattern
|
|
146
|
+
if (validation.pattern && data && !new RegExp(validation.pattern).test(data)) {
|
|
147
|
+
setState(prev => ({
|
|
148
|
+
...prev,
|
|
149
|
+
errors: { ...prev.errors, [elementId]: 'Format invalide' }
|
|
150
|
+
}));
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
// Validation personnalisée
|
|
154
|
+
if (validation.customValidator && data) {
|
|
155
|
+
const result = validation.customValidator(data);
|
|
156
|
+
if (typeof result === 'string') {
|
|
157
|
+
setState(prev => ({
|
|
158
|
+
...prev,
|
|
159
|
+
errors: { ...prev.errors, [elementId]: result }
|
|
160
|
+
}));
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
if (!result) {
|
|
164
|
+
setState(prev => ({
|
|
165
|
+
...prev,
|
|
166
|
+
errors: { ...prev.errors, [elementId]: 'Validation échouée' }
|
|
167
|
+
}));
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Effacer l'erreur si la validation réussit
|
|
172
|
+
if (state.errors[elementId]) {
|
|
173
|
+
const newErrors = { ...state.errors };
|
|
174
|
+
delete newErrors[elementId];
|
|
175
|
+
setState(prev => ({
|
|
176
|
+
...prev,
|
|
177
|
+
errors: newErrors
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
return true;
|
|
181
|
+
}, [state.config.elements, state.elementData, state.errors]),
|
|
182
|
+
submitFlow: useCallback(async () => {
|
|
183
|
+
setState(prev => ({ ...prev, isProcessing: true }));
|
|
184
|
+
try {
|
|
185
|
+
console.log('Submitting KYC flow:', state.elementData);
|
|
186
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
187
|
+
setState(prev => ({
|
|
188
|
+
...prev,
|
|
189
|
+
isProcessing: false,
|
|
190
|
+
}));
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
setState(prev => ({
|
|
194
|
+
...prev,
|
|
195
|
+
isProcessing: false,
|
|
196
|
+
errors: { ...prev.errors, submit: 'Erreur lors de la soumission' }
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
}, [state.elementData]),
|
|
200
|
+
resetFlow: useCallback(() => {
|
|
201
|
+
setState(prev => ({
|
|
202
|
+
...prev,
|
|
203
|
+
currentElementIndex: 0,
|
|
204
|
+
completedElements: [],
|
|
205
|
+
elementData: {},
|
|
206
|
+
errors: {},
|
|
207
|
+
isProcessing: false,
|
|
208
|
+
}));
|
|
209
|
+
}, []),
|
|
210
|
+
};
|
|
211
|
+
return {
|
|
212
|
+
state,
|
|
213
|
+
actions,
|
|
214
|
+
currentElement,
|
|
215
|
+
progress,
|
|
216
|
+
canGoNext,
|
|
217
|
+
canGoPrevious,
|
|
218
|
+
isComplete,
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
//# sourceMappingURL=useKYCFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKYCFlow.js","sourceRoot":"","sources":["../../src/hooks/useKYCFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQvD,MAAM,CAAC,MAAM,UAAU,GAAG,GAAqB,EAAE;IAC/C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe;QA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AAC,CAAC;QACN,CAAC,EAAE,EAAE,CAAC;KACP,CAAC;IAEF,OAAO;QACL,KAAK;QACL,OAAO;QACP,cAAc;QACd,QAAQ;QACR,SAAS;QACT,aAAa;QACb,UAAU;KACX,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useState, useCallback, useMemo } from 'react';\nimport {\n KYCFlowConfig,\n KYCFlowState,\n KYCFlowActions,\n UseKYCFlowReturn\n} from '../types/KYC.types';\n\nexport const useKYCFlow = (): UseKYCFlowReturn => {\n const [state, setState] = useState<KYCFlowState>({\n config: {\n id: '',\n name: '',\n description: '',\n version: '1.0.0',\n elements: [],\n settings: {\n allowBackNavigation: true,\n showProgressBar: true,\n showStepNumbers: true,\n autoAdvance: false,\n enableRetry: true,\n maxRetries: 3,\n },\n styling: {\n primaryColor: '#4CAF50',\n secondaryColor: '#2196F3',\n backgroundColor: '#f8f9fa',\n textColor: '#333',\n borderRadius: 8,\n },\n localization: {\n language: 'fr',\n translations: {},\n },\n },\n currentElementIndex: 0,\n completedElements: [],\n elementData: {},\n errors: {},\n isProcessing: false,\n });\n\n // Élément actuel\n const currentElement = useMemo(() => {\n if (state.config.elements.length === 0) return null;\n return state.config.elements[state.currentElementIndex] || null;\n }, [state.config.elements, state.currentElementIndex]);\n\n // Progression\n const progress = useMemo(() => {\n if (state.config.elements.length === 0) return 0;\n return (state.currentElementIndex / (state.config.elements.length - 1)) * 100;\n }, [state.currentElementIndex, state.config.elements.length]);\n\n // Navigation - validation simple sans dépendances complexes\n const canGoNext = useMemo(() => {\n if (!currentElement) return false;\n if (state.isProcessing) return false;\n \n // Validation simple\n const data = state.elementData[currentElement.id];\n const validation = currentElement.validation;\n \n if (validation?.required && (!data || (typeof data === 'string' && data.trim() === ''))) {\n return false;\n }\n \n return state.currentElementIndex < state.config.elements.length - 1;\n }, [currentElement, state.isProcessing, state.currentElementIndex, state.config.elements.length, state.elementData]);\n\n const canGoPrevious = useMemo(() => {\n return state.config.settings.allowBackNavigation && \n state.currentElementIndex > 0 && \n !state.isProcessing;\n }, [state.config.settings.allowBackNavigation, state.currentElementIndex, state.isProcessing]);\n\n const isComplete = useMemo(() => {\n return state.currentElementIndex === state.config.elements.length - 1 &&\n state.completedElements.length === state.config.elements.length;\n }, [state.currentElementIndex, state.config.elements.length, state.completedElements.length]);\n\n // Actions\n const actions: KYCFlowActions = {\n initializeFlow: useCallback((config: KYCFlowConfig) => {\n setState({\n config,\n currentElementIndex: 0,\n completedElements: [],\n elementData: {},\n errors: {},\n isProcessing: false,\n });\n }, []),\n\n nextElement: useCallback(() => {\n const currentEl = currentElement;\n if (currentEl) {\n setState(prev => ({\n ...prev,\n completedElements: [...prev.completedElements, currentEl.id],\n currentElementIndex: prev.currentElementIndex + 1,\n }));\n }\n }, [currentElement]),\n\n previousElement: useCallback(() => {\n setState(prev => ({\n ...prev,\n currentElementIndex: prev.currentElementIndex - 1,\n }));\n }, []),\n\n goToElement: useCallback((elementId: string) => {\n const elementIndex = state.config.elements.findIndex(el => el.id === elementId);\n if (elementIndex !== -1) {\n setState(prev => ({\n ...prev,\n currentElementIndex: elementIndex,\n }));\n }\n }, [state.config.elements]),\n\n updateElementData: useCallback((elementId: string, data: any) => {\n setState(prev => ({\n ...prev,\n elementData: { ...prev.elementData, [elementId]: data },\n }));\n }, []),\n\n validateElement: useCallback((elementId: string) => {\n const element = state.config.elements.find(el => el.id === elementId);\n if (!element) return false;\n\n const data = state.elementData[elementId];\n const validation = element.validation;\n\n if (!validation) return true;\n\n // Validation requise\n if (validation.required && (!data || (typeof data === 'string' && data.trim() === ''))) {\n setState(prev => ({\n ...prev,\n errors: { ...prev.errors, [elementId]: 'Ce champ est requis' }\n }));\n return false;\n }\n\n // Validation de longueur\n if (validation.minLength && data && data.length < validation.minLength) {\n setState(prev => ({\n ...prev,\n errors: { ...prev.errors, [elementId]: `Minimum ${validation.minLength} caractères` }\n }));\n return false;\n }\n\n if (validation.maxLength && data && data.length > validation.maxLength) {\n setState(prev => ({\n ...prev,\n errors: { ...prev.errors, [elementId]: `Maximum ${validation.maxLength} caractères` }\n }));\n return false;\n }\n\n // Validation par pattern\n if (validation.pattern && data && !new RegExp(validation.pattern).test(data)) {\n setState(prev => ({\n ...prev,\n errors: { ...prev.errors, [elementId]: 'Format invalide' }\n }));\n return false;\n }\n\n // Validation personnalisée\n if (validation.customValidator && data) {\n const result = validation.customValidator(data);\n if (typeof result === 'string') {\n setState(prev => ({\n ...prev,\n errors: { ...prev.errors, [elementId]: result }\n }));\n return false;\n }\n if (!result) {\n setState(prev => ({\n ...prev,\n errors: { ...prev.errors, [elementId]: 'Validation échouée' }\n }));\n return false;\n }\n }\n\n // Effacer l'erreur si la validation réussit\n if (state.errors[elementId]) {\n const newErrors = { ...state.errors };\n delete newErrors[elementId];\n setState(prev => ({\n ...prev,\n errors: newErrors\n }));\n }\n\n return true;\n }, [state.config.elements, state.elementData, state.errors]),\n\n submitFlow: useCallback(async () => {\n setState(prev => ({ ...prev, isProcessing: true }));\n\n try {\n console.log('Submitting KYC flow:', state.elementData);\n await new Promise(resolve => setTimeout(resolve, 2000));\n \n setState(prev => ({\n ...prev,\n isProcessing: false,\n }));\n } catch (error) {\n setState(prev => ({\n ...prev,\n isProcessing: false,\n errors: { ...prev.errors, submit: 'Erreur lors de la soumission' }\n }));\n }\n }, [state.elementData]),\n\n resetFlow: useCallback(() => {\n setState(prev => ({\n ...prev,\n currentElementIndex: 0,\n completedElements: [],\n elementData: {},\n errors: {},\n isProcessing: false,\n }));\n }, []),\n };\n\n return {\n state,\n actions,\n currentElement,\n progress,\n canGoNext,\n canGoPrevious,\n isComplete,\n };\n}; "]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface LocationData {
|
|
2
|
+
latitude: number;
|
|
3
|
+
longitude: number;
|
|
4
|
+
accuracy: number | null;
|
|
5
|
+
altitude: number | null;
|
|
6
|
+
heading: number | null;
|
|
7
|
+
speed: number | null;
|
|
8
|
+
timestamp: number;
|
|
9
|
+
}
|
|
10
|
+
export interface LocationError {
|
|
11
|
+
code: string;
|
|
12
|
+
message: string;
|
|
13
|
+
}
|
|
14
|
+
export interface UseLocationOptions {
|
|
15
|
+
enableHighAccuracy?: boolean;
|
|
16
|
+
timeInterval?: number;
|
|
17
|
+
distanceInterval?: number;
|
|
18
|
+
requestPermissions?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface UseLocationReturn {
|
|
21
|
+
location: LocationData | null;
|
|
22
|
+
error: LocationError | null;
|
|
23
|
+
loading: boolean;
|
|
24
|
+
requestPermission: () => Promise<boolean>;
|
|
25
|
+
getCurrentLocation: () => Promise<LocationData | null>;
|
|
26
|
+
startLocationUpdates: () => Promise<void>;
|
|
27
|
+
stopLocationUpdates: () => void;
|
|
28
|
+
hasPermission: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare const useLocation: (options?: UseLocationOptions) => UseLocationReturn;
|
|
31
|
+
export default useLocation;
|
|
32
|
+
//# sourceMappingURL=useLocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocation.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocation.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACvD,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,WAAW,GAAI,UAAS,kBAAuB,KAAG,iBAsLvD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import * as Location from 'expo-location';
|
|
3
|
+
const useLocation = (options = {}) => {
|
|
4
|
+
const { enableHighAccuracy = true, timeInterval = 10000, distanceInterval = 10, requestPermissions = true, } = options;
|
|
5
|
+
const [location, setLocation] = useState(null);
|
|
6
|
+
const [error, setError] = useState(null);
|
|
7
|
+
const [loading, setLoading] = useState(false);
|
|
8
|
+
const [hasPermission, setHasPermission] = useState(false);
|
|
9
|
+
const [locationSubscription, setLocationSubscription] = useState(null);
|
|
10
|
+
// Check and request permissions
|
|
11
|
+
const checkPermissions = useCallback(async () => {
|
|
12
|
+
try {
|
|
13
|
+
const { status } = await Location.getForegroundPermissionsAsync();
|
|
14
|
+
const hasPermission = status === Location.PermissionStatus.GRANTED;
|
|
15
|
+
setHasPermission(hasPermission);
|
|
16
|
+
return hasPermission;
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
console.error('Error checking location permissions:', err);
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
const requestPermission = useCallback(async () => {
|
|
24
|
+
try {
|
|
25
|
+
setLoading(true);
|
|
26
|
+
setError(null);
|
|
27
|
+
const { status } = await Location.requestForegroundPermissionsAsync();
|
|
28
|
+
const hasPermission = status === Location.PermissionStatus.GRANTED;
|
|
29
|
+
setHasPermission(hasPermission);
|
|
30
|
+
if (!hasPermission) {
|
|
31
|
+
setError({
|
|
32
|
+
code: 'PERMISSION_DENIED',
|
|
33
|
+
message: 'Location permission denied',
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return hasPermission;
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
const errorMessage = err instanceof Error ? err.message : 'Unknown error';
|
|
40
|
+
setError({
|
|
41
|
+
code: 'PERMISSION_ERROR',
|
|
42
|
+
message: errorMessage,
|
|
43
|
+
});
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
setLoading(false);
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
// Get current location once
|
|
51
|
+
const getCurrentLocation = useCallback(async () => {
|
|
52
|
+
try {
|
|
53
|
+
setLoading(true);
|
|
54
|
+
setError(null);
|
|
55
|
+
if (!hasPermission) {
|
|
56
|
+
const permissionGranted = await requestPermission();
|
|
57
|
+
if (!permissionGranted) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const currentLocation = await Location.getCurrentPositionAsync({
|
|
62
|
+
accuracy: enableHighAccuracy ? Location.Accuracy.High : Location.Accuracy.Balanced,
|
|
63
|
+
});
|
|
64
|
+
const locationData = {
|
|
65
|
+
latitude: currentLocation.coords.latitude,
|
|
66
|
+
longitude: currentLocation.coords.longitude,
|
|
67
|
+
accuracy: currentLocation.coords.accuracy,
|
|
68
|
+
altitude: currentLocation.coords.altitude,
|
|
69
|
+
heading: currentLocation.coords.heading,
|
|
70
|
+
speed: currentLocation.coords.speed,
|
|
71
|
+
timestamp: currentLocation.timestamp,
|
|
72
|
+
};
|
|
73
|
+
setLocation(locationData);
|
|
74
|
+
return locationData;
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
const errorMessage = err instanceof Error ? err.message : 'Unknown error';
|
|
78
|
+
setError({
|
|
79
|
+
code: 'LOCATION_ERROR',
|
|
80
|
+
message: errorMessage,
|
|
81
|
+
});
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
setLoading(false);
|
|
86
|
+
}
|
|
87
|
+
}, [hasPermission, enableHighAccuracy, requestPermission]);
|
|
88
|
+
// Start continuous location updates
|
|
89
|
+
const startLocationUpdates = useCallback(async () => {
|
|
90
|
+
try {
|
|
91
|
+
setLoading(true);
|
|
92
|
+
setError(null);
|
|
93
|
+
if (!hasPermission) {
|
|
94
|
+
const permissionGranted = await requestPermission();
|
|
95
|
+
if (!permissionGranted) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Stop any existing subscription
|
|
100
|
+
if (locationSubscription) {
|
|
101
|
+
locationSubscription.remove();
|
|
102
|
+
}
|
|
103
|
+
const subscription = await Location.watchPositionAsync({
|
|
104
|
+
accuracy: enableHighAccuracy ? Location.Accuracy.High : Location.Accuracy.Balanced,
|
|
105
|
+
timeInterval,
|
|
106
|
+
distanceInterval,
|
|
107
|
+
}, (newLocation) => {
|
|
108
|
+
const locationData = {
|
|
109
|
+
latitude: newLocation.coords.latitude,
|
|
110
|
+
longitude: newLocation.coords.longitude,
|
|
111
|
+
accuracy: newLocation.coords.accuracy,
|
|
112
|
+
altitude: newLocation.coords.altitude,
|
|
113
|
+
heading: newLocation.coords.heading,
|
|
114
|
+
speed: newLocation.coords.speed,
|
|
115
|
+
timestamp: newLocation.timestamp,
|
|
116
|
+
};
|
|
117
|
+
setLocation(locationData);
|
|
118
|
+
});
|
|
119
|
+
setLocationSubscription(subscription);
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
const errorMessage = err instanceof Error ? err.message : 'Unknown error';
|
|
123
|
+
setError({
|
|
124
|
+
code: 'LOCATION_UPDATE_ERROR',
|
|
125
|
+
message: errorMessage,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
finally {
|
|
129
|
+
setLoading(false);
|
|
130
|
+
}
|
|
131
|
+
}, [hasPermission, enableHighAccuracy, timeInterval, distanceInterval, requestPermission, locationSubscription]);
|
|
132
|
+
// Stop location updates
|
|
133
|
+
const stopLocationUpdates = useCallback(() => {
|
|
134
|
+
if (locationSubscription) {
|
|
135
|
+
locationSubscription.remove();
|
|
136
|
+
setLocationSubscription(null);
|
|
137
|
+
}
|
|
138
|
+
}, [locationSubscription]);
|
|
139
|
+
// Initialize permissions on mount
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
if (requestPermissions) {
|
|
142
|
+
checkPermissions();
|
|
143
|
+
}
|
|
144
|
+
}, [requestPermissions, checkPermissions]);
|
|
145
|
+
// Cleanup subscription on unmount
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
return () => {
|
|
148
|
+
if (locationSubscription) {
|
|
149
|
+
locationSubscription.remove();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}, [locationSubscription]);
|
|
153
|
+
return {
|
|
154
|
+
location,
|
|
155
|
+
error,
|
|
156
|
+
loading,
|
|
157
|
+
requestPermission,
|
|
158
|
+
getCurrentLocation,
|
|
159
|
+
startLocationUpdates,
|
|
160
|
+
stopLocationUpdates,
|
|
161
|
+
hasPermission,
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
export default useLocation;
|
|
165
|
+
//# sourceMappingURL=useLocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocation.js","sourceRoot":"","sources":["../../src/hooks/useLocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,QAAQ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iBAAiB,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAEjH,wBAAwB;IACxB,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC3C,IAAI,oBAAoB,EAAE,CAAC;YACzB,oBAAoB,CAAC,MAAM,EAAE,CAAC;YAC9B,uBAAuB,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAE3B,kCAAkC;IAClC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,kBAAkB,EAAE,CAAC;YACvB,gBAAgB,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAE3C,kCAAkC;IAClC,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,IAAI,oBAAoB,EAAE,CAAC;gBACzB,oBAAoB,CAAC,MAAM,EAAE,CAAC;YAChC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAE3B,OAAO;QACL,QAAQ;QACR,KAAK;QACL,OAAO;QACP,iBAAiB;QACjB,kBAAkB;QAClB,oBAAoB;QACpB,mBAAmB;QACnB,aAAa;KACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { useState, useEffect, useCallback } from 'react';\nimport * as Location from 'expo-location';\n\nexport interface LocationData {\n latitude: number;\n longitude: number;\n accuracy: number | null;\n altitude: number | null;\n heading: number | null;\n speed: number | null;\n timestamp: number;\n}\n\nexport interface LocationError {\n code: string;\n message: string;\n}\n\nexport interface UseLocationOptions {\n enableHighAccuracy?: boolean;\n timeInterval?: number;\n distanceInterval?: number;\n requestPermissions?: boolean;\n}\n\nexport interface UseLocationReturn {\n location: LocationData | null;\n error: LocationError | null;\n loading: boolean;\n requestPermission: () => Promise<boolean>;\n getCurrentLocation: () => Promise<LocationData | null>;\n startLocationUpdates: () => Promise<void>;\n stopLocationUpdates: () => void;\n hasPermission: boolean;\n}\n\nconst useLocation = (options: UseLocationOptions = {}): UseLocationReturn => {\n const {\n enableHighAccuracy = true,\n timeInterval = 10000,\n distanceInterval = 10,\n requestPermissions = true,\n } = options;\n\n const [location, setLocation] = useState<LocationData | null>(null);\n const [error, setError] = useState<LocationError | null>(null);\n const [loading, setLoading] = useState(false);\n const [hasPermission, setHasPermission] = useState(false);\n const [locationSubscription, setLocationSubscription] = useState<Location.LocationSubscription | null>(null);\n\n // Check and request permissions\n const checkPermissions = useCallback(async () => {\n try {\n const { status } = await Location.getForegroundPermissionsAsync();\n const hasPermission = status === Location.PermissionStatus.GRANTED;\n setHasPermission(hasPermission);\n return hasPermission;\n } catch (err) {\n console.error('Error checking location permissions:', err);\n return false;\n }\n }, []);\n\n const requestPermission = useCallback(async (): Promise<boolean> => {\n try {\n setLoading(true);\n setError(null);\n \n const { status } = await Location.requestForegroundPermissionsAsync();\n const hasPermission = status === Location.PermissionStatus.GRANTED;\n \n setHasPermission(hasPermission);\n \n if (!hasPermission) {\n setError({\n code: 'PERMISSION_DENIED',\n message: 'Location permission denied',\n });\n }\n \n return hasPermission;\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'Unknown error';\n setError({\n code: 'PERMISSION_ERROR',\n message: errorMessage,\n });\n return false;\n } finally {\n setLoading(false);\n }\n }, []);\n\n // Get current location once\n const getCurrentLocation = useCallback(async (): Promise<LocationData | null> => {\n try {\n setLoading(true);\n setError(null);\n\n if (!hasPermission) {\n const permissionGranted = await requestPermission();\n if (!permissionGranted) {\n return null;\n }\n }\n\n const currentLocation = await Location.getCurrentPositionAsync({\n accuracy: enableHighAccuracy ? Location.Accuracy.High : Location.Accuracy.Balanced,\n });\n\n const locationData: LocationData = {\n latitude: currentLocation.coords.latitude,\n longitude: currentLocation.coords.longitude,\n accuracy: currentLocation.coords.accuracy,\n altitude: currentLocation.coords.altitude,\n heading: currentLocation.coords.heading,\n speed: currentLocation.coords.speed,\n timestamp: currentLocation.timestamp,\n };\n\n setLocation(locationData);\n return locationData;\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'Unknown error';\n setError({\n code: 'LOCATION_ERROR',\n message: errorMessage,\n });\n return null;\n } finally {\n setLoading(false);\n }\n }, [hasPermission, enableHighAccuracy, requestPermission]);\n\n // Start continuous location updates\n const startLocationUpdates = useCallback(async () => {\n try {\n setLoading(true);\n setError(null);\n\n if (!hasPermission) {\n const permissionGranted = await requestPermission();\n if (!permissionGranted) {\n return;\n }\n }\n\n // Stop any existing subscription\n if (locationSubscription) {\n locationSubscription.remove();\n }\n\n const subscription = await Location.watchPositionAsync(\n {\n accuracy: enableHighAccuracy ? Location.Accuracy.High : Location.Accuracy.Balanced,\n timeInterval,\n distanceInterval,\n },\n (newLocation) => {\n const locationData: LocationData = {\n latitude: newLocation.coords.latitude,\n longitude: newLocation.coords.longitude,\n accuracy: newLocation.coords.accuracy,\n altitude: newLocation.coords.altitude,\n heading: newLocation.coords.heading,\n speed: newLocation.coords.speed,\n timestamp: newLocation.timestamp,\n };\n setLocation(locationData);\n }\n );\n\n setLocationSubscription(subscription);\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'Unknown error';\n setError({\n code: 'LOCATION_UPDATE_ERROR',\n message: errorMessage,\n });\n } finally {\n setLoading(false);\n }\n }, [hasPermission, enableHighAccuracy, timeInterval, distanceInterval, requestPermission, locationSubscription]);\n\n // Stop location updates\n const stopLocationUpdates = useCallback(() => {\n if (locationSubscription) {\n locationSubscription.remove();\n setLocationSubscription(null);\n }\n }, [locationSubscription]);\n\n // Initialize permissions on mount\n useEffect(() => {\n if (requestPermissions) {\n checkPermissions();\n }\n }, [requestPermissions, checkPermissions]);\n\n // Cleanup subscription on unmount\n useEffect(() => {\n return () => {\n if (locationSubscription) {\n locationSubscription.remove();\n }\n };\n }, [locationSubscription]);\n\n return {\n location,\n error,\n loading,\n requestPermission,\n getCurrentLocation,\n startLocationUpdates,\n stopLocationUpdates,\n hasPermission,\n };\n};\n\nexport default useLocation; "]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OrientationVideoState, OrientationVideoActions, OrientationVideoConfig } from '../types/KYC.types';
|
|
2
|
+
import KYCService from '../modules/api/KYCService';
|
|
3
|
+
export interface UseOrientationVideoReturn {
|
|
4
|
+
state: OrientationVideoState;
|
|
5
|
+
actions: OrientationVideoActions;
|
|
6
|
+
config: OrientationVideoConfig;
|
|
7
|
+
}
|
|
8
|
+
export declare const useOrientationVideo: (kycService: KYCService, config?: Partial<OrientationVideoConfig>) => UseOrientationVideoReturn;
|
|
9
|
+
export default useOrientationVideo;
|
|
10
|
+
//# sourceMappingURL=useOrientationVideo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOrientationVideo.d.ts","sourceRoot":"","sources":["../../src/hooks/useOrientationVideo.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EAGvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,2BAA2B,CAAC;AAEnD,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,OAAO,EAAE,uBAAuB,CAAC;IACjC,MAAM,EAAE,sBAAsB,CAAC;CAChC;AAED,eAAO,MAAM,mBAAmB,GAC9B,YAAY,UAAU,EACtB,SAAS,OAAO,CAAC,sBAAsB,CAAC,KACvC,yBA8HF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|