@velion-la/onboarding-sdk-react-native 1.0.0-beta.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/CHANGELOG.md +66 -0
- package/LICENSE +12 -0
- package/README.md +803 -0
- package/lib/commonjs/camera/AddressSearchBar.js +304 -0
- package/lib/commonjs/camera/AddressSearchBar.js.map +1 -0
- package/lib/commonjs/camera/DocumentCapture.js +505 -0
- package/lib/commonjs/camera/DocumentCapture.js.map +1 -0
- package/lib/commonjs/camera/LivenessCamera.js +534 -0
- package/lib/commonjs/camera/LivenessCamera.js.map +1 -0
- package/lib/commonjs/camera/MapAddressPicker.js +341 -0
- package/lib/commonjs/camera/MapAddressPicker.js.map +1 -0
- package/lib/commonjs/core/VelionOnboarding.js +815 -0
- package/lib/commonjs/core/VelionOnboarding.js.map +1 -0
- package/lib/commonjs/core/sessionDeclinedCopy.js +56 -0
- package/lib/commonjs/core/sessionDeclinedCopy.js.map +1 -0
- package/lib/commonjs/core/sessionStateMapper.js +137 -0
- package/lib/commonjs/core/sessionStateMapper.js.map +1 -0
- package/lib/commonjs/core/sseReasonMessages.js +450 -0
- package/lib/commonjs/core/sseReasonMessages.js.map +1 -0
- package/lib/commonjs/data/iso3166Alpha2Codes.json +1 -0
- package/lib/commonjs/data/iso3166CountryNames.json +251 -0
- package/lib/commonjs/i18n/index.js +30 -0
- package/lib/commonjs/i18n/index.js.map +1 -0
- package/lib/commonjs/i18n/strings/en.js +261 -0
- package/lib/commonjs/i18n/strings/en.js.map +1 -0
- package/lib/commonjs/i18n/strings/es.js +266 -0
- package/lib/commonjs/i18n/strings/es.js.map +1 -0
- package/lib/commonjs/index.js +213 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/steps/AddressInfoStep.js +650 -0
- package/lib/commonjs/steps/AddressInfoStep.js.map +1 -0
- package/lib/commonjs/steps/DocumentsOcrStep.js +397 -0
- package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -0
- package/lib/commonjs/steps/EmailContactStep.js +145 -0
- package/lib/commonjs/steps/EmailContactStep.js.map +1 -0
- package/lib/commonjs/steps/EmailOtpStep.js +220 -0
- package/lib/commonjs/steps/EmailOtpStep.js.map +1 -0
- package/lib/commonjs/steps/FaceMatchStep.js +166 -0
- package/lib/commonjs/steps/FaceMatchStep.js.map +1 -0
- package/lib/commonjs/steps/FingerprintStep.js +92 -0
- package/lib/commonjs/steps/FingerprintStep.js.map +1 -0
- package/lib/commonjs/steps/HumanBasicInfoStep.js +243 -0
- package/lib/commonjs/steps/HumanBasicInfoStep.js.map +1 -0
- package/lib/commonjs/steps/HumanExtendedInfoStep.js +268 -0
- package/lib/commonjs/steps/HumanExtendedInfoStep.js.map +1 -0
- package/lib/commonjs/steps/LegalBasicInfoStep.js +188 -0
- package/lib/commonjs/steps/LegalBasicInfoStep.js.map +1 -0
- package/lib/commonjs/steps/LegalExtendedInfoStep.js +166 -0
- package/lib/commonjs/steps/LegalExtendedInfoStep.js.map +1 -0
- package/lib/commonjs/steps/LivenessMatchStep.js +707 -0
- package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -0
- package/lib/commonjs/steps/PhoneContactStep.js +146 -0
- package/lib/commonjs/steps/PhoneContactStep.js.map +1 -0
- package/lib/commonjs/steps/PhoneOtpStep.js +219 -0
- package/lib/commonjs/steps/PhoneOtpStep.js.map +1 -0
- package/lib/commonjs/steps/SwornDeclarationStep.js +196 -0
- package/lib/commonjs/steps/SwornDeclarationStep.js.map +1 -0
- package/lib/commonjs/steps/TaxInfoStep.js +244 -0
- package/lib/commonjs/steps/TaxInfoStep.js.map +1 -0
- package/lib/commonjs/steps/TermsAndConditionsStep.js +238 -0
- package/lib/commonjs/steps/TermsAndConditionsStep.js.map +1 -0
- package/lib/commonjs/steps/_shared.js +40 -0
- package/lib/commonjs/steps/_shared.js.map +1 -0
- package/lib/commonjs/steps/types.js +6 -0
- package/lib/commonjs/steps/types.js.map +1 -0
- package/lib/commonjs/transport/api.js +176 -0
- package/lib/commonjs/transport/api.js.map +1 -0
- package/lib/commonjs/transport/irisWebSocket.js +121 -0
- package/lib/commonjs/transport/irisWebSocket.js.map +1 -0
- package/lib/commonjs/transport/secureUrl.js +50 -0
- package/lib/commonjs/transport/secureUrl.js.map +1 -0
- package/lib/commonjs/transport/sse.js +248 -0
- package/lib/commonjs/transport/sse.js.map +1 -0
- package/lib/commonjs/types/index.js +391 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/ui/MapFallbackBoundary.js +42 -0
- package/lib/commonjs/ui/MapFallbackBoundary.js.map +1 -0
- package/lib/commonjs/ui/StepShell.js +118 -0
- package/lib/commonjs/ui/StepShell.js.map +1 -0
- package/lib/commonjs/ui/VelionOnboardingScreen.js +217 -0
- package/lib/commonjs/ui/VelionOnboardingScreen.js.map +1 -0
- package/lib/commonjs/ui/forms/index.js +38 -0
- package/lib/commonjs/ui/forms/index.js.map +1 -0
- package/lib/commonjs/ui/forms/useInlineValidation.js +88 -0
- package/lib/commonjs/ui/forms/useInlineValidation.js.map +1 -0
- package/lib/commonjs/ui/forms/validators.js +34 -0
- package/lib/commonjs/ui/forms/validators.js.map +1 -0
- package/lib/commonjs/ui/icons/HomeHeartIcon.js +38 -0
- package/lib/commonjs/ui/icons/HomeHeartIcon.js.map +1 -0
- package/lib/commonjs/ui/icons/StepIcon.js +59 -0
- package/lib/commonjs/ui/icons/StepIcon.js.map +1 -0
- package/lib/commonjs/ui/overlays/AnalyzingOverlay.js +284 -0
- package/lib/commonjs/ui/overlays/AnalyzingOverlay.js.map +1 -0
- package/lib/commonjs/ui/overlays/LoadingOverlay.js +108 -0
- package/lib/commonjs/ui/overlays/LoadingOverlay.js.map +1 -0
- package/lib/commonjs/ui/overlays/ProgressBar.js +95 -0
- package/lib/commonjs/ui/overlays/ProgressBar.js.map +1 -0
- package/lib/commonjs/ui/overlays/RetryDialog.js +125 -0
- package/lib/commonjs/ui/overlays/RetryDialog.js.map +1 -0
- package/lib/commonjs/ui/overlays/index.js +33 -0
- package/lib/commonjs/ui/overlays/index.js.map +1 -0
- package/lib/commonjs/ui/primitives/Banner.js +81 -0
- package/lib/commonjs/ui/primitives/Banner.js.map +1 -0
- package/lib/commonjs/ui/primitives/Button.js +142 -0
- package/lib/commonjs/ui/primitives/Button.js.map +1 -0
- package/lib/commonjs/ui/primitives/Card.js +50 -0
- package/lib/commonjs/ui/primitives/Card.js.map +1 -0
- package/lib/commonjs/ui/primitives/Checkbox.js +139 -0
- package/lib/commonjs/ui/primitives/Checkbox.js.map +1 -0
- package/lib/commonjs/ui/primitives/CountrySelect.js +288 -0
- package/lib/commonjs/ui/primitives/CountrySelect.js.map +1 -0
- package/lib/commonjs/ui/primitives/DatePicker.js +245 -0
- package/lib/commonjs/ui/primitives/DatePicker.js.map +1 -0
- package/lib/commonjs/ui/primitives/Input.js +101 -0
- package/lib/commonjs/ui/primitives/Input.js.map +1 -0
- package/lib/commonjs/ui/primitives/Select.js +209 -0
- package/lib/commonjs/ui/primitives/Select.js.map +1 -0
- package/lib/commonjs/ui/primitives/Spinner.js +25 -0
- package/lib/commonjs/ui/primitives/Spinner.js.map +1 -0
- package/lib/commonjs/ui/primitives/index.js +69 -0
- package/lib/commonjs/ui/primitives/index.js.map +1 -0
- package/lib/commonjs/ui/theme/ThemeProvider.js +74 -0
- package/lib/commonjs/ui/theme/ThemeProvider.js.map +1 -0
- package/lib/commonjs/ui/theme/index.js +68 -0
- package/lib/commonjs/ui/theme/index.js.map +1 -0
- package/lib/commonjs/ui/theme/tokens.js +154 -0
- package/lib/commonjs/ui/theme/tokens.js.map +1 -0
- package/lib/commonjs/utils/EventEmitter.js +144 -0
- package/lib/commonjs/utils/EventEmitter.js.map +1 -0
- package/lib/commonjs/utils/base64.js +53 -0
- package/lib/commonjs/utils/base64.js.map +1 -0
- package/lib/commonjs/utils/deviceFingerprint.js +132 -0
- package/lib/commonjs/utils/deviceFingerprint.js.map +1 -0
- package/lib/commonjs/utils/documentTypeOptions.js +35 -0
- package/lib/commonjs/utils/documentTypeOptions.js.map +1 -0
- package/lib/commonjs/utils/googleMapsPreflight.js +77 -0
- package/lib/commonjs/utils/googleMapsPreflight.js.map +1 -0
- package/lib/commonjs/utils/hmac.js +58 -0
- package/lib/commonjs/utils/hmac.js.map +1 -0
- package/lib/commonjs/utils/iso3166Countries.js +98 -0
- package/lib/commonjs/utils/iso3166Countries.js.map +1 -0
- package/lib/commonjs/utils/jpegFromUri.js +44 -0
- package/lib/commonjs/utils/jpegFromUri.js.map +1 -0
- package/lib/commonjs/utils/keepAwake.js +58 -0
- package/lib/commonjs/utils/keepAwake.js.map +1 -0
- package/lib/commonjs/utils/log.js +42 -0
- package/lib/commonjs/utils/log.js.map +1 -0
- package/lib/commonjs/utils/osGeocoder.js +70 -0
- package/lib/commonjs/utils/osGeocoder.js.map +1 -0
- package/lib/commonjs/utils/parseGoogleAddressComponents.js +74 -0
- package/lib/commonjs/utils/parseGoogleAddressComponents.js.map +1 -0
- package/lib/commonjs/utils/personNameNormalize.js +24 -0
- package/lib/commonjs/utils/personNameNormalize.js.map +1 -0
- package/lib/commonjs/utils/sdkError.js +34 -0
- package/lib/commonjs/utils/sdkError.js.map +1 -0
- package/lib/commonjs/utils/sdkVersion.js +13 -0
- package/lib/commonjs/utils/sdkVersion.js.map +1 -0
- package/lib/commonjs/utils/stepConfig.js +65 -0
- package/lib/commonjs/utils/stepConfig.js.map +1 -0
- package/lib/commonjs/utils/taxInfoConfig.js +19 -0
- package/lib/commonjs/utils/taxInfoConfig.js.map +1 -0
- package/lib/module/camera/AddressSearchBar.js +299 -0
- package/lib/module/camera/AddressSearchBar.js.map +1 -0
- package/lib/module/camera/DocumentCapture.js +500 -0
- package/lib/module/camera/DocumentCapture.js.map +1 -0
- package/lib/module/camera/LivenessCamera.js +529 -0
- package/lib/module/camera/LivenessCamera.js.map +1 -0
- package/lib/module/camera/MapAddressPicker.js +337 -0
- package/lib/module/camera/MapAddressPicker.js.map +1 -0
- package/lib/module/core/VelionOnboarding.js +811 -0
- package/lib/module/core/VelionOnboarding.js.map +1 -0
- package/lib/module/core/sessionDeclinedCopy.js +52 -0
- package/lib/module/core/sessionDeclinedCopy.js.map +1 -0
- package/lib/module/core/sessionStateMapper.js +128 -0
- package/lib/module/core/sessionStateMapper.js.map +1 -0
- package/lib/module/core/sseReasonMessages.js +446 -0
- package/lib/module/core/sseReasonMessages.js.map +1 -0
- package/lib/module/data/iso3166Alpha2Codes.json +1 -0
- package/lib/module/data/iso3166CountryNames.json +251 -0
- package/lib/module/i18n/index.js +25 -0
- package/lib/module/i18n/index.js.map +1 -0
- package/lib/module/i18n/strings/en.js +257 -0
- package/lib/module/i18n/strings/en.js.map +1 -0
- package/lib/module/i18n/strings/es.js +262 -0
- package/lib/module/i18n/strings/es.js.map +1 -0
- package/lib/module/index.js +36 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/steps/AddressInfoStep.js +646 -0
- package/lib/module/steps/AddressInfoStep.js.map +1 -0
- package/lib/module/steps/DocumentsOcrStep.js +391 -0
- package/lib/module/steps/DocumentsOcrStep.js.map +1 -0
- package/lib/module/steps/EmailContactStep.js +140 -0
- package/lib/module/steps/EmailContactStep.js.map +1 -0
- package/lib/module/steps/EmailOtpStep.js +215 -0
- package/lib/module/steps/EmailOtpStep.js.map +1 -0
- package/lib/module/steps/FaceMatchStep.js +161 -0
- package/lib/module/steps/FaceMatchStep.js.map +1 -0
- package/lib/module/steps/FingerprintStep.js +87 -0
- package/lib/module/steps/FingerprintStep.js.map +1 -0
- package/lib/module/steps/HumanBasicInfoStep.js +238 -0
- package/lib/module/steps/HumanBasicInfoStep.js.map +1 -0
- package/lib/module/steps/HumanExtendedInfoStep.js +263 -0
- package/lib/module/steps/HumanExtendedInfoStep.js.map +1 -0
- package/lib/module/steps/LegalBasicInfoStep.js +183 -0
- package/lib/module/steps/LegalBasicInfoStep.js.map +1 -0
- package/lib/module/steps/LegalExtendedInfoStep.js +161 -0
- package/lib/module/steps/LegalExtendedInfoStep.js.map +1 -0
- package/lib/module/steps/LivenessMatchStep.js +701 -0
- package/lib/module/steps/LivenessMatchStep.js.map +1 -0
- package/lib/module/steps/PhoneContactStep.js +141 -0
- package/lib/module/steps/PhoneContactStep.js.map +1 -0
- package/lib/module/steps/PhoneOtpStep.js +214 -0
- package/lib/module/steps/PhoneOtpStep.js.map +1 -0
- package/lib/module/steps/SwornDeclarationStep.js +191 -0
- package/lib/module/steps/SwornDeclarationStep.js.map +1 -0
- package/lib/module/steps/TaxInfoStep.js +239 -0
- package/lib/module/steps/TaxInfoStep.js.map +1 -0
- package/lib/module/steps/TermsAndConditionsStep.js +233 -0
- package/lib/module/steps/TermsAndConditionsStep.js.map +1 -0
- package/lib/module/steps/_shared.js +33 -0
- package/lib/module/steps/_shared.js.map +1 -0
- package/lib/module/steps/types.js +4 -0
- package/lib/module/steps/types.js.map +1 -0
- package/lib/module/transport/api.js +173 -0
- package/lib/module/transport/api.js.map +1 -0
- package/lib/module/transport/irisWebSocket.js +115 -0
- package/lib/module/transport/irisWebSocket.js.map +1 -0
- package/lib/module/transport/secureUrl.js +45 -0
- package/lib/module/transport/secureUrl.js.map +1 -0
- package/lib/module/transport/sse.js +242 -0
- package/lib/module/transport/sse.js.map +1 -0
- package/lib/module/types/index.js +457 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/ui/MapFallbackBoundary.js +37 -0
- package/lib/module/ui/MapFallbackBoundary.js.map +1 -0
- package/lib/module/ui/StepShell.js +114 -0
- package/lib/module/ui/StepShell.js.map +1 -0
- package/lib/module/ui/VelionOnboardingScreen.js +212 -0
- package/lib/module/ui/VelionOnboardingScreen.js.map +1 -0
- package/lib/module/ui/forms/index.js +5 -0
- package/lib/module/ui/forms/index.js.map +1 -0
- package/lib/module/ui/forms/useInlineValidation.js +84 -0
- package/lib/module/ui/forms/useInlineValidation.js.map +1 -0
- package/lib/module/ui/forms/validators.js +27 -0
- package/lib/module/ui/forms/validators.js.map +1 -0
- package/lib/module/ui/icons/HomeHeartIcon.js +33 -0
- package/lib/module/ui/icons/HomeHeartIcon.js.map +1 -0
- package/lib/module/ui/icons/StepIcon.js +55 -0
- package/lib/module/ui/icons/StepIcon.js.map +1 -0
- package/lib/module/ui/overlays/AnalyzingOverlay.js +279 -0
- package/lib/module/ui/overlays/AnalyzingOverlay.js.map +1 -0
- package/lib/module/ui/overlays/LoadingOverlay.js +104 -0
- package/lib/module/ui/overlays/LoadingOverlay.js.map +1 -0
- package/lib/module/ui/overlays/ProgressBar.js +90 -0
- package/lib/module/ui/overlays/ProgressBar.js.map +1 -0
- package/lib/module/ui/overlays/RetryDialog.js +121 -0
- package/lib/module/ui/overlays/RetryDialog.js.map +1 -0
- package/lib/module/ui/overlays/index.js +6 -0
- package/lib/module/ui/overlays/index.js.map +1 -0
- package/lib/module/ui/primitives/Banner.js +77 -0
- package/lib/module/ui/primitives/Banner.js.map +1 -0
- package/lib/module/ui/primitives/Button.js +138 -0
- package/lib/module/ui/primitives/Button.js.map +1 -0
- package/lib/module/ui/primitives/Card.js +46 -0
- package/lib/module/ui/primitives/Card.js.map +1 -0
- package/lib/module/ui/primitives/Checkbox.js +136 -0
- package/lib/module/ui/primitives/Checkbox.js.map +1 -0
- package/lib/module/ui/primitives/CountrySelect.js +284 -0
- package/lib/module/ui/primitives/CountrySelect.js.map +1 -0
- package/lib/module/ui/primitives/DatePicker.js +241 -0
- package/lib/module/ui/primitives/DatePicker.js.map +1 -0
- package/lib/module/ui/primitives/Input.js +97 -0
- package/lib/module/ui/primitives/Input.js.map +1 -0
- package/lib/module/ui/primitives/Select.js +205 -0
- package/lib/module/ui/primitives/Select.js.map +1 -0
- package/lib/module/ui/primitives/Spinner.js +21 -0
- package/lib/module/ui/primitives/Spinner.js.map +1 -0
- package/lib/module/ui/primitives/index.js +12 -0
- package/lib/module/ui/primitives/index.js.map +1 -0
- package/lib/module/ui/theme/ThemeProvider.js +67 -0
- package/lib/module/ui/theme/ThemeProvider.js.map +1 -0
- package/lib/module/ui/theme/index.js +5 -0
- package/lib/module/ui/theme/index.js.map +1 -0
- package/lib/module/ui/theme/tokens.js +145 -0
- package/lib/module/ui/theme/tokens.js.map +1 -0
- package/lib/module/utils/EventEmitter.js +139 -0
- package/lib/module/utils/EventEmitter.js.map +1 -0
- package/lib/module/utils/base64.js +47 -0
- package/lib/module/utils/base64.js.map +1 -0
- package/lib/module/utils/deviceFingerprint.js +129 -0
- package/lib/module/utils/deviceFingerprint.js.map +1 -0
- package/lib/module/utils/documentTypeOptions.js +31 -0
- package/lib/module/utils/documentTypeOptions.js.map +1 -0
- package/lib/module/utils/googleMapsPreflight.js +73 -0
- package/lib/module/utils/googleMapsPreflight.js.map +1 -0
- package/lib/module/utils/hmac.js +53 -0
- package/lib/module/utils/hmac.js.map +1 -0
- package/lib/module/utils/iso3166Countries.js +92 -0
- package/lib/module/utils/iso3166Countries.js.map +1 -0
- package/lib/module/utils/jpegFromUri.js +40 -0
- package/lib/module/utils/jpegFromUri.js.map +1 -0
- package/lib/module/utils/keepAwake.js +53 -0
- package/lib/module/utils/keepAwake.js.map +1 -0
- package/lib/module/utils/log.js +37 -0
- package/lib/module/utils/log.js.map +1 -0
- package/lib/module/utils/osGeocoder.js +65 -0
- package/lib/module/utils/osGeocoder.js.map +1 -0
- package/lib/module/utils/parseGoogleAddressComponents.js +69 -0
- package/lib/module/utils/parseGoogleAddressComponents.js.map +1 -0
- package/lib/module/utils/personNameNormalize.js +20 -0
- package/lib/module/utils/personNameNormalize.js.map +1 -0
- package/lib/module/utils/sdkError.js +29 -0
- package/lib/module/utils/sdkError.js.map +1 -0
- package/lib/module/utils/sdkVersion.js +9 -0
- package/lib/module/utils/sdkVersion.js.map +1 -0
- package/lib/module/utils/stepConfig.js +59 -0
- package/lib/module/utils/stepConfig.js.map +1 -0
- package/lib/module/utils/taxInfoConfig.js +15 -0
- package/lib/module/utils/taxInfoConfig.js.map +1 -0
- package/lib/typescript/camera/AddressSearchBar.d.ts +37 -0
- package/lib/typescript/camera/AddressSearchBar.d.ts.map +1 -0
- package/lib/typescript/camera/DocumentCapture.d.ts +34 -0
- package/lib/typescript/camera/DocumentCapture.d.ts.map +1 -0
- package/lib/typescript/camera/LivenessCamera.d.ts +50 -0
- package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -0
- package/lib/typescript/camera/MapAddressPicker.d.ts +57 -0
- package/lib/typescript/camera/MapAddressPicker.d.ts.map +1 -0
- package/lib/typescript/core/VelionOnboarding.d.ts +115 -0
- package/lib/typescript/core/VelionOnboarding.d.ts.map +1 -0
- package/lib/typescript/core/sessionDeclinedCopy.d.ts +16 -0
- package/lib/typescript/core/sessionDeclinedCopy.d.ts.map +1 -0
- package/lib/typescript/core/sessionStateMapper.d.ts +33 -0
- package/lib/typescript/core/sessionStateMapper.d.ts.map +1 -0
- package/lib/typescript/core/sseReasonMessages.d.ts +20 -0
- package/lib/typescript/core/sseReasonMessages.d.ts.map +1 -0
- package/lib/typescript/i18n/index.d.ts +13 -0
- package/lib/typescript/i18n/index.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/en.d.ts +3 -0
- package/lib/typescript/i18n/strings/en.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/es.d.ts +260 -0
- package/lib/typescript/i18n/strings/es.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +26 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/steps/AddressInfoStep.d.ts +26 -0
- package/lib/typescript/steps/AddressInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/DocumentsOcrStep.d.ts +26 -0
- package/lib/typescript/steps/DocumentsOcrStep.d.ts.map +1 -0
- package/lib/typescript/steps/EmailContactStep.d.ts +15 -0
- package/lib/typescript/steps/EmailContactStep.d.ts.map +1 -0
- package/lib/typescript/steps/EmailOtpStep.d.ts +21 -0
- package/lib/typescript/steps/EmailOtpStep.d.ts.map +1 -0
- package/lib/typescript/steps/FaceMatchStep.d.ts +27 -0
- package/lib/typescript/steps/FaceMatchStep.d.ts.map +1 -0
- package/lib/typescript/steps/FingerprintStep.d.ts +25 -0
- package/lib/typescript/steps/FingerprintStep.d.ts.map +1 -0
- package/lib/typescript/steps/HumanBasicInfoStep.d.ts +25 -0
- package/lib/typescript/steps/HumanBasicInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/HumanExtendedInfoStep.d.ts +23 -0
- package/lib/typescript/steps/HumanExtendedInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/LegalBasicInfoStep.d.ts +17 -0
- package/lib/typescript/steps/LegalBasicInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/LegalExtendedInfoStep.d.ts +17 -0
- package/lib/typescript/steps/LegalExtendedInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/LivenessMatchStep.d.ts +26 -0
- package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -0
- package/lib/typescript/steps/PhoneContactStep.d.ts +15 -0
- package/lib/typescript/steps/PhoneContactStep.d.ts.map +1 -0
- package/lib/typescript/steps/PhoneOtpStep.d.ts +19 -0
- package/lib/typescript/steps/PhoneOtpStep.d.ts.map +1 -0
- package/lib/typescript/steps/SwornDeclarationStep.d.ts +20 -0
- package/lib/typescript/steps/SwornDeclarationStep.d.ts.map +1 -0
- package/lib/typescript/steps/TaxInfoStep.d.ts +19 -0
- package/lib/typescript/steps/TaxInfoStep.d.ts.map +1 -0
- package/lib/typescript/steps/TermsAndConditionsStep.d.ts +21 -0
- package/lib/typescript/steps/TermsAndConditionsStep.d.ts.map +1 -0
- package/lib/typescript/steps/_shared.d.ts +11 -0
- package/lib/typescript/steps/_shared.d.ts.map +1 -0
- package/lib/typescript/steps/types.d.ts +68 -0
- package/lib/typescript/steps/types.d.ts.map +1 -0
- package/lib/typescript/transport/api.d.ts +35 -0
- package/lib/typescript/transport/api.d.ts.map +1 -0
- package/lib/typescript/transport/irisWebSocket.d.ts +72 -0
- package/lib/typescript/transport/irisWebSocket.d.ts.map +1 -0
- package/lib/typescript/transport/secureUrl.d.ts +14 -0
- package/lib/typescript/transport/secureUrl.d.ts.map +1 -0
- package/lib/typescript/transport/sse.d.ts +54 -0
- package/lib/typescript/transport/sse.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +1010 -0
- package/lib/typescript/types/index.d.ts.map +1 -0
- package/lib/typescript/ui/MapFallbackBoundary.d.ts +28 -0
- package/lib/typescript/ui/MapFallbackBoundary.d.ts.map +1 -0
- package/lib/typescript/ui/StepShell.d.ts +19 -0
- package/lib/typescript/ui/StepShell.d.ts.map +1 -0
- package/lib/typescript/ui/VelionOnboardingScreen.d.ts +19 -0
- package/lib/typescript/ui/VelionOnboardingScreen.d.ts.map +1 -0
- package/lib/typescript/ui/forms/index.d.ts +3 -0
- package/lib/typescript/ui/forms/index.d.ts.map +1 -0
- package/lib/typescript/ui/forms/useInlineValidation.d.ts +30 -0
- package/lib/typescript/ui/forms/useInlineValidation.d.ts.map +1 -0
- package/lib/typescript/ui/forms/validators.d.ts +11 -0
- package/lib/typescript/ui/forms/validators.d.ts.map +1 -0
- package/lib/typescript/ui/icons/HomeHeartIcon.d.ts +14 -0
- package/lib/typescript/ui/icons/HomeHeartIcon.d.ts.map +1 -0
- package/lib/typescript/ui/icons/StepIcon.d.ts +26 -0
- package/lib/typescript/ui/icons/StepIcon.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts +24 -0
- package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/LoadingOverlay.d.ts +19 -0
- package/lib/typescript/ui/overlays/LoadingOverlay.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/ProgressBar.d.ts +26 -0
- package/lib/typescript/ui/overlays/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/RetryDialog.d.ts +17 -0
- package/lib/typescript/ui/overlays/RetryDialog.d.ts.map +1 -0
- package/lib/typescript/ui/overlays/index.d.ts +4 -0
- package/lib/typescript/ui/overlays/index.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Banner.d.ts +11 -0
- package/lib/typescript/ui/primitives/Banner.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Button.d.ts +27 -0
- package/lib/typescript/ui/primitives/Button.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Card.d.ts +10 -0
- package/lib/typescript/ui/primitives/Card.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Checkbox.d.ts +25 -0
- package/lib/typescript/ui/primitives/Checkbox.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/CountrySelect.d.ts +31 -0
- package/lib/typescript/ui/primitives/CountrySelect.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/DatePicker.d.ts +42 -0
- package/lib/typescript/ui/primitives/DatePicker.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Input.d.ts +17 -0
- package/lib/typescript/ui/primitives/Input.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Select.d.ts +26 -0
- package/lib/typescript/ui/primitives/Select.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/Spinner.d.ts +10 -0
- package/lib/typescript/ui/primitives/Spinner.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/index.d.ts +10 -0
- package/lib/typescript/ui/primitives/index.d.ts.map +1 -0
- package/lib/typescript/ui/theme/ThemeProvider.d.ts +23 -0
- package/lib/typescript/ui/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/ui/theme/index.d.ts +3 -0
- package/lib/typescript/ui/theme/index.d.ts.map +1 -0
- package/lib/typescript/ui/theme/tokens.d.ts +42 -0
- package/lib/typescript/ui/theme/tokens.d.ts.map +1 -0
- package/lib/typescript/utils/EventEmitter.d.ts +98 -0
- package/lib/typescript/utils/EventEmitter.d.ts.map +1 -0
- package/lib/typescript/utils/base64.d.ts +19 -0
- package/lib/typescript/utils/base64.d.ts.map +1 -0
- package/lib/typescript/utils/deviceFingerprint.d.ts +42 -0
- package/lib/typescript/utils/deviceFingerprint.d.ts.map +1 -0
- package/lib/typescript/utils/documentTypeOptions.d.ts +13 -0
- package/lib/typescript/utils/documentTypeOptions.d.ts.map +1 -0
- package/lib/typescript/utils/googleMapsPreflight.d.ts +44 -0
- package/lib/typescript/utils/googleMapsPreflight.d.ts.map +1 -0
- package/lib/typescript/utils/hmac.d.ts +39 -0
- package/lib/typescript/utils/hmac.d.ts.map +1 -0
- package/lib/typescript/utils/iso3166Countries.d.ts +27 -0
- package/lib/typescript/utils/iso3166Countries.d.ts.map +1 -0
- package/lib/typescript/utils/jpegFromUri.d.ts +29 -0
- package/lib/typescript/utils/jpegFromUri.d.ts.map +1 -0
- package/lib/typescript/utils/keepAwake.d.ts +16 -0
- package/lib/typescript/utils/keepAwake.d.ts.map +1 -0
- package/lib/typescript/utils/log.d.ts +18 -0
- package/lib/typescript/utils/log.d.ts.map +1 -0
- package/lib/typescript/utils/osGeocoder.d.ts +38 -0
- package/lib/typescript/utils/osGeocoder.d.ts.map +1 -0
- package/lib/typescript/utils/parseGoogleAddressComponents.d.ts +43 -0
- package/lib/typescript/utils/parseGoogleAddressComponents.d.ts.map +1 -0
- package/lib/typescript/utils/personNameNormalize.d.ts +10 -0
- package/lib/typescript/utils/personNameNormalize.d.ts.map +1 -0
- package/lib/typescript/utils/sdkError.d.ts +14 -0
- package/lib/typescript/utils/sdkError.d.ts.map +1 -0
- package/lib/typescript/utils/sdkVersion.d.ts +7 -0
- package/lib/typescript/utils/sdkVersion.d.ts.map +1 -0
- package/lib/typescript/utils/stepConfig.d.ts +8 -0
- package/lib/typescript/utils/stepConfig.d.ts.map +1 -0
- package/lib/typescript/utils/taxInfoConfig.d.ts +7 -0
- package/lib/typescript/utils/taxInfoConfig.d.ts.map +1 -0
- package/package.json +99 -0
- package/src/camera/AddressSearchBar.tsx +363 -0
- package/src/camera/DocumentCapture.tsx +505 -0
- package/src/camera/LivenessCamera.tsx +602 -0
- package/src/camera/MapAddressPicker.tsx +397 -0
- package/src/core/VelionOnboarding.ts +974 -0
- package/src/core/sessionDeclinedCopy.ts +76 -0
- package/src/core/sessionStateMapper.ts +167 -0
- package/src/core/sseReasonMessages.ts +531 -0
- package/src/data/iso3166Alpha2Codes.json +1 -0
- package/src/data/iso3166CountryNames.json +251 -0
- package/src/i18n/index.ts +26 -0
- package/src/i18n/strings/en.ts +289 -0
- package/src/i18n/strings/es.ts +291 -0
- package/src/index.ts +137 -0
- package/src/steps/AddressInfoStep.tsx +726 -0
- package/src/steps/DocumentsOcrStep.tsx +472 -0
- package/src/steps/EmailContactStep.tsx +159 -0
- package/src/steps/EmailOtpStep.tsx +250 -0
- package/src/steps/FaceMatchStep.tsx +177 -0
- package/src/steps/FingerprintStep.tsx +99 -0
- package/src/steps/HumanBasicInfoStep.tsx +274 -0
- package/src/steps/HumanExtendedInfoStep.tsx +353 -0
- package/src/steps/LegalBasicInfoStep.tsx +205 -0
- package/src/steps/LegalExtendedInfoStep.tsx +171 -0
- package/src/steps/LivenessMatchStep.tsx +846 -0
- package/src/steps/PhoneContactStep.tsx +160 -0
- package/src/steps/PhoneOtpStep.tsx +249 -0
- package/src/steps/SwornDeclarationStep.tsx +220 -0
- package/src/steps/TaxInfoStep.tsx +277 -0
- package/src/steps/TermsAndConditionsStep.tsx +261 -0
- package/src/steps/_shared.ts +44 -0
- package/src/steps/types.ts +72 -0
- package/src/transport/api.ts +257 -0
- package/src/transport/irisWebSocket.ts +186 -0
- package/src/transport/secureUrl.ts +47 -0
- package/src/transport/sse.ts +310 -0
- package/src/types/index.ts +1198 -0
- package/src/ui/MapFallbackBoundary.tsx +46 -0
- package/src/ui/StepShell.tsx +137 -0
- package/src/ui/VelionOnboardingScreen.tsx +223 -0
- package/src/ui/forms/index.ts +12 -0
- package/src/ui/forms/useInlineValidation.ts +115 -0
- package/src/ui/forms/validators.ts +29 -0
- package/src/ui/icons/HomeHeartIcon.tsx +34 -0
- package/src/ui/icons/StepIcon.tsx +77 -0
- package/src/ui/overlays/AnalyzingOverlay.tsx +323 -0
- package/src/ui/overlays/LoadingOverlay.tsx +115 -0
- package/src/ui/overlays/ProgressBar.tsx +99 -0
- package/src/ui/overlays/RetryDialog.tsx +128 -0
- package/src/ui/overlays/index.ts +3 -0
- package/src/ui/primitives/Banner.tsx +81 -0
- package/src/ui/primitives/Button.tsx +164 -0
- package/src/ui/primitives/Card.tsx +55 -0
- package/src/ui/primitives/Checkbox.tsx +153 -0
- package/src/ui/primitives/CountrySelect.tsx +356 -0
- package/src/ui/primitives/DatePicker.tsx +266 -0
- package/src/ui/primitives/Input.tsx +110 -0
- package/src/ui/primitives/Select.tsx +259 -0
- package/src/ui/primitives/Spinner.tsx +17 -0
- package/src/ui/primitives/index.ts +9 -0
- package/src/ui/theme/ThemeProvider.tsx +102 -0
- package/src/ui/theme/index.ts +17 -0
- package/src/ui/theme/tokens.ts +159 -0
- package/src/utils/EventEmitter.ts +155 -0
- package/src/utils/base64.ts +44 -0
- package/src/utils/deviceFingerprint.ts +184 -0
- package/src/utils/documentTypeOptions.ts +31 -0
- package/src/utils/googleMapsPreflight.ts +72 -0
- package/src/utils/hmac.ts +61 -0
- package/src/utils/iso3166Countries.ts +111 -0
- package/src/utils/jpegFromUri.ts +42 -0
- package/src/utils/keepAwake.ts +62 -0
- package/src/utils/log.ts +37 -0
- package/src/utils/osGeocoder.ts +75 -0
- package/src/utils/parseGoogleAddressComponents.ts +123 -0
- package/src/utils/personNameNormalize.ts +17 -0
- package/src/utils/sdkError.ts +40 -0
- package/src/utils/sdkVersion.ts +6 -0
- package/src/utils/stepConfig.ts +75 -0
- package/src/utils/taxInfoConfig.ts +14 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reverse geocoding via the OS-native geocoder, bypassing Google's REST API
|
|
5
|
+
* entirely.
|
|
6
|
+
*
|
|
7
|
+
* Why this exists:
|
|
8
|
+
* - The Google Geocoding Web Service is HTTP REST. It does not honour
|
|
9
|
+
* iOS/Android application restrictions on the API key, so a key tightly
|
|
10
|
+
* locked to a bundle ID still fails with REQUEST_DENIED when called from
|
|
11
|
+
* fetch().
|
|
12
|
+
* - The OS geocoder (CLGeocoder on iOS / android.location.Geocoder on
|
|
13
|
+
* Android) needs no Google key and respects the platform conventions
|
|
14
|
+
* users expect. Coverage in urban LATAM is excellent; rural coverage on
|
|
15
|
+
* iOS uses Apple Maps (lower than Google in remote zones) but the
|
|
16
|
+
* downstream OCR step normally recovers the printed address either way.
|
|
17
|
+
* - Keeps the SDK to one Google Maps key whose only purpose is rendering
|
|
18
|
+
* the map via the native Maps SDK — that one IS protected by the iOS /
|
|
19
|
+
* Android app restriction.
|
|
20
|
+
*
|
|
21
|
+
* Returns the same `ParsedAddressFields` shape that the previous Google
|
|
22
|
+
* Geocoding caller produced, so downstream code (`AddressDetailsForm`,
|
|
23
|
+
* payload assembly) doesn't change.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import * as Location from 'expo-location';
|
|
27
|
+
import { log } from './log';
|
|
28
|
+
/**
|
|
29
|
+
* Returns parsed structured address fields, or `null` when the OS geocoder
|
|
30
|
+
* has no match.
|
|
31
|
+
*/
|
|
32
|
+
export async function reverseGeocode(args) {
|
|
33
|
+
let results;
|
|
34
|
+
try {
|
|
35
|
+
results = await Location.reverseGeocodeAsync({
|
|
36
|
+
latitude: args.latitude,
|
|
37
|
+
longitude: args.longitude
|
|
38
|
+
});
|
|
39
|
+
} catch (err) {
|
|
40
|
+
log.warn('[os-geocoder] reverse failed', err);
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (!results || results.length === 0) {
|
|
44
|
+
log.info('[os-geocoder] no results');
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const top = results[0];
|
|
48
|
+
const isoCc = top.isoCountryCode ?? '';
|
|
49
|
+
return {
|
|
50
|
+
country: isoCc.toUpperCase(),
|
|
51
|
+
state: top.region ?? '',
|
|
52
|
+
city: top.city ?? '',
|
|
53
|
+
// OS reports neighborhoods inconsistently across platforms; map `district`
|
|
54
|
+
// (Apple) / `subregion` (Android fallback) to our `district` field and
|
|
55
|
+
// leave `neighborhood` empty so the user can fill it manually.
|
|
56
|
+
district: top.district ?? top.subregion ?? '',
|
|
57
|
+
neighborhood: '',
|
|
58
|
+
street: top.street ?? '',
|
|
59
|
+
number: top.streetNumber ?? '',
|
|
60
|
+
zip_code: top.postalCode ?? '',
|
|
61
|
+
latitude: args.latitude,
|
|
62
|
+
longitude: args.longitude
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=osGeocoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Location","log","reverseGeocode","args","results","reverseGeocodeAsync","latitude","longitude","err","warn","length","info","top","isoCc","isoCountryCode","country","toUpperCase","state","region","city","district","subregion","neighborhood","street","number","streetNumber","zip_code","postalCode"],"sourceRoot":"../../../src","sources":["utils/osGeocoder.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,QAAQ,MAAM,eAAe;AAIzC,SAASC,GAAG,QAAQ,OAAO;AAS3B;AACA;AACA;AACA;AACA,OAAO,eAAeC,cAAcA,CAClCC,IAAwB,EACyD;EACjF,IAAIC,OAA2C;EAC/C,IAAI;IACFA,OAAO,GAAG,MAAMJ,QAAQ,CAACK,mBAAmB,CAAC;MAC3CC,QAAQ,EAAEH,IAAI,CAACG,QAAQ;MACvBC,SAAS,EAAEJ,IAAI,CAACI;IAClB,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,GAAG,EAAE;IACZP,GAAG,CAACQ,IAAI,CAAC,8BAA8B,EAAED,GAAG,CAAC;IAC7C,OAAO,IAAI;EACb;EACA,IAAI,CAACJ,OAAO,IAAIA,OAAO,CAACM,MAAM,KAAK,CAAC,EAAE;IACpCT,GAAG,CAACU,IAAI,CAAC,0BAA0B,CAAC;IACpC,OAAO,IAAI;EACb;EACA,MAAMC,GAAG,GAAGR,OAAO,CAAC,CAAC,CAAE;EACvB,MAAMS,KAAK,GAAGD,GAAG,CAACE,cAAc,IAAI,EAAE;EACtC,OAAO;IACLC,OAAO,EAAEF,KAAK,CAACG,WAAW,CAAC,CAAC;IAC5BC,KAAK,EAAEL,GAAG,CAACM,MAAM,IAAI,EAAE;IACvBC,IAAI,EAAEP,GAAG,CAACO,IAAI,IAAI,EAAE;IACpB;IACA;IACA;IACAC,QAAQ,EAAER,GAAG,CAACQ,QAAQ,IAAIR,GAAG,CAACS,SAAS,IAAI,EAAE;IAC7CC,YAAY,EAAE,EAAE;IAChBC,MAAM,EAAEX,GAAG,CAACW,MAAM,IAAI,EAAE;IACxBC,MAAM,EAAEZ,GAAG,CAACa,YAAY,IAAI,EAAE;IAC9BC,QAAQ,EAAEd,GAAG,CAACe,UAAU,IAAI,EAAE;IAC9BrB,QAAQ,EAAEH,IAAI,CAACG,QAAQ;IACvBC,SAAS,EAAEJ,IAAI,CAACI;EAClB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Maps Google Geocoder / Places `address_components` into
|
|
5
|
+
* `AddressInfoPayload` fields.
|
|
6
|
+
*
|
|
7
|
+
* The wire shape used here is whatever the Google Geocoding REST API
|
|
8
|
+
* returns: `{ long_name, short_name, types: string[] }`.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
function pick(components, type, useShort) {
|
|
12
|
+
const c = components.find(x => x.types.includes(type));
|
|
13
|
+
if (!c) return '';
|
|
14
|
+
return useShort ? c.short_name : c.long_name;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Parses `address_components` from a Geocoder result or Place result.
|
|
19
|
+
* Applies fallbacks so required API fields are usually non-empty when Google
|
|
20
|
+
* returns a result.
|
|
21
|
+
*/
|
|
22
|
+
export function parseGoogleAddressComponents(components, formattedAddress, lat, lng) {
|
|
23
|
+
const list = components ?? [];
|
|
24
|
+
const firstLine = formattedAddress?.split(',')[0]?.trim() ?? '';
|
|
25
|
+
const country = pick(list, 'country', true).toUpperCase();
|
|
26
|
+
const state = pick(list, 'administrative_area_level_1', false) || pick(list, 'administrative_area_level_2', false);
|
|
27
|
+
const city = pick(list, 'locality', false) || pick(list, 'administrative_area_level_2', false) || pick(list, 'administrative_area_level_3', false) || pick(list, 'sublocality_level_1', false);
|
|
28
|
+
const district = pick(list, 'sublocality_level_1', false) || pick(list, 'sublocality', false) || pick(list, 'administrative_area_level_3', false) || undefined;
|
|
29
|
+
const neighborhood = pick(list, 'neighborhood', false) || undefined;
|
|
30
|
+
const route = pick(list, 'route', false);
|
|
31
|
+
const streetNumber = pick(list, 'street_number', false);
|
|
32
|
+
const postal = pick(list, 'postal_code', false);
|
|
33
|
+
let street = route;
|
|
34
|
+
if (!street && firstLine) street = firstLine;
|
|
35
|
+
if (!street) street = '—';
|
|
36
|
+
const number = streetNumber || 'S/N';
|
|
37
|
+
const zip_code = postal || '0000';
|
|
38
|
+
let cityOut = city;
|
|
39
|
+
if (!cityOut) cityOut = state || '—';
|
|
40
|
+
let stateOut = state;
|
|
41
|
+
if (!stateOut) stateOut = cityOut;
|
|
42
|
+
const out = {
|
|
43
|
+
country: country || 'XX',
|
|
44
|
+
state: stateOut,
|
|
45
|
+
city: cityOut,
|
|
46
|
+
street,
|
|
47
|
+
number,
|
|
48
|
+
zip_code,
|
|
49
|
+
latitude: lat,
|
|
50
|
+
longitude: lng
|
|
51
|
+
};
|
|
52
|
+
if (district) out.district = district;
|
|
53
|
+
if (neighborhood) out.neighborhood = neighborhood;
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* True when the parsed address has enough required fields to send to the
|
|
59
|
+
* backend.
|
|
60
|
+
*/
|
|
61
|
+
export function isAddressSelectionComplete(parsed, required = {}) {
|
|
62
|
+
const reqState = required.state !== false;
|
|
63
|
+
const reqCity = required.city !== false;
|
|
64
|
+
const reqStreet = required.street !== false;
|
|
65
|
+
const reqNumber = required.number !== false;
|
|
66
|
+
const reqPostal = required.postal !== false;
|
|
67
|
+
return parsed.country.length === 2 && (!reqState || parsed.state.length > 0) && (!reqCity || parsed.city.length > 0) && (!reqStreet || parsed.street.length > 0) && (!reqNumber || parsed.number.length > 0) && (!reqPostal || parsed.zip_code.length > 0);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=parseGoogleAddressComponents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["pick","components","type","useShort","c","find","x","types","includes","short_name","long_name","parseGoogleAddressComponents","formattedAddress","lat","lng","list","firstLine","split","trim","country","toUpperCase","state","city","district","undefined","neighborhood","route","streetNumber","postal","street","number","zip_code","cityOut","stateOut","out","latitude","longitude","isAddressSelectionComplete","parsed","required","reqState","reqCity","reqStreet","reqNumber","reqPostal","length"],"sourceRoot":"../../../src","sources":["utils/parseGoogleAddressComponents.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA,SAASA,IAAIA,CACXC,UAAoC,EACpCC,IAAY,EACZC,QAAiB,EACT;EACR,MAAMC,CAAC,GAAGH,UAAU,CAACI,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACC,QAAQ,CAACN,IAAI,CAAC,CAAC;EACxD,IAAI,CAACE,CAAC,EAAE,OAAO,EAAE;EACjB,OAAOD,QAAQ,GAAGC,CAAC,CAACK,UAAU,GAAGL,CAAC,CAACM,SAAS;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAC1CV,UAAuD,EACvDW,gBAAoC,EACpCC,GAAW,EACXC,GAAW,EACoD;EAC/D,MAAMC,IAAI,GAAGd,UAAU,IAAI,EAAE;EAC7B,MAAMe,SAAS,GAAGJ,gBA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,MAAM,GAAG,CAAC,CAAC,KACnC,CAACH,SAAS,IAAIJ,MAAM,CAACT,MAAM,CAACgB,MAAM,GAAG,CAAC,CAAC,KACvC,CAACF,SAAS,IAAIL,MAAM,CAACR,MAAM,CAACe,MAAM,GAAG,CAAC,CAAC,KACvC,CAACD,SAAS,IAAIN,MAAM,CAACP,QAAQ,CAACc,MAAM,GAAG,CAAC,CAAC;AAE9C","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Normalizes a single name field (given names or surnames) for API submission.
|
|
5
|
+
*
|
|
6
|
+
* - Trims leading/trailing whitespace
|
|
7
|
+
* - Applies Unicode NFC (composed form) for consistent encoding
|
|
8
|
+
* - Splits on any run of whitespace and rejoins with a single ASCII space,
|
|
9
|
+
* so multiple internal spaces or line breaks become one separator between words
|
|
10
|
+
*/
|
|
11
|
+
export function normalizePersonNameSegment(raw) {
|
|
12
|
+
const trimmed = raw.trim();
|
|
13
|
+
if (trimmed.length === 0) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
const nfc = trimmed.normalize('NFC');
|
|
17
|
+
const words = nfc.split(/\s+/).filter(w => w.length > 0);
|
|
18
|
+
return words.join(' ');
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=personNameNormalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["normalizePersonNameSegment","raw","trimmed","trim","length","nfc","normalize","words","split","filter","w","join"],"sourceRoot":"../../../src","sources":["utils/personNameNormalize.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,0BAA0BA,CAACC,GAAW,EAAU;EAC9D,MAAMC,OAAO,GAAGD,GAAG,CAACE,IAAI,CAAC,CAAC;EAC1B,IAAID,OAAO,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB,OAAO,EAAE;EACX;EACA,MAAMC,GAAG,GAAGH,OAAO,CAACI,SAAS,CAAC,KAAK,CAAC;EACpC,MAAMC,KAAK,GAAGF,GAAG,CAACG,KAAK,CAAC,KAAK,CAAC,CAACC,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACN,MAAM,GAAG,CAAC,CAAC;EAC1D,OAAOG,KAAK,CAACI,IAAI,CAAC,GAAG,CAAC;AACxB","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Helpers to normalize thrown values into SdkError for consistent onError delivery.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Returns true if the value looks like an SdkError (has code and message).
|
|
9
|
+
*/
|
|
10
|
+
export function isSdkError(value) {
|
|
11
|
+
return value != null && typeof value === 'object' && 'code' in value && typeof value.code === 'string' && 'message' in value && typeof value.message === 'string';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Normalizes any thrown value to an SdkError so it can be passed to rejectStep/onError.
|
|
16
|
+
* Use when catching in a flow that must always end with an event to the implementer.
|
|
17
|
+
*/
|
|
18
|
+
export function toSdkError(err, defaultCode, defaultMessage) {
|
|
19
|
+
if (isSdkError(err)) {
|
|
20
|
+
return err;
|
|
21
|
+
}
|
|
22
|
+
const message = err instanceof Error ? err.message : typeof err === 'string' ? err : defaultMessage;
|
|
23
|
+
return {
|
|
24
|
+
code: defaultCode,
|
|
25
|
+
message: message || defaultMessage,
|
|
26
|
+
cause: err
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=sdkError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isSdkError","value","code","message","toSdkError","err","defaultCode","defaultMessage","Error","cause"],"sourceRoot":"../../../src","sources":["utils/sdkError.ts"],"mappings":";;AAAA;AACA;AACA;;AAIA;AACA;AACA;AACA,OAAO,SAASA,UAAUA,CAACC,KAAc,EAAqB;EAC5D,OACEA,KAAK,IAAI,IAAI,IACb,OAAOA,KAAK,KAAK,QAAQ,IACzB,MAAM,IAAIA,KAAK,IACf,OAAQA,KAAK,CAAcC,IAAI,KAAK,QAAQ,IAC5C,SAAS,IAAID,KAAK,IAClB,OAAQA,KAAK,CAAcE,OAAO,KAAK,QAAQ;AAEnD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CACxBC,GAAY,EACZC,WAAyB,EACzBC,cAAsB,EACZ;EACV,IAAIP,UAAU,CAACK,GAAG,CAAC,EAAE;IACnB,OAAOA,GAAG;EACZ;EACA,MAAMF,OAAO,GACXE,GAAG,YAAYG,KAAK,GAAGH,GAAG,CAACF,OAAO,GAAG,OAAOE,GAAG,KAAK,QAAQ,GAAGA,GAAG,GAAGE,cAAc;EACrF,OAAO;IACLL,IAAI,EAAEI,WAAW;IACjBH,OAAO,EAAEA,OAAO,IAAII,cAAc;IAClCE,KAAK,EAAEJ;EACT,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Compile-time SDK version string sent on every authenticated request as
|
|
5
|
+
* `X-Velion-SDK-Version`. Bump it together with `sdk/package.json#version`
|
|
6
|
+
* on every release.
|
|
7
|
+
*/
|
|
8
|
+
export const SDK_VERSION = '0.1.0';
|
|
9
|
+
//# sourceMappingURL=sdkVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SDK_VERSION"],"sourceRoot":"../../../src","sources":["utils/sdkVersion.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,GAAG,OAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function resolveDocumentOptionsFromStepConfig(cfg) {
|
|
4
|
+
const rows = cfg?.accepted_country_documents;
|
|
5
|
+
if (!Array.isArray(rows)) return undefined;
|
|
6
|
+
const out = [];
|
|
7
|
+
for (const country of rows) {
|
|
8
|
+
const docs = country?.document_types;
|
|
9
|
+
if (!Array.isArray(docs)) continue;
|
|
10
|
+
for (const d of docs) {
|
|
11
|
+
const id = d?.id;
|
|
12
|
+
if (!id || typeof id !== 'string') continue;
|
|
13
|
+
out.push({
|
|
14
|
+
value: id,
|
|
15
|
+
label: typeof d.display_value === 'string' && d.display_value.trim().length > 0 ? d.display_value : id
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return out.length > 0 ? dedupeByValue(out) : undefined;
|
|
20
|
+
}
|
|
21
|
+
export function resolveCaptureModeFromStepConfig(cfg) {
|
|
22
|
+
const methods = cfg?.capture_methods;
|
|
23
|
+
if (!methods) return undefined;
|
|
24
|
+
const camera = methods.camera_scan !== false;
|
|
25
|
+
const upload = methods.upload !== false;
|
|
26
|
+
if (camera && upload) return 'both';
|
|
27
|
+
if (camera) return 'camera';
|
|
28
|
+
if (upload) return 'file';
|
|
29
|
+
return 'both';
|
|
30
|
+
}
|
|
31
|
+
export function resolveTermsFromStepConfig(cfg) {
|
|
32
|
+
const terms = cfg?.terms;
|
|
33
|
+
if (!Array.isArray(terms)) return undefined;
|
|
34
|
+
const parsed = [];
|
|
35
|
+
for (const [index, term] of terms.entries()) {
|
|
36
|
+
const title = typeof term?.title === 'string' ? term.title.trim() : '';
|
|
37
|
+
const url = typeof term?.url === 'string' ? term.url.trim() : '';
|
|
38
|
+
if (!title && !url) continue;
|
|
39
|
+
parsed.push({
|
|
40
|
+
id: `term-${index + 1}`,
|
|
41
|
+
description: title || url,
|
|
42
|
+
...(url && {
|
|
43
|
+
link: url
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return parsed.length > 0 ? parsed : undefined;
|
|
48
|
+
}
|
|
49
|
+
function dedupeByValue(options) {
|
|
50
|
+
const seen = new Set();
|
|
51
|
+
const out = [];
|
|
52
|
+
for (const opt of options) {
|
|
53
|
+
if (seen.has(opt.value)) continue;
|
|
54
|
+
seen.add(opt.value);
|
|
55
|
+
out.push(opt);
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=stepConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveDocumentOptionsFromStepConfig","cfg","rows","accepted_country_documents","Array","isArray","undefined","out","country","docs","document_types","d","id","push","value","label","display_value","trim","length","dedupeByValue","resolveCaptureModeFromStepConfig","methods","capture_methods","camera","camera_scan","upload","resolveTermsFromStepConfig","terms","parsed","index","term","entries","title","url","description","link","options","seen","Set","opt","has","add"],"sourceRoot":"../../../src","sources":["utils/stepConfig.ts"],"mappings":";;AAQA,OAAO,SAASA,oCAAoCA,CAClDC,GAAyC,EACY;EACrD,MAAMC,IAAI,GAAGD,GAAG,EAAEE,0BAA0B;EAC5C,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,IAAI,CAAC,EAAE,OAAOI,SAAS;EAC1C,MAAMC,GAA4C,GAAG,EAAE;EACvD,KAAK,MAAMC,OAAO,IAAIN,IAAI,EAAE;IAC1B,MAAMO,IAAI,GAAGD,OAAO,EAAEE,cAAc;IACpC,IAAI,CAACN,KAAK,CAACC,OAAO,CAACI,IAAI,CAAC,EAAE;IAC1B,KAAK,MAAME,CAAC,IAAIF,IAAI,EAAE;MACpB,MAAMG,EAAE,GAAGD,CAAC,EAAEC,EAAE;MAChB,IAAI,CAACA,EAAE,IAAI,OAAOA,EAAE,KAAK,QAAQ,EAAE;MACnCL,GAAG,CAACM,IAAI,CAAC;QACPC,KAAK,EAAEF,EAAE;QACTG,KAAK,EAAE,OAAOJ,CAAC,CAACK,aAAa,KAAK,QAAQ,IAAIL,CAAC,CAACK,aAAa,CAACC,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC,GAC3EP,CAAC,CAACK,aAAa,GACfJ;MACN,CA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F,KAAK,IAAIC,GAAG;MACzB,IAAIA,GAAG,IAAI;QAAEE,IAAI,EAAEF;MAAI,CAAC;IAC1B,CAAC,CAAC;EACJ;EACA,OAAOL,MAAM,CAACV,MAAM,GAAG,CAAC,GAAGU,MAAM,GAAGtB,SAAS;AAC/C;AAEA,SAASa,aAAaA,CACpBiB,OAAgD,EACP;EACzC,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;EAC9B,MAAM/B,GAA4C,GAAG,EAAE;EACvD,KAAK,MAAMgC,GAAG,IAAIH,OAAO,EAAE;IACzB,IAAIC,IAAI,CAACG,GAAG,CAACD,GAAG,CAACzB,KAAK,CAAC,EAAE;IACzBuB,IAAI,CAACI,GAAG,CAACF,GAAG,CAACzB,KAAK,CAAC;IACnBP,GAAG,CAACM,IAAI,CAAC0B,GAAG,CAAC;EACf;EACA,OAAOhC,GAAG;AACZ","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Normalizes selectable lists for TAX_INFO. Options come only from the backend
|
|
5
|
+
* `current_step.config.accepted_tax_information` (see TaxInfoModule); there are no SDK defaults.
|
|
6
|
+
*/
|
|
7
|
+
export function resolveTaxInfoConfig(config) {
|
|
8
|
+
const categories = config?.taxpayerCategories;
|
|
9
|
+
const fiscal = config?.fiscalIdentifierTypes;
|
|
10
|
+
return {
|
|
11
|
+
taxpayerCategories: Array.isArray(categories) ? categories : [],
|
|
12
|
+
fiscalIdentifierTypes: Array.isArray(fiscal) ? fiscal : []
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=taxInfoConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolveTaxInfoConfig","config","categories","taxpayerCategories","fiscal","fiscalIdentifierTypes","Array","isArray"],"sourceRoot":"../../../src","sources":["utils/taxInfoConfig.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASA,oBAAoBA,CAACC,MAA0C,EAAiB;EAC9F,MAAMC,UAAU,GAAGD,MAAM,EAAEE,kBAAkB;EAC7C,MAAMC,MAAM,GAAGH,MAAM,EAAEI,qBAAqB;EAC5C,OAAO;IACLF,kBAAkB,EAAEG,KAAK,CAACC,OAAO,CAACL,UAAU,CAAC,GAAGA,UAAU,GAAG,EAAE;IAC/DG,qBAAqB,EAAEC,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG;EAC1D,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Address search bar for the assisted ADDRESS_INFO flow.
|
|
3
|
+
*
|
|
4
|
+
* Uses the OS-native forward geocoder (`expo-location.geocodeAsync`) with a
|
|
5
|
+
* debounced TextInput. No Google REST calls, no API key, no native bridges.
|
|
6
|
+
*
|
|
7
|
+
* `geocodeAsync` returns coordinates only, so for each candidate we run a
|
|
8
|
+
* reverse geocode in parallel to produce a human-readable label (and the
|
|
9
|
+
* parsed address structure used by the rest of the flow). Limited to the
|
|
10
|
+
* top 5 candidates to bound the work per query.
|
|
11
|
+
*
|
|
12
|
+
* Trade-off vs Google Places autocomplete: this suggests when the user
|
|
13
|
+
* pauses typing (~400ms), not on every keystroke. Quality on Apple Maps
|
|
14
|
+
* (iOS) and Google Play Services geocoder (Android) is enough for urban
|
|
15
|
+
* LATAM addresses — for KYC the user usually knows their full address.
|
|
16
|
+
*/
|
|
17
|
+
import type { ParsedAddressFields } from '../utils/parseGoogleAddressComponents';
|
|
18
|
+
export interface AddressSuggestion {
|
|
19
|
+
label: string;
|
|
20
|
+
latitude: number;
|
|
21
|
+
longitude: number;
|
|
22
|
+
parsed: ParsedAddressFields & {
|
|
23
|
+
latitude: number;
|
|
24
|
+
longitude: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface AddressSearchBarProps {
|
|
28
|
+
placeholder: string;
|
|
29
|
+
searchingLabel: string;
|
|
30
|
+
noResultsLabel: string;
|
|
31
|
+
/** Called when the user picks a suggestion. */
|
|
32
|
+
onSelect: (suggestion: AddressSuggestion) => void;
|
|
33
|
+
/** Restrict matches to these ISO 3166-1 alpha-2 codes (best-effort filter). */
|
|
34
|
+
countryAllow?: ReadonlyArray<string> | undefined;
|
|
35
|
+
}
|
|
36
|
+
export declare function AddressSearchBar({ placeholder, searchingLabel, noResultsLabel, onSelect, countryAllow, }: AddressSearchBarProps): import("react").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=AddressSearchBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddressSearchBar.d.ts","sourceRoot":"","sources":["../../../src/camera/AddressSearchBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAsBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAKjF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,mBAAmB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CACvE;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,QAAQ,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,+EAA+E;IAC/E,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CAClD;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,YAAY,GACb,EAAE,qBAAqB,+BAwNvB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Full-screen document camera with an ID-1 frame guide.
|
|
3
|
+
*
|
|
4
|
+
* Uses `react-native-vision-camera` v4 in `photo` mode. Tapping the shutter
|
|
5
|
+
* triggers `takePhoto()` with `qualityPrioritization: 'balanced'`; the file
|
|
6
|
+
* URI is returned to the caller via `onCaptured`.
|
|
7
|
+
*
|
|
8
|
+
* Visual: dark scrim with a transparent rectangular cutout (ID-1 16:10 ratio
|
|
9
|
+
* by default). The cutout is the visible-only guide — we do NOT crop the
|
|
10
|
+
* image client-side because the server's OCR pipeline rejects soft crops.
|
|
11
|
+
* The user is asked to fill the frame; the backend handles edge detection.
|
|
12
|
+
*
|
|
13
|
+
* No edge detection / OpenCV port (intentional MVP scope per the brief).
|
|
14
|
+
*/
|
|
15
|
+
import { type PhotoFile } from 'react-native-vision-camera';
|
|
16
|
+
import type { DocumentOrientation, DocumentSide } from '../types';
|
|
17
|
+
export interface DocumentCaptureProps {
|
|
18
|
+
side: DocumentSide;
|
|
19
|
+
orientation: DocumentOrientation;
|
|
20
|
+
/** Localized instruction shown above the cutout. */
|
|
21
|
+
instructions: string;
|
|
22
|
+
/** Localized "Take photo" label for the shutter button. */
|
|
23
|
+
captureLabel: string;
|
|
24
|
+
/** Localized error string when permission is denied. */
|
|
25
|
+
permissionDeniedLabel: string;
|
|
26
|
+
/** Localized "Try again" label. */
|
|
27
|
+
retryLabel: string;
|
|
28
|
+
/** Localized "Cancel" / back label. */
|
|
29
|
+
cancelLabel: string;
|
|
30
|
+
onCaptured: (photo: PhotoFile, side: DocumentSide) => void;
|
|
31
|
+
onCancel: () => void;
|
|
32
|
+
}
|
|
33
|
+
export declare function DocumentCapture({ side, orientation, instructions, captureLabel, permissionDeniedLabel, retryLabel, cancelLabel, onCaptured, onCancel, }: DocumentCaptureProps): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=DocumentCapture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentCapture.d.ts","sourceRoot":"","sources":["../../../src/camera/DocumentCapture.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAYH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIlE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,mBAAmB,CAAC;IACjC,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3D,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,UAAU,EACV,WAAW,EACX,UAAU,EACV,QAAQ,GACT,EAAE,oBAAoB,+BA0NtB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Liveness camera surface — front-facing vision-camera with an
|
|
3
|
+
* oval mask, status pill, and capture loop driven by the parent step.
|
|
4
|
+
*
|
|
5
|
+
* Capture strategy: vision-camera v4 frame processors run on a worklet thread
|
|
6
|
+
* and don't expose the JPEG bytes back to JS without a custom native plugin.
|
|
7
|
+
* We avoid that complication by using `takePhoto({ qualityPrioritization:
|
|
8
|
+
* 'speed' })` on a JS-level interval (matches the `setInterval` pattern in
|
|
9
|
+
* `web/LivenessModule.ts`). Real-world FPS lands around 3–8 fps which is
|
|
10
|
+
* sufficient for Iris's challenge cadence.
|
|
11
|
+
*
|
|
12
|
+
* The parent owns the loop and the WebSocket — this component just exposes a
|
|
13
|
+
* `captureFrame` ref so the step can drive the timing while the camera stays
|
|
14
|
+
* mounted across challenges.
|
|
15
|
+
*/
|
|
16
|
+
import { type PhotoFile } from 'react-native-vision-camera';
|
|
17
|
+
export interface LivenessCameraHandle {
|
|
18
|
+
takeFrame: () => Promise<PhotoFile | null>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Visual cue applied to the oval guide. The parent maps the current Iris
|
|
22
|
+
* challenge to one of these so the oval animates in a way that reinforces
|
|
23
|
+
* the instruction (oval grows for MOVE_CLOSER, shrinks back for MOVE_FARTHER,
|
|
24
|
+
* stays neutral otherwise).
|
|
25
|
+
*/
|
|
26
|
+
export type LivenessOvalCue = 'NEUTRAL' | 'MOVE_CLOSER' | 'MOVE_FARTHER';
|
|
27
|
+
export interface LivenessCameraProps {
|
|
28
|
+
/** Status text rendered in the centred pill. Pass `null` to hide it. */
|
|
29
|
+
statusText: string | null;
|
|
30
|
+
/** Active challenge instruction (rendered above the oval). Optional. */
|
|
31
|
+
challengeText?: string | null | undefined;
|
|
32
|
+
/** Visual cue for the oval shape (size animation). Defaults to NEUTRAL. */
|
|
33
|
+
ovalCue?: LivenessOvalCue | undefined;
|
|
34
|
+
/** Toast text — passed in as a `{ kind, message }` so the parent owns timing. */
|
|
35
|
+
toast?: {
|
|
36
|
+
kind: 'success' | 'warning';
|
|
37
|
+
message: string;
|
|
38
|
+
} | null | undefined;
|
|
39
|
+
/** Linear progress 0–1 shown under the oval (CHALLENGE_PROGRESS). */
|
|
40
|
+
progress?: number | null | undefined;
|
|
41
|
+
/** Localized permission denied copy. */
|
|
42
|
+
permissionDeniedLabel: string;
|
|
43
|
+
/** Localized retry label for the permission CTA. */
|
|
44
|
+
retryLabel: string;
|
|
45
|
+
/** Localized cancel / back label. */
|
|
46
|
+
cancelLabel: string;
|
|
47
|
+
onCancel?: (() => void) | undefined;
|
|
48
|
+
}
|
|
49
|
+
export declare const LivenessCamera: import("react").ForwardRefExoticComponent<LivenessCameraProps & import("react").RefAttributes<LivenessCameraHandle>>;
|
|
50
|
+
//# sourceMappingURL=LivenessCamera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LivenessCamera.d.ts","sourceRoot":"","sources":["../../../src/camera/LivenessCamera.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAC;AAIpC,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;CAC5C;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,GAAG,cAAc,CAAC;AAEzE,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,2EAA2E;IAC3E,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,iFAAiF;IACjF,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5E,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,wCAAwC;IACxC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;CACrC;AAED,eAAO,MAAM,cAAc,sHAgK1B,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Full-screen map picker for the assisted ADDRESS_INFO flow.
|
|
3
|
+
*
|
|
4
|
+
* - Draggable marker on a `MapView`. Provider per platform:
|
|
5
|
+
* * Android → Google Maps (requires the integrator's API key in the
|
|
6
|
+
* AndroidManifest, restricted by package name + SHA-1).
|
|
7
|
+
* * iOS → Apple Maps (system map, no API key, no AirGoogleMaps
|
|
8
|
+
* Xcode sub-target). Picked deliberately so the iOS build stays
|
|
9
|
+
* lean and signing-only — Google on iOS would add ~5 MB and a
|
|
10
|
+
* custom Expo plugin.
|
|
11
|
+
* - Reverse geocoding via the OS-native geocoder (`utils/osGeocoder`) on
|
|
12
|
+
* every marker move. We DO NOT use Google's REST Geocoding API because
|
|
13
|
+
* it cannot be locked to a bundle ID — see osGeocoder.ts for the
|
|
14
|
+
* rationale.
|
|
15
|
+
* - Location permission is best-effort: if denied, the map centres on
|
|
16
|
+
* Argentina and the user moves the pin to their address by hand.
|
|
17
|
+
*
|
|
18
|
+
* `react-native-maps` is an **optional peer dep** declared in
|
|
19
|
+
* `sdk/package.json`; this file imports it dynamically so hosts that never
|
|
20
|
+
* reach `ADDRESS_INFO` (or omit `googleMapsApiKey`) don't have to install
|
|
21
|
+
* it. The Google Places autocomplete search box has been removed — that
|
|
22
|
+
* library uses Google's Web Service REST API which also cannot be locked
|
|
23
|
+
* to a bundle ID. Users navigate the map by drag instead.
|
|
24
|
+
*/
|
|
25
|
+
import React from 'react';
|
|
26
|
+
import { type ParsedAddressFields } from '../utils/parseGoogleAddressComponents';
|
|
27
|
+
export interface MapAddressPickerProps {
|
|
28
|
+
locale: string;
|
|
29
|
+
/** Required for the "Next" button. */
|
|
30
|
+
nextLabel: string;
|
|
31
|
+
backLabel: string;
|
|
32
|
+
searchPlaceholder: string;
|
|
33
|
+
searchingLabel: string;
|
|
34
|
+
noResultsLabel: string;
|
|
35
|
+
geocodeError: string;
|
|
36
|
+
locationDenied: string;
|
|
37
|
+
/**
|
|
38
|
+
* Field-level required map — decides whether the "Next" button is enabled.
|
|
39
|
+
* Defaults to all fields required.
|
|
40
|
+
*/
|
|
41
|
+
requiredFields?: {
|
|
42
|
+
state?: boolean | undefined;
|
|
43
|
+
city?: boolean | undefined;
|
|
44
|
+
street?: boolean | undefined;
|
|
45
|
+
number?: boolean | undefined;
|
|
46
|
+
postal?: boolean | undefined;
|
|
47
|
+
} | undefined;
|
|
48
|
+
/** Restrict autocomplete predictions to these alpha-2 country codes. */
|
|
49
|
+
countryAllow?: ReadonlyArray<string> | undefined;
|
|
50
|
+
onConfirm: (parsed: ParsedAddressFields & {
|
|
51
|
+
latitude: number;
|
|
52
|
+
longitude: number;
|
|
53
|
+
}) => void;
|
|
54
|
+
onBack: () => void;
|
|
55
|
+
}
|
|
56
|
+
export declare function MapAddressPicker(props: MapAddressPickerProps): React.JSX.Element;
|
|
57
|
+
//# sourceMappingURL=MapAddressPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapAddressPicker.d.ts","sourceRoot":"","sources":["../../../src/camera/MapAddressPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAKN,MAAM,OAAO,CAAC;AAcf,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAC;AAsE/C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE;QACf,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC3B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC7B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC7B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC9B,GAAG,SAAS,CAAC;IACd,wEAAwE;IACxE,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,SAAS,EAAE,CACT,MAAM,EAAE,mBAAmB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAClE,IAAI,CAAC;IACV,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,qBAAqB,qBAgN7B"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview VelionOnboarding — orchestrator for the React Native SDK.
|
|
3
|
+
*
|
|
4
|
+
* Platform-agnostic dynamic state machine: deals with HTTP, SSE, dedupe and
|
|
5
|
+
* step-module orchestration. UI mounting is delegated to a React component
|
|
6
|
+
* (`VelionOnboardingScreen`) instead of direct DOM manipulation.
|
|
7
|
+
*
|
|
8
|
+
* Invariants:
|
|
9
|
+
* - SSE dedupe by `event_id` (monotonic)
|
|
10
|
+
* - Suppress duplicate `NEXT_STEP` for the just-completed step
|
|
11
|
+
* - 45 s watchdog for terminal SSE event after final step → fallback GET
|
|
12
|
+
* - SESSION_DECLINED handling races with module.run()
|
|
13
|
+
*/
|
|
14
|
+
import { type VelionConfig as WebVelionConfig, type SdkStatus, type SdkEventMap, type SdkError, type OnboardingResult } from '../types';
|
|
15
|
+
import type { ReactNode } from 'react';
|
|
16
|
+
/**
|
|
17
|
+
* RN-specific config. Drops web-only fields (`containerId`, `allowEmbedded`,
|
|
18
|
+
* `iframeParentOrigin`) and keeps everything else identical to
|
|
19
|
+
* `WebVelionConfig`, including `fingerprintEndpoint` and `fingerprintApiKey`
|
|
20
|
+
* — both are honoured by the native Fingerprint Pro SDK on mobile too.
|
|
21
|
+
*/
|
|
22
|
+
export type VelionConfig = Omit<WebVelionConfig, 'containerId' | 'allowEmbedded' | 'iframeParentOrigin'>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional view bridge given to the orchestrator by `VelionOnboardingScreen`.
|
|
25
|
+
*
|
|
26
|
+
* The orchestrator never reads from this — it only writes:
|
|
27
|
+
* - `setLoading(text)` to display a status message between steps
|
|
28
|
+
* - `setStepNode(node)` to mount the active step's UI
|
|
29
|
+
* - `setError(err)` to surface a fatal error
|
|
30
|
+
* - `setResult(result)` on flow completion (host may show their own result)
|
|
31
|
+
*/
|
|
32
|
+
export interface OrchestratorView {
|
|
33
|
+
setLoading?: (text: string | null) => void;
|
|
34
|
+
setStepNode?: (node: ReactNode | null) => void;
|
|
35
|
+
setError?: (err: SdkError) => void;
|
|
36
|
+
setResult?: (result: OnboardingResult) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Top-level entry point. Instantiate once per session, call `start()`, and
|
|
40
|
+
* `destroy()` from the host's unmount path.
|
|
41
|
+
*/
|
|
42
|
+
export declare class VelionOnboarding {
|
|
43
|
+
private readonly config;
|
|
44
|
+
private readonly emitter;
|
|
45
|
+
private readonly api;
|
|
46
|
+
private readonly constructionError;
|
|
47
|
+
private status;
|
|
48
|
+
private activeModule;
|
|
49
|
+
private view;
|
|
50
|
+
private readonly uiHandle;
|
|
51
|
+
private initAbortController;
|
|
52
|
+
private sseAbortController;
|
|
53
|
+
private sseCleanup;
|
|
54
|
+
private sseTerminalResolve;
|
|
55
|
+
private sseNextStepResolve;
|
|
56
|
+
private queuedNextStepCommand;
|
|
57
|
+
private lastSseEventId;
|
|
58
|
+
private sessionDeclineHandler;
|
|
59
|
+
private pendingSessionDeclined;
|
|
60
|
+
private pendingTerminalEvent;
|
|
61
|
+
private sessionEnded;
|
|
62
|
+
constructor(config: VelionConfig);
|
|
63
|
+
/** Connects an `OrchestratorView` (typically `VelionOnboardingScreen`). */
|
|
64
|
+
attachView(view: OrchestratorView): void;
|
|
65
|
+
/** Detaches the active view (called from screen unmount). */
|
|
66
|
+
detachView(): void;
|
|
67
|
+
on<K extends keyof SdkEventMap>(event: K, listener: (payload: SdkEventMap[K]) => void): () => void;
|
|
68
|
+
getStatus(): SdkStatus;
|
|
69
|
+
/**
|
|
70
|
+
* Hot-rotate the bearer token used by every subsequent backend call. The SSE
|
|
71
|
+
* stream is also reopened so the new token reaches the server-side authenticator.
|
|
72
|
+
*/
|
|
73
|
+
refreshSessionToken(token: string, expiresAt?: string): void;
|
|
74
|
+
start(): Promise<void>;
|
|
75
|
+
destroy(): void;
|
|
76
|
+
private initialize;
|
|
77
|
+
private validateSessionState;
|
|
78
|
+
private runStepMachine;
|
|
79
|
+
private createModule;
|
|
80
|
+
private finalizeSessionWithTerminalEvent;
|
|
81
|
+
private finalizeSessionSingleGet;
|
|
82
|
+
private completeFlow;
|
|
83
|
+
private endFlowWithSessionDeclined;
|
|
84
|
+
private openSseStream;
|
|
85
|
+
private handleSseEvent;
|
|
86
|
+
private extractNextStepCommand;
|
|
87
|
+
/**
|
|
88
|
+
* Wait for the next ROUTING_COMMAND. The orchestrator races this with a 30 s
|
|
89
|
+
* timeout that, on fire, falls back to a fresh GET /sessions/:id to recover
|
|
90
|
+
* if SSE was missed.
|
|
91
|
+
*/
|
|
92
|
+
private resolveNextStepAfterCompletion;
|
|
93
|
+
private waitForRoutingAfterBackendOnlyStep;
|
|
94
|
+
private waitForTerminalSseEvent;
|
|
95
|
+
/**
|
|
96
|
+
* Drain a pending terminal event (e.g. SESSION_APPROVED arrived while the
|
|
97
|
+
* orchestrator was busy mid-step). Returns true when the flow has been ended
|
|
98
|
+
* by the consumed event.
|
|
99
|
+
*/
|
|
100
|
+
private consumePendingTerminalEvent;
|
|
101
|
+
/**
|
|
102
|
+
* Race a step's promise against SESSION_DECLINED. If decline arrives first,
|
|
103
|
+
* `declined` is true so the caller can short-circuit cleanup.
|
|
104
|
+
*/
|
|
105
|
+
private withSessionDeclineRace;
|
|
106
|
+
private wireExternalCallbacks;
|
|
107
|
+
private setStatus;
|
|
108
|
+
private emitError;
|
|
109
|
+
private isEnglish;
|
|
110
|
+
private localizedLoadingMsg;
|
|
111
|
+
private localizedProcessingMsg;
|
|
112
|
+
private localizedFinalizingMsg;
|
|
113
|
+
private showLoading;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=VelionOnboarding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VelionOnboarding.d.ts","sourceRoot":"","sources":["../../../src/core/VelionOnboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA8BH,OAAO,EAEL,KAAK,YAAY,IAAI,eAAe,EACpC,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEb,KAAK,gBAAgB,EAItB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,eAAe,EACf,aAAa,GAAG,eAAe,GAAG,oBAAoB,CACvD,CAAC;AA6DF;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAChD;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,C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