@sanctum-key/react-native-sdk 1.0.50 → 1.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_file_paths.xml.flat +0 -0
  2. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -2
  3. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +1 -1
  4. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
  5. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +1 -1
  6. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +1 -1
  7. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +41 -41
  8. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  9. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  10. package/android/build/outputs/logs/manifest-merger-debug-report.txt +52 -52
  11. package/build/package.json +1 -1
  12. package/build/src/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  13. package/build/src/components/KYCElements/IDCardCapture.js +73 -66
  14. package/build/src/components/KYCElements/IDCardCapture.js.map +1 -1
  15. package/build/src/components/TemplateKYCExample.d.ts +2 -1
  16. package/build/src/components/TemplateKYCExample.d.ts.map +1 -1
  17. package/build/src/components/TemplateKYCExample.js +2 -2
  18. package/build/src/components/TemplateKYCExample.js.map +1 -1
  19. package/build/src/components/TemplateKYCFlowRefactored.d.ts +1 -0
  20. package/build/src/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
  21. package/build/src/components/TemplateKYCFlowRefactored.js +20 -14
  22. package/build/src/components/TemplateKYCFlowRefactored.js.map +1 -1
  23. package/build/src/config/KYCConfig.d.ts.map +1 -1
  24. package/build/src/config/KYCConfig.js +4 -2
  25. package/build/src/config/KYCConfig.js.map +1 -1
  26. package/build/src/hooks/useTemplateKYCFlow.d.ts +1 -0
  27. package/build/src/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  28. package/build/src/hooks/useTemplateKYCFlow.js.map +1 -1
  29. package/build/src/modules/api/CardAuthentification.d.ts +0 -23
  30. package/build/src/modules/api/CardAuthentification.d.ts.map +1 -1
  31. package/build/src/modules/api/CardAuthentification.js +46 -83
  32. package/build/src/modules/api/CardAuthentification.js.map +1 -1
  33. package/build/src/modules/api/KYCService.d.ts.map +1 -1
  34. package/build/src/modules/api/KYCService.js +96 -38
  35. package/build/src/modules/api/KYCService.js.map +1 -1
  36. package/build/src/modules/api/SelfieVerification.d.ts.map +1 -1
  37. package/build/src/modules/api/SelfieVerification.js +12 -19
  38. package/build/src/modules/api/SelfieVerification.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/components/KYCElements/IDCardCapture.tsx +192 -191
  41. package/src/components/TemplateKYCExample.tsx +3 -0
  42. package/src/components/TemplateKYCFlowRefactored.tsx +31 -25
  43. package/src/config/KYCConfig.ts +7 -5
  44. package/src/hooks/useTemplateKYCFlow.tsx +1 -0
  45. package/src/modules/api/CardAuthentification.ts +409 -445
  46. package/src/modules/api/KYCService.ts +599 -449
  47. package/src/modules/api/SelfieVerification.ts +22 -29
@@ -1,33 +1,26 @@
1
- import kycService, { authentification, SelfieVideoResponse } from "./KYCService";
1
+ import kycService, { authentification, SelfieVideoResponse } from "./KYCService";
2
+ import { KycEnvironment } from "../../types/env.types";
2
3
 
3
- import { KycEnvironment } from "../../types/env.types";
4
-
5
- const selfieVerification = async (selfieImage: string, env: KycEnvironment = 'PRODUCTION'): Promise<SelfieVideoResponse[]> => {
6
- // In SANDBOX mode, skip AI verification and return a mock success response
7
- if (env === 'SANDBOX') {
8
- console.log("SANDBOX mode: Skipping AI verification for selfie");
9
- // Return a mock response that simulates successful verification
10
- // This allows the flow to continue without actual AI processing
11
-
12
- const mockResponse: SelfieVideoResponse[] = [{
13
- orientation_direction: "center",
14
- turn_score: 1.0,
15
- bbox: [0, 0, 100, 100],
16
- capture: true,
17
- instruction: "SANDBOX: AI verification skipped",
18
- error: ""
19
- }];
20
- return mockResponse;
21
- }
22
-
23
- // PRODUCTION mode: perform actual AI verification
24
- const token = await authentification();
25
- const response = await kycService.processSelfieOrientationPicture(selfieImage, token);
26
- console.log("selfieVerification response", JSON.stringify(response, null, 2));
4
+ const selfieVerification = async (
5
+ selfieImage: string,
6
+ env: KycEnvironment = 'PRODUCTION'
7
+ ): Promise<SelfieVideoResponse[]> => {
8
+
9
+ try {
10
+ const token = await authentification();
11
+
12
+ // Perform actual AI verification against the API
13
+ // (Note: if your KYCService method accepts the env parameter for URL switching
14
+ // like the document endpoints do, you can add it here as the 3rd argument: `(selfieImage, token, env)`)
15
+ const response = await kycService.processSelfieOrientationPicture(selfieImage, token);
16
+
17
+ console.log("selfieVerification response", JSON.stringify(response, null, 2));
18
+
27
19
  return response;
28
- }
29
-
30
-
31
-
20
+ } catch (error: any) {
21
+ console.error("Error in selfieVerification:", error?.message || error);
22
+ throw error;
23
+ }
24
+ }
32
25
 
33
26
  export default selfieVerification;