@myazahq/kyc-sdk-react-native 2.0.2 → 2.2.0
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 +152 -8
- package/android/build.gradle +6 -0
- package/android/src/main/AndroidManifest.xml +14 -4
- package/android/src/main/java/com/margelo/nitro/myazakyc/HybridMyazaEmrtd.kt +358 -0
- package/android/src/main/java/com/margelo/nitro/myazakyc/HybridMyazaFaceDetector.kt +88 -1
- package/android/src/main/java/com/margelo/nitro/myazakyc/HybridMyazaRectDetector.kt +34 -0
- package/android/src/main/java/com/margelo/nitro/myazakyc/HybridMyazaTextRecognizer.kt +118 -0
- package/android/src/main/java/com/margelo/nitro/myazakyc/Jp2Decoder.kt +117 -0
- package/app.plugin.js +102 -13
- package/ios/HybridMyazaEmrtd.swift +447 -0
- package/ios/HybridMyazaFaceDetector.swift +104 -2
- package/ios/HybridMyazaRectDetector.swift +103 -0
- package/ios/HybridMyazaTextRecognizer.swift +111 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/KycSdkReactNative+autolinking.cmake +87 -0
- package/nitrogen/generated/android/KycSdkReactNative+autolinking.gradle +27 -0
- package/nitrogen/generated/android/KycSdkReactNativeOnLoad.cpp +102 -0
- package/nitrogen/generated/android/KycSdkReactNativeOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JDetectedRect.hpp +81 -0
- package/nitrogen/generated/android/c++/JEmrtdApduResponse.hpp +61 -0
- package/nitrogen/generated/android/c++/JEmrtdTagInfo.hpp +61 -0
- package/nitrogen/generated/android/c++/JFaceResult.hpp +113 -0
- package/nitrogen/generated/android/c++/JHybridMyazaEmrtdSpec.cpp +176 -0
- package/nitrogen/generated/android/c++/JHybridMyazaEmrtdSpec.hpp +75 -0
- package/nitrogen/generated/android/c++/JHybridMyazaFaceDetectorSpec.cpp +60 -0
- package/nitrogen/generated/android/c++/JHybridMyazaFaceDetectorSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JHybridMyazaRectDetectorSpec.cpp +60 -0
- package/nitrogen/generated/android/c++/JHybridMyazaRectDetectorSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JHybridMyazaTextRecognizerSpec.cpp +80 -0
- package/nitrogen/generated/android/c++/JHybridMyazaTextRecognizerSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JTextResult.hpp +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/DetectedRect.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/EmrtdApduResponse.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/EmrtdTagInfo.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/FaceResult.kt +121 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/HybridMyazaEmrtdSpec.kt +103 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/HybridMyazaFaceDetectorSpec.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/HybridMyazaRectDetectorSpec.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/HybridMyazaTextRecognizerSpec.kt +60 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/KycSdkReactNativeOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/myazakyc/TextResult.kt +51 -0
- package/nitrogen/generated/ios/KycSdkReactNative+autolinking.rb +62 -0
- package/nitrogen/generated/ios/KycSdkReactNative-Swift-Cxx-Bridge.cpp +143 -0
- package/nitrogen/generated/ios/KycSdkReactNative-Swift-Cxx-Bridge.hpp +423 -0
- package/nitrogen/generated/ios/KycSdkReactNative-Swift-Cxx-Umbrella.hpp +81 -0
- package/nitrogen/generated/ios/KycSdkReactNativeAutolinking.mm +57 -0
- package/nitrogen/generated/ios/KycSdkReactNativeAutolinking.swift +62 -0
- package/nitrogen/generated/ios/c++/HybridMyazaEmrtdSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMyazaEmrtdSpecSwift.hpp +184 -0
- package/nitrogen/generated/ios/c++/HybridMyazaFaceDetectorSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMyazaFaceDetectorSpecSwift.hpp +87 -0
- package/nitrogen/generated/ios/c++/HybridMyazaRectDetectorSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMyazaRectDetectorSpecSwift.hpp +87 -0
- package/nitrogen/generated/ios/c++/HybridMyazaTextRecognizerSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridMyazaTextRecognizerSpecSwift.hpp +98 -0
- package/nitrogen/generated/ios/swift/DetectedRect.swift +59 -0
- package/nitrogen/generated/ios/swift/EmrtdApduResponse.swift +34 -0
- package/nitrogen/generated/ios/swift/EmrtdTagInfo.swift +34 -0
- package/nitrogen/generated/ios/swift/FaceResult.swift +99 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_EmrtdApduResponse.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_EmrtdTagInfo.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_TextResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridMyazaEmrtdSpec.swift +67 -0
- package/nitrogen/generated/ios/swift/HybridMyazaEmrtdSpec_cxx.swift +317 -0
- package/nitrogen/generated/ios/swift/HybridMyazaFaceDetectorSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridMyazaFaceDetectorSpec_cxx.swift +143 -0
- package/nitrogen/generated/ios/swift/HybridMyazaRectDetectorSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridMyazaRectDetectorSpec_cxx.swift +143 -0
- package/nitrogen/generated/ios/swift/HybridMyazaTextRecognizerSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridMyazaTextRecognizerSpec_cxx.swift +162 -0
- package/nitrogen/generated/ios/swift/TextResult.swift +35 -0
- package/nitrogen/generated/shared/c++/DetectedRect.hpp +107 -0
- package/nitrogen/generated/shared/c++/EmrtdApduResponse.hpp +87 -0
- package/nitrogen/generated/shared/c++/EmrtdTagInfo.hpp +87 -0
- package/nitrogen/generated/shared/c++/FaceResult.hpp +139 -0
- package/nitrogen/generated/shared/c++/HybridMyazaEmrtdSpec.cpp +33 -0
- package/nitrogen/generated/shared/c++/HybridMyazaEmrtdSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridMyazaFaceDetectorSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridMyazaFaceDetectorSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridMyazaRectDetectorSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridMyazaRectDetectorSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridMyazaTextRecognizerSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridMyazaTextRecognizerSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/TextResult.hpp +84 -0
- package/package.json +16 -4
- package/src/MyazaKYC.tsx +115 -22
- package/src/capture/documentIdentity.ts +153 -0
- package/src/capture/documentSignals.ts +177 -0
- package/src/capture/documentTextGate.ts +171 -0
- package/src/capture/hints.ts +57 -0
- package/src/capture/index.ts +24 -0
- package/src/capture/rectDetector.ts +84 -0
- package/src/capture/rectGate.ts +91 -0
- package/src/capture/useAutoCapture.ts +198 -0
- package/src/components/CameraViewfinder.tsx +226 -70
- package/src/components/ContactCodeEntry.tsx +139 -0
- package/src/components/CountryField.tsx +87 -0
- package/src/components/CountryFlag.tsx +15 -15
- package/src/components/DialCodePicker.tsx +186 -0
- package/src/components/DocumentCropper.tsx +1 -1
- package/src/components/DocumentReview.tsx +142 -0
- package/src/components/DocumentReviewSide.tsx +135 -0
- package/src/components/DocumentReviewZoom.tsx +119 -0
- package/src/components/ExpiryCountdown.tsx +52 -0
- package/src/components/FlashOverlay.tsx +156 -0
- package/src/components/Icon.tsx +70 -1
- package/src/components/KycFlow.tsx +66 -94
- package/src/components/KycSheet.tsx +148 -18
- package/src/components/MediaSourceSheet.tsx +163 -0
- package/src/components/MyazaButton.tsx +14 -2
- package/src/components/MyazaDateField.tsx +240 -0
- package/src/components/MyazaInput.tsx +73 -26
- package/src/components/MyazaSelect.tsx +283 -0
- package/src/components/MyazaWordmark.tsx +33 -0
- package/src/components/OptionRow.tsx +132 -0
- package/src/components/PhoneNumberInput.tsx +149 -0
- package/src/components/PoweredBy.tsx +89 -0
- package/src/components/ReadyPrimer.tsx +149 -0
- package/src/components/StepView.tsx +91 -0
- package/src/components/Typography.tsx +18 -3
- package/src/components/VerifiedNotice.tsx +38 -0
- package/src/components/WhatsAppIcon.tsx +29 -0
- package/src/components/WorkflowGate.tsx +128 -0
- package/src/components/brand-font.ts +113 -0
- package/src/components/flashHoleGeometry.ts +35 -0
- package/src/components/flow/FatalConfigError.tsx +56 -0
- package/src/components/fonts.ts +2 -19
- package/src/components/readyPrimerContent.ts +52 -0
- package/src/components/runtime.tsx +38 -43
- package/src/components/stepHeaderMeta.tsx +87 -0
- package/src/components/theme-provider.tsx +89 -0
- package/src/components/useWorkflowMount.ts +116 -0
- package/src/components/viewfinder/CardGuide.tsx +60 -0
- package/src/components/viewfinder/DocumentGhost.tsx +149 -0
- package/src/components/viewfinder/ImmersiveBottomBar.tsx +172 -0
- package/src/components/viewfinder/ImmersiveControls.tsx +127 -0
- package/src/components/viewfinder/ImmersiveGuide.tsx +174 -0
- package/src/components/viewfinder/ImmersiveOverlay.tsx +79 -0
- package/src/components/viewfinder/ViewfinderControls.tsx +154 -0
- package/src/config/brand.ts +97 -0
- package/src/config/business.ts +179 -0
- package/src/config/businessSteps.ts +105 -0
- package/src/config/contact.ts +159 -0
- package/src/config/countryNames.g.ts +254 -0
- package/src/config/currencyFlags.ts +144 -0
- package/src/config/font-resolve.ts +78 -0
- package/src/config/idTypes.ts +96 -1
- package/src/config/keyPeople.ts +162 -0
- package/src/config/phone.ts +39 -0
- package/src/config/proofOfAddress.ts +75 -0
- package/src/config/questionnaire.ts +153 -0
- package/src/config/regions.ts +118 -0
- package/src/config/registrationHint.ts +87 -0
- package/src/config/stepOrder.ts +118 -0
- package/src/config/theme.ts +38 -2
- package/src/config/workflowMerge.ts +124 -0
- package/src/emrtd/bac.ts +128 -0
- package/src/emrtd/bytes.ts +127 -0
- package/src/emrtd/crypto.ts +163 -0
- package/src/emrtd/der.ts +192 -0
- package/src/emrtd/dg2.ts +111 -0
- package/src/emrtd/files.ts +215 -0
- package/src/emrtd/index.ts +30 -0
- package/src/emrtd/mrzKey.ts +54 -0
- package/src/emrtd/native.ts +79 -0
- package/src/emrtd/optionalRead.ts +42 -0
- package/src/emrtd/read.ts +224 -0
- package/src/emrtd/retry.ts +98 -0
- package/src/emrtd/secureMessaging.ts +178 -0
- package/src/emrtd/session.ts +200 -0
- package/src/emrtd/stages.ts +122 -0
- package/src/index.ts +110 -0
- package/src/lib/calendar.ts +71 -0
- package/src/lib/use-keyboard-inset.ts +34 -0
- package/src/liveness/challengeManager.ts +27 -1
- package/src/liveness/faceContinuity.ts +153 -0
- package/src/liveness/flashDetector.ts +145 -0
- package/src/liveness/flashReadyGate.ts +106 -0
- package/src/liveness/flashRunner.ts +118 -0
- package/src/liveness/integritySignals.ts +60 -0
- package/src/liveness/livenessState.ts +139 -0
- package/src/liveness/speech.ts +19 -1
- package/src/liveness/types.ts +48 -1
- package/src/liveness/useFlashPhase.ts +78 -0
- package/src/liveness/useLiveness.ts +260 -75
- package/src/liveness/visionCameraFaceDetector.ts +14 -0
- package/src/mrz/extract.ts +101 -0
- package/src/mrz/parse.ts +178 -0
- package/src/mrz/textRecognizer.ts +149 -0
- package/src/screens/ApplicantRoleStep.tsx +322 -0
- package/src/screens/BusinessDetailsStep.tsx +212 -0
- package/src/screens/BusinessDocumentSlot.tsx +167 -0
- package/src/screens/BusinessDocumentsStep.tsx +213 -0
- package/src/screens/BusinessKeyPeopleStep.tsx +207 -0
- package/src/screens/CompanyInfoFields.tsx +83 -0
- package/src/screens/ConsentStep.tsx +68 -68
- package/src/screens/ContactChannelChoice.tsx +133 -0
- package/src/screens/ContactCodeStep.tsx +130 -0
- package/src/screens/ContactDestinationField.tsx +70 -0
- package/src/screens/ContactFooterNote.tsx +34 -0
- package/src/screens/ContactVerificationStep.tsx +199 -0
- package/src/screens/ContactVerifiedPanel.tsx +36 -0
- package/src/screens/CountrySelectStep.tsx +210 -0
- package/src/screens/DocumentCaptureStep.tsx +156 -132
- package/src/screens/IdInputStep.tsx +13 -5
- package/src/screens/IdTypeStep.tsx +74 -33
- package/src/screens/KeyPeopleInviteLinks.tsx +239 -0
- package/src/screens/KeyPersonCard.tsx +119 -0
- package/src/screens/KeyPersonForm.tsx +148 -0
- package/src/screens/KeyPersonSheet.tsx +184 -0
- package/src/screens/LivenessStep.tsx +155 -247
- package/src/screens/MrzScanView.tsx +173 -0
- package/src/screens/NfcStep.tsx +290 -0
- package/src/screens/ProofOfAddressStep.tsx +238 -0
- package/src/screens/QuestionnaireField.tsx +219 -0
- package/src/screens/QuestionnaireMoneyField.tsx +134 -0
- package/src/screens/QuestionnaireStep.tsx +76 -0
- package/src/screens/SubmittedStep.tsx +5 -0
- package/src/screens/consent/model.ts +109 -0
- package/src/screens/document/CameraPhase.tsx +150 -0
- package/src/screens/document/RequiredPill.tsx +60 -0
- package/src/screens/liveness/LightingBanner.tsx +50 -0
- package/src/screens/liveness/LivenessOutcome.tsx +109 -0
- package/src/screens/liveness/ProgressDots.tsx +67 -0
- package/src/screens/liveness/SelfiePreview.tsx +39 -0
- package/src/screens/liveness/constants.ts +31 -0
- package/src/screens/liveness/index.ts +8 -0
- package/src/screens/liveness/resolveGuidance.ts +27 -0
- package/src/screens/liveness/useSelfieUpload.ts +107 -0
- package/src/screens/nfc/NfcMrzPrompt.tsx +40 -0
- package/src/screens/nfc/NfcReadBody.tsx +63 -0
- package/src/screens/nfc/NfcReadProgress.tsx +96 -0
- package/src/screens/nfc/NfcScanIllustration.tsx +244 -0
- package/src/screens/nfc/NfcScannedSummary.tsx +74 -0
- package/src/screens/nfc/NfcSuccessPanel.tsx +162 -0
- package/src/screens/nfc/availability.ts +73 -0
- package/src/screens/nfc/readErrorMessage.ts +93 -0
- package/src/screens/nfc/useChipPortrait.ts +58 -0
- package/src/screens/nfc/useNfcAvailability.ts +82 -0
- package/src/screens/useFlashHole.ts +105 -0
- package/src/screens/useFlashSequence.ts +96 -0
- package/src/screens/usePoaAttach.ts +121 -0
- package/src/services/api-types.ts +164 -0
- package/src/services/api-verify-types.ts +99 -0
- package/src/services/api.ts +72 -102
- package/src/services/cardCrop.ts +25 -10
- package/src/services/contactErrors.ts +43 -0
- package/src/services/deviceMetadata.ts +1 -1
- package/src/services/documentPicker.ts +20 -0
- package/src/services/fingerprint-sources.ts +129 -0
- package/src/services/fingerprint.ts +101 -0
- package/src/services/haptics.ts +38 -0
- package/src/services/mediaCompress.ts +7 -2
- package/src/services/resolveUrl.ts +2 -2
- package/src/services/workflowGate.ts +138 -0
- package/src/specs/MyazaEmrtd.nitro.ts +114 -0
- package/src/specs/MyazaFaceDetector.nitro.ts +10 -0
- package/src/specs/MyazaRectDetector.nitro.ts +50 -0
- package/src/specs/MyazaTextRecognizer.nitro.ts +48 -0
- package/src/store/derive.ts +225 -0
- package/src/store/kycStore.ts +250 -149
- package/src/store/state.ts +253 -0
- package/src/store/submit.ts +101 -0
- package/src/store/submitApplicant.ts +81 -0
- package/src/types/appearance.ts +113 -0
- package/src/types/business.ts +131 -0
- package/src/types/config.ts +150 -124
- package/src/types/id-types.ts +57 -0
- package/src/types/verification.ts +5 -0
- package/src/types/workflow.ts +141 -0
- package/src/utils/amountFormat.ts +73 -0
- package/src/utils/tokens.ts +4 -2
- package/src/__tests__/cardCrop.test.ts +0 -39
- package/src/__tests__/deviceMetadata.test.ts +0 -34
- package/src/__tests__/errors.test.ts +0 -34
- package/src/__tests__/flow.test.ts +0 -61
- package/src/__tests__/gestureDetector.test.ts +0 -37
- package/src/__tests__/liveness.test.ts +0 -112
- package/src/__tests__/resolveUrl.test.ts +0 -64
- package/src/__tests__/validators.test.ts +0 -38
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// FaceResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::myazakyc {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (FaceResult).
|
|
39
|
+
*/
|
|
40
|
+
struct FaceResult final {
|
|
41
|
+
public:
|
|
42
|
+
double headEulerAngleX SWIFT_PRIVATE;
|
|
43
|
+
double headEulerAngleY SWIFT_PRIVATE;
|
|
44
|
+
double headEulerAngleZ SWIFT_PRIVATE;
|
|
45
|
+
double smilingProbability SWIFT_PRIVATE;
|
|
46
|
+
double leftEyeOpenProbability SWIFT_PRIVATE;
|
|
47
|
+
double rightEyeOpenProbability SWIFT_PRIVATE;
|
|
48
|
+
double faceSizeRatio SWIFT_PRIVATE;
|
|
49
|
+
double faceCount SWIFT_PRIVATE;
|
|
50
|
+
double brightness SWIFT_PRIVATE;
|
|
51
|
+
double faceCenterX SWIFT_PRIVATE;
|
|
52
|
+
double faceCenterY SWIFT_PRIVATE;
|
|
53
|
+
double trackingId SWIFT_PRIVATE;
|
|
54
|
+
double faceR SWIFT_PRIVATE;
|
|
55
|
+
double faceG SWIFT_PRIVATE;
|
|
56
|
+
double faceB SWIFT_PRIVATE;
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
FaceResult() = default;
|
|
60
|
+
explicit FaceResult(double headEulerAngleX, double headEulerAngleY, double headEulerAngleZ, double smilingProbability, double leftEyeOpenProbability, double rightEyeOpenProbability, double faceSizeRatio, double faceCount, double brightness, double faceCenterX, double faceCenterY, double trackingId, double faceR, double faceG, double faceB): headEulerAngleX(headEulerAngleX), headEulerAngleY(headEulerAngleY), headEulerAngleZ(headEulerAngleZ), smilingProbability(smilingProbability), leftEyeOpenProbability(leftEyeOpenProbability), rightEyeOpenProbability(rightEyeOpenProbability), faceSizeRatio(faceSizeRatio), faceCount(faceCount), brightness(brightness), faceCenterX(faceCenterX), faceCenterY(faceCenterY), trackingId(trackingId), faceR(faceR), faceG(faceG), faceB(faceB) {}
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
friend bool operator==(const FaceResult& lhs, const FaceResult& rhs) = default;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
} // namespace margelo::nitro::myazakyc
|
|
67
|
+
|
|
68
|
+
namespace margelo::nitro {
|
|
69
|
+
|
|
70
|
+
// C++ FaceResult <> JS FaceResult (object)
|
|
71
|
+
template <>
|
|
72
|
+
struct JSIConverter<margelo::nitro::myazakyc::FaceResult> final {
|
|
73
|
+
static inline margelo::nitro::myazakyc::FaceResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
74
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
75
|
+
return margelo::nitro::myazakyc::FaceResult(
|
|
76
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headEulerAngleX"))),
|
|
77
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headEulerAngleY"))),
|
|
78
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headEulerAngleZ"))),
|
|
79
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "smilingProbability"))),
|
|
80
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leftEyeOpenProbability"))),
|
|
81
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rightEyeOpenProbability"))),
|
|
82
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceSizeRatio"))),
|
|
83
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceCount"))),
|
|
84
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "brightness"))),
|
|
85
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceCenterX"))),
|
|
86
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceCenterY"))),
|
|
87
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "trackingId"))),
|
|
88
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceR"))),
|
|
89
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceG"))),
|
|
90
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceB")))
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::myazakyc::FaceResult& arg) {
|
|
94
|
+
jsi::Object obj(runtime);
|
|
95
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "headEulerAngleX"), JSIConverter<double>::toJSI(runtime, arg.headEulerAngleX));
|
|
96
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "headEulerAngleY"), JSIConverter<double>::toJSI(runtime, arg.headEulerAngleY));
|
|
97
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "headEulerAngleZ"), JSIConverter<double>::toJSI(runtime, arg.headEulerAngleZ));
|
|
98
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "smilingProbability"), JSIConverter<double>::toJSI(runtime, arg.smilingProbability));
|
|
99
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "leftEyeOpenProbability"), JSIConverter<double>::toJSI(runtime, arg.leftEyeOpenProbability));
|
|
100
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "rightEyeOpenProbability"), JSIConverter<double>::toJSI(runtime, arg.rightEyeOpenProbability));
|
|
101
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "faceSizeRatio"), JSIConverter<double>::toJSI(runtime, arg.faceSizeRatio));
|
|
102
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "faceCount"), JSIConverter<double>::toJSI(runtime, arg.faceCount));
|
|
103
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "brightness"), JSIConverter<double>::toJSI(runtime, arg.brightness));
|
|
104
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "faceCenterX"), JSIConverter<double>::toJSI(runtime, arg.faceCenterX));
|
|
105
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "faceCenterY"), JSIConverter<double>::toJSI(runtime, arg.faceCenterY));
|
|
106
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "trackingId"), JSIConverter<double>::toJSI(runtime, arg.trackingId));
|
|
107
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "faceR"), JSIConverter<double>::toJSI(runtime, arg.faceR));
|
|
108
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "faceG"), JSIConverter<double>::toJSI(runtime, arg.faceG));
|
|
109
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "faceB"), JSIConverter<double>::toJSI(runtime, arg.faceB));
|
|
110
|
+
return obj;
|
|
111
|
+
}
|
|
112
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
113
|
+
if (!value.isObject()) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
jsi::Object obj = value.getObject(runtime);
|
|
117
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headEulerAngleX")))) return false;
|
|
121
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headEulerAngleY")))) return false;
|
|
122
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headEulerAngleZ")))) return false;
|
|
123
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "smilingProbability")))) return false;
|
|
124
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "leftEyeOpenProbability")))) return false;
|
|
125
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "rightEyeOpenProbability")))) return false;
|
|
126
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceSizeRatio")))) return false;
|
|
127
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceCount")))) return false;
|
|
128
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "brightness")))) return false;
|
|
129
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceCenterX")))) return false;
|
|
130
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceCenterY")))) return false;
|
|
131
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "trackingId")))) return false;
|
|
132
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceR")))) return false;
|
|
133
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceG")))) return false;
|
|
134
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "faceB")))) return false;
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMyazaEmrtdSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridMyazaEmrtdSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::myazakyc {
|
|
11
|
+
|
|
12
|
+
void HybridMyazaEmrtdSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("isAvailable", &HybridMyazaEmrtdSpec::isAvailable);
|
|
18
|
+
prototype.registerHybridMethod("startSession", &HybridMyazaEmrtdSpec::startSession);
|
|
19
|
+
prototype.registerHybridMethod("stopSession", &HybridMyazaEmrtdSpec::stopSession);
|
|
20
|
+
prototype.registerHybridMethod("updateSessionMessage", &HybridMyazaEmrtdSpec::updateSessionMessage);
|
|
21
|
+
prototype.registerHybridMethod("transceive", &HybridMyazaEmrtdSpec::transceive);
|
|
22
|
+
prototype.registerHybridMethod("decodeImage", &HybridMyazaEmrtdSpec::decodeImage);
|
|
23
|
+
prototype.registerHybridMethod("sha1", &HybridMyazaEmrtdSpec::sha1);
|
|
24
|
+
prototype.registerHybridMethod("sha256", &HybridMyazaEmrtdSpec::sha256);
|
|
25
|
+
prototype.registerHybridMethod("desEde2Cbc", &HybridMyazaEmrtdSpec::desEde2Cbc);
|
|
26
|
+
prototype.registerHybridMethod("desBlock", &HybridMyazaEmrtdSpec::desBlock);
|
|
27
|
+
prototype.registerHybridMethod("aesCbc", &HybridMyazaEmrtdSpec::aesCbc);
|
|
28
|
+
prototype.registerHybridMethod("aesCmac", &HybridMyazaEmrtdSpec::aesCmac);
|
|
29
|
+
prototype.registerHybridMethod("randomBytes", &HybridMyazaEmrtdSpec::randomBytes);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
} // namespace margelo::nitro::myazakyc
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMyazaEmrtdSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `EmrtdTagInfo` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::myazakyc { struct EmrtdTagInfo; }
|
|
18
|
+
// Forward declaration of `EmrtdApduResponse` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::myazakyc { struct EmrtdApduResponse; }
|
|
20
|
+
|
|
21
|
+
#include "EmrtdTagInfo.hpp"
|
|
22
|
+
#include <NitroModules/Promise.hpp>
|
|
23
|
+
#include <string>
|
|
24
|
+
#include "EmrtdApduResponse.hpp"
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::myazakyc {
|
|
27
|
+
|
|
28
|
+
using namespace margelo::nitro;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* An abstract base class for `MyazaEmrtd`
|
|
32
|
+
* Inherit this class to create instances of `HybridMyazaEmrtdSpec` in C++.
|
|
33
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
34
|
+
* @example
|
|
35
|
+
* ```cpp
|
|
36
|
+
* class HybridMyazaEmrtd: public HybridMyazaEmrtdSpec {
|
|
37
|
+
* public:
|
|
38
|
+
* HybridMyazaEmrtd(...): HybridObject(TAG) { ... }
|
|
39
|
+
* // ...
|
|
40
|
+
* };
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
class HybridMyazaEmrtdSpec: public virtual HybridObject {
|
|
44
|
+
public:
|
|
45
|
+
// Constructor
|
|
46
|
+
explicit HybridMyazaEmrtdSpec(): HybridObject(TAG) { }
|
|
47
|
+
|
|
48
|
+
// Destructor
|
|
49
|
+
~HybridMyazaEmrtdSpec() override = default;
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
// Properties
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
// Methods
|
|
57
|
+
virtual bool isAvailable() = 0;
|
|
58
|
+
virtual std::shared_ptr<Promise<EmrtdTagInfo>> startSession(const std::string& alertMessage) = 0;
|
|
59
|
+
virtual std::shared_ptr<Promise<void>> stopSession(const std::string& message) = 0;
|
|
60
|
+
virtual std::shared_ptr<Promise<void>> updateSessionMessage(const std::string& message) = 0;
|
|
61
|
+
virtual std::shared_ptr<Promise<EmrtdApduResponse>> transceive(const std::string& apduBase64) = 0;
|
|
62
|
+
virtual std::shared_ptr<Promise<std::string>> decodeImage(const std::string& dataBase64) = 0;
|
|
63
|
+
virtual std::string sha1(const std::string& dataBase64) = 0;
|
|
64
|
+
virtual std::string sha256(const std::string& dataBase64) = 0;
|
|
65
|
+
virtual std::string desEde2Cbc(const std::string& keyBase64, const std::string& dataBase64, const std::string& ivBase64, bool encrypt) = 0;
|
|
66
|
+
virtual std::string desBlock(const std::string& keyBase64, const std::string& blockBase64, bool encrypt) = 0;
|
|
67
|
+
virtual std::string aesCbc(const std::string& keyBase64, const std::string& dataBase64, const std::string& ivBase64, bool encrypt) = 0;
|
|
68
|
+
virtual std::string aesCmac(const std::string& keyBase64, const std::string& dataBase64) = 0;
|
|
69
|
+
virtual std::string randomBytes(double length) = 0;
|
|
70
|
+
|
|
71
|
+
protected:
|
|
72
|
+
// Hybrid Setup
|
|
73
|
+
void loadHybridMethods() override;
|
|
74
|
+
|
|
75
|
+
protected:
|
|
76
|
+
// Tag for logging
|
|
77
|
+
static constexpr auto TAG = "MyazaEmrtd";
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro::myazakyc
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMyazaFaceDetectorSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridMyazaFaceDetectorSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::myazakyc {
|
|
11
|
+
|
|
12
|
+
void HybridMyazaFaceDetectorSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("detectFace", &HybridMyazaFaceDetectorSpec::detectFace);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
} // namespace margelo::nitro::myazakyc
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMyazaFaceDetectorSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `FaceResult` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::myazakyc { struct FaceResult; }
|
|
18
|
+
// Forward declaration of `HybridFrameSpec` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::camera { class HybridFrameSpec; }
|
|
20
|
+
|
|
21
|
+
#include "FaceResult.hpp"
|
|
22
|
+
#include <memory>
|
|
23
|
+
#include <VisionCamera/HybridFrameSpec.hpp>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::myazakyc {
|
|
26
|
+
|
|
27
|
+
using namespace margelo::nitro;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* An abstract base class for `MyazaFaceDetector`
|
|
31
|
+
* Inherit this class to create instances of `HybridMyazaFaceDetectorSpec` in C++.
|
|
32
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
33
|
+
* @example
|
|
34
|
+
* ```cpp
|
|
35
|
+
* class HybridMyazaFaceDetector: public HybridMyazaFaceDetectorSpec {
|
|
36
|
+
* public:
|
|
37
|
+
* HybridMyazaFaceDetector(...): HybridObject(TAG) { ... }
|
|
38
|
+
* // ...
|
|
39
|
+
* };
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
class HybridMyazaFaceDetectorSpec: public virtual HybridObject {
|
|
43
|
+
public:
|
|
44
|
+
// Constructor
|
|
45
|
+
explicit HybridMyazaFaceDetectorSpec(): HybridObject(TAG) { }
|
|
46
|
+
|
|
47
|
+
// Destructor
|
|
48
|
+
~HybridMyazaFaceDetectorSpec() override = default;
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
// Properties
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
// Methods
|
|
56
|
+
virtual FaceResult detectFace(const std::shared_ptr<margelo::nitro::camera::HybridFrameSpec>& frame) = 0;
|
|
57
|
+
|
|
58
|
+
protected:
|
|
59
|
+
// Hybrid Setup
|
|
60
|
+
void loadHybridMethods() override;
|
|
61
|
+
|
|
62
|
+
protected:
|
|
63
|
+
// Tag for logging
|
|
64
|
+
static constexpr auto TAG = "MyazaFaceDetector";
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace margelo::nitro::myazakyc
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMyazaRectDetectorSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridMyazaRectDetectorSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::myazakyc {
|
|
11
|
+
|
|
12
|
+
void HybridMyazaRectDetectorSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("detectRect", &HybridMyazaRectDetectorSpec::detectRect);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
} // namespace margelo::nitro::myazakyc
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMyazaRectDetectorSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `DetectedRect` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::myazakyc { struct DetectedRect; }
|
|
18
|
+
// Forward declaration of `HybridFrameSpec` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::camera { class HybridFrameSpec; }
|
|
20
|
+
|
|
21
|
+
#include "DetectedRect.hpp"
|
|
22
|
+
#include <memory>
|
|
23
|
+
#include <VisionCamera/HybridFrameSpec.hpp>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::myazakyc {
|
|
26
|
+
|
|
27
|
+
using namespace margelo::nitro;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* An abstract base class for `MyazaRectDetector`
|
|
31
|
+
* Inherit this class to create instances of `HybridMyazaRectDetectorSpec` in C++.
|
|
32
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
33
|
+
* @example
|
|
34
|
+
* ```cpp
|
|
35
|
+
* class HybridMyazaRectDetector: public HybridMyazaRectDetectorSpec {
|
|
36
|
+
* public:
|
|
37
|
+
* HybridMyazaRectDetector(...): HybridObject(TAG) { ... }
|
|
38
|
+
* // ...
|
|
39
|
+
* };
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
class HybridMyazaRectDetectorSpec: public virtual HybridObject {
|
|
43
|
+
public:
|
|
44
|
+
// Constructor
|
|
45
|
+
explicit HybridMyazaRectDetectorSpec(): HybridObject(TAG) { }
|
|
46
|
+
|
|
47
|
+
// Destructor
|
|
48
|
+
~HybridMyazaRectDetectorSpec() override = default;
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
// Properties
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
// Methods
|
|
56
|
+
virtual DetectedRect detectRect(const std::shared_ptr<margelo::nitro::camera::HybridFrameSpec>& frame) = 0;
|
|
57
|
+
|
|
58
|
+
protected:
|
|
59
|
+
// Hybrid Setup
|
|
60
|
+
void loadHybridMethods() override;
|
|
61
|
+
|
|
62
|
+
protected:
|
|
63
|
+
// Tag for logging
|
|
64
|
+
static constexpr auto TAG = "MyazaRectDetector";
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace margelo::nitro::myazakyc
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMyazaTextRecognizerSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridMyazaTextRecognizerSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::myazakyc {
|
|
11
|
+
|
|
12
|
+
void HybridMyazaTextRecognizerSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("recognizeText", &HybridMyazaTextRecognizerSpec::recognizeText);
|
|
18
|
+
prototype.registerHybridMethod("recognizeTextInImage", &HybridMyazaTextRecognizerSpec::recognizeTextInImage);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace margelo::nitro::myazakyc
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridMyazaTextRecognizerSpec.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `TextResult` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::myazakyc { struct TextResult; }
|
|
18
|
+
// Forward declaration of `HybridFrameSpec` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::camera { class HybridFrameSpec; }
|
|
20
|
+
|
|
21
|
+
#include "TextResult.hpp"
|
|
22
|
+
#include <memory>
|
|
23
|
+
#include <VisionCamera/HybridFrameSpec.hpp>
|
|
24
|
+
#include <NitroModules/Promise.hpp>
|
|
25
|
+
#include <string>
|
|
26
|
+
|
|
27
|
+
namespace margelo::nitro::myazakyc {
|
|
28
|
+
|
|
29
|
+
using namespace margelo::nitro;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* An abstract base class for `MyazaTextRecognizer`
|
|
33
|
+
* Inherit this class to create instances of `HybridMyazaTextRecognizerSpec` in C++.
|
|
34
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
35
|
+
* @example
|
|
36
|
+
* ```cpp
|
|
37
|
+
* class HybridMyazaTextRecognizer: public HybridMyazaTextRecognizerSpec {
|
|
38
|
+
* public:
|
|
39
|
+
* HybridMyazaTextRecognizer(...): HybridObject(TAG) { ... }
|
|
40
|
+
* // ...
|
|
41
|
+
* };
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
class HybridMyazaTextRecognizerSpec: public virtual HybridObject {
|
|
45
|
+
public:
|
|
46
|
+
// Constructor
|
|
47
|
+
explicit HybridMyazaTextRecognizerSpec(): HybridObject(TAG) { }
|
|
48
|
+
|
|
49
|
+
// Destructor
|
|
50
|
+
~HybridMyazaTextRecognizerSpec() override = default;
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
// Properties
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
// Methods
|
|
58
|
+
virtual TextResult recognizeText(const std::shared_ptr<margelo::nitro::camera::HybridFrameSpec>& frame, double bottomFraction) = 0;
|
|
59
|
+
virtual std::shared_ptr<Promise<TextResult>> recognizeTextInImage(const std::string& uri, double bottomFraction) = 0;
|
|
60
|
+
|
|
61
|
+
protected:
|
|
62
|
+
// Hybrid Setup
|
|
63
|
+
void loadHybridMethods() override;
|
|
64
|
+
|
|
65
|
+
protected:
|
|
66
|
+
// Tag for logging
|
|
67
|
+
static constexpr auto TAG = "MyazaTextRecognizer";
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
} // namespace margelo::nitro::myazakyc
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TextResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <vector>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::myazakyc {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (TextResult).
|
|
40
|
+
*/
|
|
41
|
+
struct TextResult final {
|
|
42
|
+
public:
|
|
43
|
+
std::vector<std::string> lines SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
TextResult() = default;
|
|
47
|
+
explicit TextResult(std::vector<std::string> lines): lines(lines) {}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
friend bool operator==(const TextResult& lhs, const TextResult& rhs) = default;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
} // namespace margelo::nitro::myazakyc
|
|
54
|
+
|
|
55
|
+
namespace margelo::nitro {
|
|
56
|
+
|
|
57
|
+
// C++ TextResult <> JS TextResult (object)
|
|
58
|
+
template <>
|
|
59
|
+
struct JSIConverter<margelo::nitro::myazakyc::TextResult> final {
|
|
60
|
+
static inline margelo::nitro::myazakyc::TextResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
61
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
62
|
+
return margelo::nitro::myazakyc::TextResult(
|
|
63
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "lines")))
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::myazakyc::TextResult& arg) {
|
|
67
|
+
jsi::Object obj(runtime);
|
|
68
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "lines"), JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.lines));
|
|
69
|
+
return obj;
|
|
70
|
+
}
|
|
71
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
72
|
+
if (!value.isObject()) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
jsi::Object obj = value.getObject(runtime);
|
|
76
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "lines")))) return false;
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myazahq/kyc-sdk-react-native",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Myaza KYC SDK for React Native (Expo) — ID verification, liveness detection, and document capture",
|
|
5
|
+
"author": "Flitstack Technologies Inc.",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/myazahq/kyc-sdk-react-native.git"
|
|
8
|
+
"url": "git+https://github.com/myazahq/kyc-sdk-react-native.git"
|
|
8
9
|
},
|
|
9
10
|
"homepage": "https://github.com/myazahq/kyc-sdk-react-native#readme",
|
|
10
11
|
"bugs": {
|
|
@@ -16,17 +17,25 @@
|
|
|
16
17
|
"src",
|
|
17
18
|
"android",
|
|
18
19
|
"ios",
|
|
20
|
+
"nitrogen/generated",
|
|
19
21
|
"app.plugin.js",
|
|
20
22
|
"expo-module.config.json",
|
|
21
23
|
"react-native.config.js",
|
|
22
|
-
"KycSdkReactNative.podspec"
|
|
24
|
+
"KycSdkReactNative.podspec",
|
|
25
|
+
"!src/__tests__",
|
|
26
|
+
"!**/build",
|
|
27
|
+
"!**/.cxx",
|
|
28
|
+
"!**/.gradle",
|
|
29
|
+
"!ios/Pods",
|
|
30
|
+
"!**/*.xcworkspace",
|
|
31
|
+
"!**/*.xcuserdatad"
|
|
23
32
|
],
|
|
24
33
|
"publishConfig": {
|
|
25
34
|
"access": "public"
|
|
26
35
|
},
|
|
27
36
|
"scripts": {
|
|
28
37
|
"typecheck": "tsc --noEmit",
|
|
29
|
-
"test": "jest",
|
|
38
|
+
"test": "NODE_OPTIONS=--openssl-legacy-provider jest",
|
|
30
39
|
"specs": "nitrogen"
|
|
31
40
|
},
|
|
32
41
|
"keywords": [
|
|
@@ -56,8 +65,11 @@
|
|
|
56
65
|
"@expo/vector-icons": "^14.0.4",
|
|
57
66
|
"country-flag-icons": "^1.6.17",
|
|
58
67
|
"expo-application": "~56.0.3",
|
|
68
|
+
"libphonenumber-js": "^1.13.8",
|
|
59
69
|
"expo-crypto": "~56.0.4",
|
|
70
|
+
"expo-clipboard": "~56.0.0",
|
|
60
71
|
"expo-device": "~56.0.4",
|
|
72
|
+
"expo-document-picker": "~56.0.4",
|
|
61
73
|
"expo-font": "~56.0.5",
|
|
62
74
|
"expo-glass-effect": "~56.0.4",
|
|
63
75
|
"expo-image-manipulator": "~56.0.17",
|