@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,457 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Public TypeScript contracts for the Velion Onboarding SDK.
|
|
5
|
+
*
|
|
6
|
+
* Design principle: All types exported from this file constitute the public API.
|
|
7
|
+
* Internal implementation types should live alongside their respective modules.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
// STEP & FLOW TYPES
|
|
12
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The complete set of onboarding steps the backend can require.
|
|
16
|
+
* The SDK dynamically receives the active subset for each session.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* - `DEVICE_FINGERPRINT`: Silently collects device entropy via FingerprintJS.
|
|
20
|
+
* - `DOCUMENTS_OCR`: Renders a UI for ID document image capture and upload.
|
|
21
|
+
* - `LIVENESS_MATCH`: Drives the Velion Iris active-liveness flow over WebSocket (HUMAN only).
|
|
22
|
+
* - `EMAIL_OTP` / `PHONE_OTP`: Contact verification via one-time passwords.
|
|
23
|
+
* - `HUMAN_BASIC_INFO`: Natural-person identification data (HUMAN only).
|
|
24
|
+
* - `LEGAL_BASIC_INFO`: Legal-entity identification data (LEGAL only).
|
|
25
|
+
* - `EMAIL_CONTACT` / `PHONE_CONTACT`: contact collection without OTP.
|
|
26
|
+
* - `TAX_INFO`, `HUMAN_EXTENDED_INFO`, `LEGAL_EXTENDED_INFO`, `ADDRESS_INFO`, `SWORN_DECLARATION`: form steps.
|
|
27
|
+
* - `TERMS_AND_CONDITIONS`: accept configured T&C items.
|
|
28
|
+
* - `FACE_MATCH`: server-side face comparison after liveness (no user input; SDK waits).
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Status of an individual onboarding step (matches backend OnboardingStepStatus).
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Type of onboarding session (matches backend OnboardingType).
|
|
37
|
+
* Constrains which steps are valid: HUMAN allows biometric steps, LEGAL uses entity data.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/** Which face of the ID document is being captured. */
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* How the user can provide document images in the DOCUMENTS_OCR step.
|
|
44
|
+
* - `'camera'`: Only "Take photo" (opens camera on supported devices).
|
|
45
|
+
* - `'file'`: Only "Choose file" (file picker).
|
|
46
|
+
* - `'both'`: Both options; implementer can style via theme.
|
|
47
|
+
*
|
|
48
|
+
* @default 'both'
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Orientation of the document capture cutout / crop frame.
|
|
53
|
+
* - `'landscape'`: Horizontal card (default — standard ID-1 cards).
|
|
54
|
+
* - `'portrait'`: Vertical card (e.g. some passports, residence permits).
|
|
55
|
+
*
|
|
56
|
+
* @default 'landscape'
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/** Generic visible/required field toggle used by workflow step configs. */
|
|
60
|
+
|
|
61
|
+
/** Select option used by configurable step fields (e.g. HUMAN_EXTENDED_INFO gender/civil_status). */
|
|
62
|
+
|
|
63
|
+
/** Field rule with optional selectable options. */
|
|
64
|
+
|
|
65
|
+
/** STEP config for HUMAN_BASIC_INFO. */
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* One selectable option row from TAX_INFO `accepted_tax_information` (backend GET session).
|
|
69
|
+
* Prefer `code` as the value sent in POST tax-info; `id` is supported for older payloads.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
/** One country block in TAX_INFO step config (GET session `current_step.config`). */
|
|
73
|
+
|
|
74
|
+
/** STEP config for TAX_INFO. */
|
|
75
|
+
|
|
76
|
+
/** STEP config for HUMAN_EXTENDED_INFO. */
|
|
77
|
+
|
|
78
|
+
/** STEP config for ADDRESS_INFO. */
|
|
79
|
+
|
|
80
|
+
/** STEP config for SWORN_DECLARATION. */
|
|
81
|
+
|
|
82
|
+
/** STEP config for DOCUMENTS_OCR. */
|
|
83
|
+
|
|
84
|
+
/** STEP config for TERMS_AND_CONDITIONS. */
|
|
85
|
+
|
|
86
|
+
/** Generic per-step runtime config map carried by session state and SSE. */
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Request body for POST /sessions/:sessionId/documents-init.
|
|
90
|
+
* Allowed values are defined by the backend; the SDK currently sends a fixed type until
|
|
91
|
+
* the session exposes selectable document types.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Response from POST /sessions/:sessionId/documents-init.
|
|
96
|
+
* Backend returns signed upload URLs so the SDK can PUT each document side
|
|
97
|
+
* directly to storage (e.g. GCS) without routing bytes through the backend.
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
101
|
+
// ERROR TYPES
|
|
102
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Granular error codes for camera/hardware failures.
|
|
106
|
+
* Allows consumers to display localized, actionable messages to end-users.
|
|
107
|
+
*/
|
|
108
|
+
export let CameraErrorCode = /*#__PURE__*/function (CameraErrorCode) {
|
|
109
|
+
/** User explicitly denied camera access in the browser permission dialog. */
|
|
110
|
+
CameraErrorCode["PERMISSION_DENIED"] = "CAMERA_PERMISSION_DENIED";
|
|
111
|
+
/** No camera device was detected on the system. */
|
|
112
|
+
CameraErrorCode["DEVICE_NOT_FOUND"] = "CAMERA_DEVICE_NOT_FOUND";
|
|
113
|
+
/**
|
|
114
|
+
* The camera could not be opened for reading (often in use by another app,
|
|
115
|
+
* or blocked at the OS level). Maps to `NotReadableError` / `TrackStartError`.
|
|
116
|
+
*/
|
|
117
|
+
CameraErrorCode["DEVICE_NOT_READABLE"] = "CAMERA_DEVICE_NOT_READABLE";
|
|
118
|
+
/**
|
|
119
|
+
* The page is served over HTTP (not HTTPS) in a production environment.
|
|
120
|
+
* `getUserMedia` is blocked by the browser's Secure Context policy.
|
|
121
|
+
*/
|
|
122
|
+
CameraErrorCode["INSECURE_CONTEXT"] = "CAMERA_INSECURE_CONTEXT";
|
|
123
|
+
/**
|
|
124
|
+
* Browser policy blocked camera (e.g. cross-origin iframe without permission,
|
|
125
|
+
* or `Permissions-Policy` / Feature-Policy denying camera). Maps to `SecurityError`
|
|
126
|
+
* from `getUserMedia` — distinct from {@link INSECURE_CONTEXT} (non-HTTPS).
|
|
127
|
+
*/
|
|
128
|
+
CameraErrorCode["POLICY_BLOCKED"] = "CAMERA_POLICY_BLOCKED";
|
|
129
|
+
/** The browser or WebView does not support the `getUserMedia` API. */
|
|
130
|
+
CameraErrorCode["NOT_SUPPORTED"] = "CAMERA_NOT_SUPPORTED";
|
|
131
|
+
/**
|
|
132
|
+
* Camera access is blocked by a WebView policy (common in in-app browsers
|
|
133
|
+
* on iOS/Android that restrict hardware access).
|
|
134
|
+
*/
|
|
135
|
+
CameraErrorCode["WEBVIEW_BLOCKED"] = "CAMERA_WEBVIEW_BLOCKED";
|
|
136
|
+
/** The requested video constraints (resolution, facing mode) are not satisfiable. */
|
|
137
|
+
CameraErrorCode["CONSTRAINT_ERROR"] = "CAMERA_CONSTRAINT_ERROR";
|
|
138
|
+
/** An unclassified camera error occurred. Check `cause` for details. */
|
|
139
|
+
CameraErrorCode["UNKNOWN"] = "CAMERA_UNKNOWN_ERROR";
|
|
140
|
+
return CameraErrorCode;
|
|
141
|
+
}({});
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Top-level SDK error codes covering all failure scenarios in the onboarding flow.
|
|
145
|
+
*/
|
|
146
|
+
export let SdkErrorCode = /*#__PURE__*/function (SdkErrorCode) {
|
|
147
|
+
// ── Session ──────────────────────────────────────────────────────────────
|
|
148
|
+
/** The sessionToken was rejected by the backend (401/403). */
|
|
149
|
+
SdkErrorCode["SESSION_INVALID"] = "SESSION_INVALID";
|
|
150
|
+
/** The sessionToken has expired (typically a 401 after initial validation). */
|
|
151
|
+
SdkErrorCode["SESSION_EXPIRED"] = "SESSION_EXPIRED";
|
|
152
|
+
/** Could not fetch the initial session state from the backend. */
|
|
153
|
+
SdkErrorCode["SESSION_FETCH_FAILED"] = "SESSION_FETCH_FAILED";
|
|
154
|
+
/** Backend sent SESSION_DECLINED over SSE; session ended before completion. */
|
|
155
|
+
SdkErrorCode["SESSION_DECLINED"] = "SESSION_DECLINED";
|
|
156
|
+
// ── Modules ──────────────────────────────────────────────────────────────
|
|
157
|
+
/** FingerprintJS failed to generate the visitor ID. */
|
|
158
|
+
SdkErrorCode["FINGERPRINT_FAILED"] = "FINGERPRINT_FAILED";
|
|
159
|
+
/** One or more document images failed to upload successfully. */
|
|
160
|
+
SdkErrorCode["DOCUMENT_UPLOAD_FAILED"] = "DOCUMENT_UPLOAD_FAILED";
|
|
161
|
+
/** The liveness check did not pass or returned an unexpected result. */
|
|
162
|
+
SdkErrorCode["LIVENESS_FAILED"] = "LIVENESS_FAILED";
|
|
163
|
+
/** The Liveness module failed to initialize (e.g., could not create the Iris session). */
|
|
164
|
+
SdkErrorCode["LIVENESS_INIT_FAILED"] = "LIVENESS_INIT_FAILED";
|
|
165
|
+
// ── Camera ───────────────────────────────────────────────────────────────
|
|
166
|
+
/**
|
|
167
|
+
* A camera-related error occurred. Inspect `cameraCode` for the specific reason.
|
|
168
|
+
* @see CameraErrorCode
|
|
169
|
+
*/
|
|
170
|
+
SdkErrorCode["CAMERA_ERROR"] = "CAMERA_ERROR";
|
|
171
|
+
// ── Network & API ────────────────────────────────────────────────────────
|
|
172
|
+
/** A network-level failure (no internet, CORS, DNS). */
|
|
173
|
+
SdkErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
174
|
+
/** The backend returned a non-2xx HTTP status. */
|
|
175
|
+
SdkErrorCode["API_ERROR"] = "API_ERROR";
|
|
176
|
+
// ── Configuration ────────────────────────────────────────────────────────
|
|
177
|
+
/** The `containerId` provided in the config does not exist in the DOM. */
|
|
178
|
+
SdkErrorCode["CONTAINER_NOT_FOUND"] = "CONTAINER_NOT_FOUND";
|
|
179
|
+
/** `start()` was called on an SDK instance that is already running. */
|
|
180
|
+
SdkErrorCode["ALREADY_STARTED"] = "ALREADY_STARTED";
|
|
181
|
+
/** `start()` was called after `destroy()`. The instance is no longer usable. */
|
|
182
|
+
SdkErrorCode["INSTANCE_DESTROYED"] = "INSTANCE_DESTROYED";
|
|
183
|
+
/**
|
|
184
|
+
* The page is running inside an iframe and embedding was not explicitly allowed.
|
|
185
|
+
* Configure Content-Security-Policy: frame-ancestors or X-Frame-Options on the
|
|
186
|
+
* page that hosts the SDK, or set allowEmbedded: true if embedding is intentional.
|
|
187
|
+
*/
|
|
188
|
+
SdkErrorCode["INSECURE_EMBED"] = "INSECURE_EMBED";
|
|
189
|
+
/**
|
|
190
|
+
* The CDN-served manifest could not be downloaded or its Ed25519 signature did
|
|
191
|
+
* not verify against the loader's embedded public key. The loader refuses to
|
|
192
|
+
* mount the iframe to prevent execution of tampered/unsigned bundles.
|
|
193
|
+
*/
|
|
194
|
+
SdkErrorCode["INTEGRITY_FAILED"] = "INTEGRITY_FAILED";
|
|
195
|
+
SdkErrorCode["UNKNOWN"] = "UNKNOWN";
|
|
196
|
+
return SdkErrorCode;
|
|
197
|
+
}({});
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A structured, machine-readable error object emitted by the SDK.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* const sdk = new VelionOnboarding({
|
|
205
|
+
* onError: (err) => {
|
|
206
|
+
* if (err.code === SdkErrorCode.CAMERA_ERROR &&
|
|
207
|
+
* err.cameraCode === CameraErrorCode.PERMISSION_DENIED) {
|
|
208
|
+
* showCameraPermissionDialog();
|
|
209
|
+
* }
|
|
210
|
+
* }
|
|
211
|
+
* });
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
|
|
215
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
216
|
+
// THEMING
|
|
217
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* White-labeling theme configuration.
|
|
221
|
+
* Each property maps to a CSS custom property injected on the SDK container,
|
|
222
|
+
* making all SDK UI elements styleable via `--vl-*` variables.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```typescript
|
|
226
|
+
* const theme: VelionTheme = {
|
|
227
|
+
* primaryColor: '#0052CC', // → --vl-primary-color
|
|
228
|
+
* borderRadius: '12px', // → --vl-border-radius
|
|
229
|
+
* fontFamily: 'Inter, sans-serif'// → --vl-font-family
|
|
230
|
+
* };
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Optional title and body for one terminal verdict on the final result screen.
|
|
236
|
+
*/
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Configurable copy for the built-in final result screen (`showFinalResultScreen`).
|
|
240
|
+
* Omitted fields fall back to SDK defaults for the active `locale`.
|
|
241
|
+
*/
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Localized title/body for one `reason` on the SESSION_DECLINED screen.
|
|
245
|
+
* Keys match backend `reason` (e.g. `TAX_INFO_FAILED`).
|
|
246
|
+
*/
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Per-reason overrides for the built-in SESSION_DECLINED screen (`showFinalResultScreen` not false).
|
|
250
|
+
* Unspecified reasons fall back to SDK defaults when available, then generic copy.
|
|
251
|
+
*/
|
|
252
|
+
|
|
253
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
254
|
+
// CALLBACKS
|
|
255
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* The complete set of lifecycle callbacks the host application can subscribe to.
|
|
259
|
+
* All callbacks are optional. The SDK is still functional without any of them,
|
|
260
|
+
* but `onError` and `onSuccess` are strongly recommended for production.
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
264
|
+
// MAIN CONFIGURATION
|
|
265
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Root configuration object for the `VelionOnboarding` class.
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```typescript
|
|
272
|
+
* const sdk = new VelionOnboarding({
|
|
273
|
+
* containerId: 'velion-root',
|
|
274
|
+
* sessionId: 'ses_abc123',
|
|
275
|
+
* sessionToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
|
|
276
|
+
* apiUrl: 'https://api.velion.la/v1',
|
|
277
|
+
* theme: { primaryColor: '#0052CC' },
|
|
278
|
+
* onSuccess: (result) => console.log('Done!', result),
|
|
279
|
+
* onError: (err) => console.error('SDK Error:', err),
|
|
280
|
+
* });
|
|
281
|
+
*
|
|
282
|
+
* await sdk.start();
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
|
|
286
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
287
|
+
// BACKEND RESPONSE SHAPES
|
|
288
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Backend step DTO (OnboardingStepDto). GET session returns an array of these.
|
|
292
|
+
*/
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Backend session/onboarding DTO (OnboardingDto). Returned by GET /sessions/:sessionId.
|
|
296
|
+
* The SDK maps this to SessionState for the step machine.
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Session state used by the SDK step machine. Derived from GET /sessions/:sessionId
|
|
301
|
+
* (OnboardingDto): steps sorted by order → requiredSteps, first non-completed index → currentStepIndex.
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* A single T&C line item (matches backend TermsAndConditionsItemDto / domain record).
|
|
306
|
+
*/
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Response from session creation (POST from your backend). Use sessionId and
|
|
310
|
+
* sessionToken when instantiating VelionOnboarding; pass expiresAt for optional
|
|
311
|
+
* client-side expiration checks.
|
|
312
|
+
*/
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Shape of the final result returned by `GET /sessions/:sessionId/result`
|
|
316
|
+
* once all steps are complete.
|
|
317
|
+
*/
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Response from `POST /sessions/:sessionId/liveness-init`.
|
|
321
|
+
* The backend returns the Iris session details the SDK needs to open the WebSocket
|
|
322
|
+
* and stream frames. Credentials are not used: Iris owns the session lifecycle.
|
|
323
|
+
*/
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Payload for POST /sessions/:sessionId/basic-info/human (HUMAN_BASIC_INFO step).
|
|
327
|
+
* Matches backend SubmitHumanBasicInfoRequestDto (snake_case in JSON).
|
|
328
|
+
*/
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Payload for POST /sessions/:sessionId/basic-info/legal (LEGAL_BASIC_INFO step).
|
|
332
|
+
* Matches backend SubmitLegalBasicInfoRequestDto (snake_case in JSON).
|
|
333
|
+
*/
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Single selectable option for tax category or fiscal identifier type (TAX_INFO step).
|
|
337
|
+
* `id` is submitted to the API; `description` is the user-visible label.
|
|
338
|
+
*/
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Resolved selectable lists for the TAX_INFO step UI (from `accepted_tax_information` only; no SDK defaults).
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
/** POST /sessions/:id/tax-info — SubmitTaxInfoRequestDto. */
|
|
345
|
+
|
|
346
|
+
/** POST /sessions/:id/extended-info/human — SubmitHumanExtendedInfoRequestDto. */
|
|
347
|
+
|
|
348
|
+
/** POST /sessions/:id/extended-info/legal — SubmitLegalExtendedInfoRequestDto. */
|
|
349
|
+
|
|
350
|
+
/** POST /sessions/:id/address-info — SubmitAddressInfoRequestDto. */
|
|
351
|
+
|
|
352
|
+
/** POST /sessions/:id/sworn-declaration — SubmitSwornDeclarationRequestDto. */
|
|
353
|
+
|
|
354
|
+
/** POST /sessions/:id/contact/email — SubmitEmailContactRequestDto. */
|
|
355
|
+
|
|
356
|
+
/** POST /sessions/:id/contact/phone — SubmitPhoneContactRequestDto. */
|
|
357
|
+
|
|
358
|
+
/** POST /sessions/:id/terms-and-conditions — SubmitTermsAndConditionsRequestDto. */
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* SSE event payload (OnboardingSessionEvent). Matches the backend record
|
|
362
|
+
* la.velion.onboarding.api...sdk.OnboardingSessionEventDto (snake_case in JSON).
|
|
363
|
+
*
|
|
364
|
+
* Received on GET /public/sdk/sessions/:sessionId/events. The backend sends
|
|
365
|
+
* ServerSentEvent with id = event_id (epoch millis) for Last-Event-ID replay.
|
|
366
|
+
*
|
|
367
|
+
* Event types (event_type):
|
|
368
|
+
* - STEP_UPDATED — a workflow step changed status (step_code, step_status)
|
|
369
|
+
* - ROUTING_COMMAND — next/retry/terminate instruction (action: NEXT_STEP | RETRY_STEP | TERMINATE)
|
|
370
|
+
* - SESSION_APPROVED — all checks passed; session_status = APPROVED
|
|
371
|
+
* - SESSION_MANUAL_REVIEW — manual review required; session_status = MANUAL_REVIEW
|
|
372
|
+
* - SESSION_DECLINED — session ended with decline (step_code, session_status DECLINED, reason)
|
|
373
|
+
*/
|
|
374
|
+
|
|
375
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
376
|
+
// BACKEND COMMANDS (Listen & Obey)
|
|
377
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Backend command: advance to a specific step. The SDK must render that step's
|
|
381
|
+
* screen without evaluating business rules locally.
|
|
382
|
+
*/
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Backend command: show an error message to the user. The SDK displays the
|
|
386
|
+
* message and does not advance (backend owns the decision).
|
|
387
|
+
*/
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Backend command: flow is complete. SDK should fetch final result and fire onSuccess.
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Backend command: retry the current step (e.g. after transient failure).
|
|
395
|
+
*/
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Strict command payload the backend may return in a synchronous HTTP response
|
|
399
|
+
* or send via SSE. The SDK never makes routing decisions; it only obeys these commands.
|
|
400
|
+
*/
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Raw response body that may contain a backend command (e.g. POST submit response).
|
|
404
|
+
*/
|
|
405
|
+
|
|
406
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
407
|
+
// INTERNAL STATE MACHINE TYPES (exported for module authors)
|
|
408
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* All possible states of the SDK's internal lifecycle.
|
|
412
|
+
* Transitions are strictly unidirectional (no going back to IDLE once started).
|
|
413
|
+
*
|
|
414
|
+
* @internal
|
|
415
|
+
*/
|
|
416
|
+
|
|
417
|
+
// destroy() was called, instance is a no-op
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Internal event bus event names. Typed via `SdkEventMap`.
|
|
421
|
+
* @internal
|
|
422
|
+
*/
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Maps each internal event name to its payload type.
|
|
426
|
+
* Used by the `TypedEventEmitter` for compile-time safety.
|
|
427
|
+
* @internal
|
|
428
|
+
*/
|
|
429
|
+
|
|
430
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
431
|
+
// LOADER ↔ CDN APP POSTMESSAGE PROTOCOL (Sumsub-style)
|
|
432
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
433
|
+
|
|
434
|
+
/** Message type: parent (loader) sends config to iframe (CDN app). */
|
|
435
|
+
export const VELION_MSG_INIT = 'VELION_INIT';
|
|
436
|
+
|
|
437
|
+
/** Message types: iframe (CDN app) sends to parent (loader). */
|
|
438
|
+
export const VELION_MSG_READY = 'VELION_READY';
|
|
439
|
+
export const VELION_MSG_SUCCESS = 'VELION_SUCCESS';
|
|
440
|
+
export const VELION_MSG_ERROR = 'VELION_ERROR';
|
|
441
|
+
export const VELION_MSG_STEP_CHANGE = 'VELION_STEP_CHANGE';
|
|
442
|
+
export const VELION_MSG_STEP_COMPLETE = 'VELION_STEP_COMPLETE';
|
|
443
|
+
export const VELION_MSG_TOKEN_EXPIRED = 'VELION_TOKEN_EXPIRED';
|
|
444
|
+
|
|
445
|
+
/** Message type: parent sends new token to iframe after VELION_TOKEN_EXPIRED. */
|
|
446
|
+
export const VELION_MSG_TOKEN = 'VELION_TOKEN';
|
|
447
|
+
|
|
448
|
+
/** Envelope for all loader ↔ iframe messages. Both sides must validate origin. */
|
|
449
|
+
|
|
450
|
+
/** Payload for VELION_INIT: full config (iframe runs with containerId overwritten to root id). */
|
|
451
|
+
|
|
452
|
+
/** Payload for VELION_STEP_CHANGE. */
|
|
453
|
+
|
|
454
|
+
/** Payload for VELION_STEP_COMPLETE. */
|
|
455
|
+
|
|
456
|
+
/** Payload for VELION_TOKEN (token refresh response from parent to iframe). */
|
|
457
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CameraErrorCode","SdkErrorCode","VELION_MSG_INIT","VELION_MSG_READY","VELION_MSG_SUCCESS","VELION_MSG_ERROR","VELION_MSG_STEP_CHANGE","VELION_MSG_STEP_COMPLETE","VELION_MSG_TOKEN_EXPIRED","VELION_MSG_TOKEN"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AAMA;;AAMA;;AAKA;;AAQA;AACA;AACA;AACA;;AAQA;;AAQA;;AAMA;;AAaA;;AAiBA;;AAYA;;AAaA;;AAKA;;AAGA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAYA,eAAe,0BAAfA,eAAe;EACzB;EADUA,eAAe;EAGzB;EAHUA,eAAe;EAKzB;AACF;AACA;AACA;EARYA,eAAe;EAUzB;AACF;AACA;AACA;EAbYA,eAAe;EAezB;AACF;AACA;AACA;AACA;EAnBYA,eAAe;EAqBzB;EArBUA,eAAe;EAuBzB;AACF;AACA;AACA;EA1BYA,eAAe;EA4BzB;EA5BUA,eAAe;EA8BzB;EA9BUA,eAAe;EAAA,OAAfA,eAAe;AAAA;;AAkC3B;AACA;AACA;AACA,WAAYC,YAAY,0BAAZA,YAAY;EACtB;EACA;EAFUA,YAAY;EAItB;EAJUA,YAAY;EAMtB;EANUA,YAAY;EAQtB;EARUA,YAAY;EAWtB;EACA;EAZUA,YAAY;EActB;EAdUA,YAAY;EAgBtB;EAhBUA,YAAY;EAkBtB;EAlBUA,YAAY;EAqBtB;EACA;AACF;AACA;AACA;EAzBYA,YAAY;EA4BtB;EACA;EA7BUA,YAAY;EA+BtB;EA/BUA,YAAY;EAkCtB;EACA;EAnCUA,YAAY;EAqCtB;EArCUA,YAAY;EAuCtB;EAvCUA,YAAY;EA0CtB;AACF;AACA;AACA;AACA;EA9CYA,YAAY;EAiDtB;AACF;AACA;AACA;AACA;EArDYA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;;AA2DxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgCA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6CA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAMA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAwDA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoMA;AACA;AACA;;AAEA;AACA;AACA;;AAYA;AACA;AACA;AACA;;AAyBA;AACA;AACA;AACA;;AAmBA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAuBA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAMA;AACA;AACA;;AAYA;;AAUA;;AAUA;;AAMA;;AAkBA;;AAQA;;AAKA;;AAKA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsBA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;;AAMA;AACA;AACA;;AAKA;AACA;AACA;;AAKA;AACA;AACA;AACA;;AAOA;AACA;AACA;;AAOA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAQqB;;AAErB;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;;AAEA;AACA,OAAO,MAAMC,eAAe,GAAG,aAAsB;;AAErD;AACA,OAAO,MAAMC,gBAAgB,GAAG,cAAuB;AACvD,OAAO,MAAMC,kBAAkB,GAAG,gBAAyB;AAC3D,OAAO,MAAMC,gBAAgB,GAAG,cAAuB;AACvD,OAAO,MAAMC,sBAAsB,GAAG,oBAA6B;AACnE,OAAO,MAAMC,wBAAwB,GAAG,sBAA+B;AACvE,OAAO,MAAMC,wBAAwB,GAAG,sBAA+B;;AAEvE;AACA,OAAO,MAAMC,gBAAgB,GAAG,cAAuB;;AAYvD;;AAMA;;AAGA;;AAMA;;AAKA","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Error boundary that catches render failures from `react-native-maps` and
|
|
5
|
+
* lets the parent fall back to the manual address form.
|
|
6
|
+
*
|
|
7
|
+
* Specifically the `AirGoogleMaps` runtime error (`AirGoogleMaps dir must be
|
|
8
|
+
* added to your xCode project to support GoogleMaps on iOS`) only surfaces
|
|
9
|
+
* when the MapView mounts. The preflight check cannot detect it because the
|
|
10
|
+
* native module exists — it's just missing its iOS sub-target.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { Component } from 'react';
|
|
14
|
+
import { log } from '../utils/log';
|
|
15
|
+
export class MapFallbackBoundary extends Component {
|
|
16
|
+
state = {
|
|
17
|
+
hasError: false
|
|
18
|
+
};
|
|
19
|
+
static getDerivedStateFromError() {
|
|
20
|
+
return {
|
|
21
|
+
hasError: true
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
componentDidCatch(error) {
|
|
25
|
+
log.warn('[MapFallbackBoundary] map render failed, switching to manual', {
|
|
26
|
+
message: error.message
|
|
27
|
+
});
|
|
28
|
+
this.props.onError(error);
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
if (this.state.hasError) {
|
|
32
|
+
return this.props.fallback ?? null;
|
|
33
|
+
}
|
|
34
|
+
return this.props.children;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=MapFallbackBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Component","log","MapFallbackBoundary","state","hasError","getDerivedStateFromError","componentDidCatch","error","warn","message","props","onError","render","fallback","children"],"sourceRoot":"../../../src","sources":["ui/MapFallbackBoundary.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,QAAwB,OAAO;AACjD,SAASC,GAAG,QAAQ,cAAc;AAclC,OAAO,MAAMC,mBAAmB,SAASF,SAAS,CAAe;EAC/DG,KAAK,GAAU;IAAEC,QAAQ,EAAE;EAAM,CAAC;EAElC,OAAOC,wBAAwBA,CAAA,EAAU;IACvC,OAAO;MAAED,QAAQ,EAAE;IAAK,CAAC;EAC3B;EAEAE,iBAAiBA,CAACC,KAAY,EAAQ;IACpCN,GAAG,CAACO,IAAI,CAAC,8DAA8D,EAAE;MACvEC,OAAO,EAAEF,KAAK,CAACE;IACjB,CAAC,CAAC;IACF,IAAI,CAACC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC;EAC3B;EAEAK,MAAMA,CAAA,EAAG;IACP,IAAI,IAAI,CAACT,KAAK,CAACC,QAAQ,EAAE;MACvB,OAAO,IAAI,CAACM,KAAK,CAACG,QAAQ,IAAI,IAAI;IACpC;IACA,OAAO,IAAI,CAACH,KAAK,CAACI,QAAQ;EAC5B;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Step shell — header + scrollable body.
|
|
5
|
+
*
|
|
6
|
+
* Rounded header icon, title, subtitle, then a centered column with the
|
|
7
|
+
* step's form. Used by every form-style step (HUMAN_BASIC_INFO, TAX_INFO, …)
|
|
8
|
+
* so they read as a single visual family.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { KeyboardAvoidingView, Platform, ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
12
|
+
import { useTheme, withAlpha } from './theme';
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
export function StepShell({
|
|
15
|
+
title,
|
|
16
|
+
subtitle,
|
|
17
|
+
iconNode,
|
|
18
|
+
children,
|
|
19
|
+
avoidKeyboard = true
|
|
20
|
+
}) {
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
const showIconCircle = !theme.hideStepIcons && iconNode != null;
|
|
23
|
+
const body = /*#__PURE__*/_jsxs(ScrollView, {
|
|
24
|
+
style: styles.scroll,
|
|
25
|
+
contentContainerStyle: styles.scrollBody,
|
|
26
|
+
keyboardShouldPersistTaps: "handled",
|
|
27
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
28
|
+
style: styles.header,
|
|
29
|
+
children: [showIconCircle ? /*#__PURE__*/_jsx(View, {
|
|
30
|
+
style: [styles.iconCircle, {
|
|
31
|
+
backgroundColor: theme.primaryColor,
|
|
32
|
+
shadowColor: withAlpha(theme.primaryColor, 0.5)
|
|
33
|
+
}],
|
|
34
|
+
accessibilityElementsHidden: true,
|
|
35
|
+
importantForAccessibility: "no",
|
|
36
|
+
children: iconNode
|
|
37
|
+
}) : null, /*#__PURE__*/_jsx(Text, {
|
|
38
|
+
style: [styles.title, {
|
|
39
|
+
color: theme.textColor
|
|
40
|
+
}],
|
|
41
|
+
children: title
|
|
42
|
+
}), subtitle ? /*#__PURE__*/_jsx(Text, {
|
|
43
|
+
style: [styles.subtitle, {
|
|
44
|
+
color: theme.textSecondaryColor
|
|
45
|
+
}],
|
|
46
|
+
children: subtitle
|
|
47
|
+
}) : null]
|
|
48
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
49
|
+
style: styles.column,
|
|
50
|
+
children: children
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
if (avoidKeyboard) {
|
|
54
|
+
return /*#__PURE__*/_jsx(KeyboardAvoidingView, {
|
|
55
|
+
style: styles.flex,
|
|
56
|
+
behavior: Platform.OS === 'ios' ? 'padding' : undefined,
|
|
57
|
+
children: body
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return body;
|
|
61
|
+
}
|
|
62
|
+
const styles = StyleSheet.create({
|
|
63
|
+
flex: {
|
|
64
|
+
flex: 1
|
|
65
|
+
},
|
|
66
|
+
scroll: {
|
|
67
|
+
flex: 1
|
|
68
|
+
},
|
|
69
|
+
scrollBody: {
|
|
70
|
+
paddingHorizontal: 18,
|
|
71
|
+
paddingTop: 12,
|
|
72
|
+
paddingBottom: 28
|
|
73
|
+
},
|
|
74
|
+
header: {
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
marginBottom: 14
|
|
77
|
+
},
|
|
78
|
+
iconCircle: {
|
|
79
|
+
width: 56,
|
|
80
|
+
height: 56,
|
|
81
|
+
borderRadius: 28,
|
|
82
|
+
marginBottom: 10,
|
|
83
|
+
alignItems: 'center',
|
|
84
|
+
justifyContent: 'center',
|
|
85
|
+
shadowOpacity: 0.25,
|
|
86
|
+
shadowRadius: 8,
|
|
87
|
+
shadowOffset: {
|
|
88
|
+
width: 0,
|
|
89
|
+
height: 3
|
|
90
|
+
},
|
|
91
|
+
elevation: 3
|
|
92
|
+
},
|
|
93
|
+
title: {
|
|
94
|
+
fontSize: 20,
|
|
95
|
+
fontWeight: '700',
|
|
96
|
+
letterSpacing: -0.3,
|
|
97
|
+
textAlign: 'center'
|
|
98
|
+
},
|
|
99
|
+
subtitle: {
|
|
100
|
+
marginTop: 6,
|
|
101
|
+
fontSize: 14,
|
|
102
|
+
fontWeight: '400',
|
|
103
|
+
textAlign: 'center',
|
|
104
|
+
lineHeight: 20,
|
|
105
|
+
maxWidth: 320
|
|
106
|
+
},
|
|
107
|
+
column: {
|
|
108
|
+
width: '100%',
|
|
109
|
+
maxWidth: 360,
|
|
110
|
+
alignSelf: 'center',
|
|
111
|
+
gap: 10
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
//# sourceMappingURL=StepShell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["KeyboardAvoidingView","Platform","ScrollView","StyleSheet","Text","View","useTheme","withAlpha","jsx","_jsx","jsxs","_jsxs","StepShell","title","subtitle","iconNode","children","avoidKeyboard","theme","showIconCircle","hideStepIcons","body","style","styles","scroll","contentContainerStyle","scrollBody","keyboardShouldPersistTaps","header","iconCircle","backgroundColor","primaryColor","shadowColor","accessibilityElementsHidden","importantForAccessibility","color","textColor","textSecondaryColor","column","flex","behavior","OS","undefined","create","paddingHorizontal","paddingTop","paddingBottom","alignItems","marginBottom","width","height","borderRadius","justifyContent","shadowOpacity","shadowRadius","shadowOffset","elevation","fontSize","fontWeight","letterSpacing","textAlign","marginTop","lineHeight","maxWidth","alignSelf","gap"],"sourceRoot":"../../../src","sources":["ui/StepShell.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SACEA,oBAAoB,EACpBC,QAAQ,EACRC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,IAAI,QACC,cAAc;AACrB,SAASC,QAAQ,EAAEC,SAAS,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAY9C,OAAO,SAASC,SAASA,CAAC;EACxBC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,aAAa,GAAG;AACF,CAAC,EAAE;EACjB,MAAMC,KAAK,GAAGZ,QAAQ,CAAC,CAAC;EAExB,MAAMa,cAAc,GAAG,CAACD,KAAK,CAACE,aAAa,IAAIL,QAAQ,IAAI,IAAI;EAE/D,MAAMM,IAAI,gBACRV,KAAA,CAACT,UAAU;IACToB,KAAK,EAAEC,MAAM,CAACC,MAAO;IACrBC,qBAAqB,EAAEF,MAAM,CAACG,UAAW;IACzCC,yBAAyB,EAAC,SAAS;IAAAX,QAAA,gBAEnCL,KAAA,CAACN,IAAI;MAACiB,KAAK,EAAEC,MAAM,CAACK,MAAO;MAAAZ,QAAA,GACxBG,cAAc,gBACbV,IAAA,CAACJ,IAAI;QACHiB,KAAK,EAAE,CACLC,MAAM,CAACM,UAAU,EACjB;UACEC,eAAe,EAAEZ,KAAK,CAACa,YAAY;UACnCC,WAAW,EAAEzB,SAAS,CAACW,KAAK,CAACa,YAAY,EAAE,GAAG;QAChD,CAAC,CACD;QACFE,2BAA2B;QAC3BC,yBAAyB,EAAC,IAAI;QAAAlB,QAAA,EAE7BD;MAAQ,CACL,CAAC,GACL,IAAI,eACRN,IAAA,CAACL,IAAI;QAACkB,KAAK,EAAE,CAACC,MAAM,CAACV,KAAK,EAAE;UAAEsB,KAAK,EAAEjB,KAAK,CAACkB;QAAU,CAAC,CAAE;QAAApB,QAAA,EAAEH;MAAK,CAAO,CAAC,EACtEC,QAAQ,gBACPL,IAAA,CAACL,IAAI;QACHkB,KAAK,EAAE,CAACC,MAAM,CAACT,QAAQ,EAAE;UAAEqB,KAAK,EAAEjB,KAAK,CAACmB;QAAmB,CAAC,CAAE;QAAArB,QAAA,EAE7DF;MAAQ,CACL,CAAC,GACL,IAAI;IAAA,CACJ,CAAC,eACPL,IAAA,CAACJ,IAAI;MAACiB,KAAK,EAAEC,MAAM,CAACe,MAAO;MAAAtB,QAAA,EAAEA;IAAQ,CAAO,CAAC;EAAA,CACnC,CACb;EAED,IAAIC,aAAa,EAAE;IACjB,oBACER,IAAA,CAACT,oBAAoB;MACnBsB,KAAK,EAAEC,MAAM,CAACgB,IAAK;MACnBC,QAAQ,EAAEvC,QAAQ,CAACwC,EAAE,KAAK,KAAK,GAAG,SAAS,GAAGC,SAAU;MAAA1B,QAAA,EAEvDK;IAAI,CACe,CAAC;EAE3B;EACA,OAAOA,IAAI;AACb;AAEA,MAAME,MAAM,GAAGpB,UAAU,CAACwC,MAAM,CAAC;EAC/BJ,IAAI,EAAE;IACJA,IAAI,EAAE;EACR,CAAC;EACDf,MAAM,EAAE;IACNe,IAAI,EAAE;EACR,CAAC;EACDb,UAAU,EAAE;IACVkB,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE;EACjB,CAAC;EACDlB,MAAM,EAAE;IACNmB,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAE;EAChB,CAAC;EACDnB,UAAU,EAAE;IACVoB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,EAAE;IAChBH,YAAY,EAAE,EAAE;IAChBD,UAAU,EAAE,QAAQ;IACpBK,cAAc,EAAE,QAAQ;IACxBC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,CAAC;IACfC,YAAY,EAAE;MAAEN,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCM,SAAS,EAAE;EACb,CAAC;EACD3C,KAAK,EAAE;IACL4C,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,aAAa,EAAE,CAAC,GAAG;IACnBC,SAAS,EAAE;EACb,CAAC;EACD9C,QAAQ,EAAE;IACR+C,SAAS,EAAE,CAAC;IACZJ,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBE,SAAS,EAAE,QAAQ;IACnBE,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE;EACZ,CAAC;EACDzB,MAAM,EAAE;IACNW,KAAK,EAAE,MAAM;IACbc,QAAQ,EAAE,GAAG;IACbC,SAAS,EAAE,QAAQ;IACnBC,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
|