@velion-la/onboarding-sdk-react-native 1.0.0-beta.10
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 +888 -0
- package/app.plugin.js +101 -0
- package/lib/commonjs/camera/AddressSearchBar.js +304 -0
- package/lib/commonjs/camera/AddressSearchBar.js.map +1 -0
- package/lib/commonjs/camera/DocumentCapture.js +513 -0
- package/lib/commonjs/camera/DocumentCapture.js.map +1 -0
- package/lib/commonjs/camera/LivenessCamera.js +628 -0
- package/lib/commonjs/camera/LivenessCamera.js.map +1 -0
- package/lib/commonjs/camera/MapAddressPicker.js +331 -0
- package/lib/commonjs/camera/MapAddressPicker.js.map +1 -0
- package/lib/commonjs/core/VelionOnboarding.js +1113 -0
- package/lib/commonjs/core/VelionOnboarding.js.map +1 -0
- package/lib/commonjs/core/retryStepCopy.js +43 -0
- package/lib/commonjs/core/retryStepCopy.js.map +1 -0
- package/lib/commonjs/core/routingCommands.js +62 -0
- package/lib/commonjs/core/routingCommands.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 +200 -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 +301 -0
- package/lib/commonjs/i18n/strings/en.js.map +1 -0
- package/lib/commonjs/i18n/strings/es.js +306 -0
- package/lib/commonjs/i18n/strings/es.js.map +1 -0
- package/lib/commonjs/index.js +225 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/steps/AddressInfoStep.js +662 -0
- package/lib/commonjs/steps/AddressInfoStep.js.map +1 -0
- package/lib/commonjs/steps/DocumentsOcrStep.js +405 -0
- package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -0
- package/lib/commonjs/steps/EconomicActivityStep.js +214 -0
- package/lib/commonjs/steps/EconomicActivityStep.js.map +1 -0
- package/lib/commonjs/steps/EmailContactStep.js +150 -0
- package/lib/commonjs/steps/EmailContactStep.js.map +1 -0
- package/lib/commonjs/steps/EmailOtpStep.js +225 -0
- package/lib/commonjs/steps/EmailOtpStep.js.map +1 -0
- package/lib/commonjs/steps/FaceMatchStep.js +169 -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 +251 -0
- package/lib/commonjs/steps/HumanBasicInfoStep.js.map +1 -0
- package/lib/commonjs/steps/HumanExtendedInfoStep.js +275 -0
- package/lib/commonjs/steps/HumanExtendedInfoStep.js.map +1 -0
- package/lib/commonjs/steps/LegalBasicInfoStep.js +195 -0
- package/lib/commonjs/steps/LegalBasicInfoStep.js.map +1 -0
- package/lib/commonjs/steps/LegalExtendedInfoStep.js +173 -0
- package/lib/commonjs/steps/LegalExtendedInfoStep.js.map +1 -0
- package/lib/commonjs/steps/LivenessMatchStep.js +1184 -0
- package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -0
- package/lib/commonjs/steps/PhoneContactStep.js +151 -0
- package/lib/commonjs/steps/PhoneContactStep.js.map +1 -0
- package/lib/commonjs/steps/PhoneOtpStep.js +224 -0
- package/lib/commonjs/steps/PhoneOtpStep.js.map +1 -0
- package/lib/commonjs/steps/SwornDeclarationStep.js +206 -0
- package/lib/commonjs/steps/SwornDeclarationStep.js.map +1 -0
- package/lib/commonjs/steps/TaxInfoStep.js +251 -0
- package/lib/commonjs/steps/TaxInfoStep.js.map +1 -0
- package/lib/commonjs/steps/TermsAndConditionsStep.js +245 -0
- package/lib/commonjs/steps/TermsAndConditionsStep.js.map +1 -0
- package/lib/commonjs/steps/_shared.js +61 -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 +458 -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 +251 -0
- package/lib/commonjs/ui/StepShell.js.map +1 -0
- package/lib/commonjs/ui/VelionOnboardingScreen.js +276 -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 +101 -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/BackButton.js +75 -0
- package/lib/commonjs/ui/primitives/BackButton.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/SearchableSingleSelectList.js +162 -0
- package/lib/commonjs/ui/primitives/SearchableSingleSelectList.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 +89 -0
- package/lib/commonjs/ui/primitives/index.js.map +1 -0
- package/lib/commonjs/ui/primitives/searchableSingleSelectFilter.js +31 -0
- package/lib/commonjs/ui/primitives/searchableSingleSelectFilter.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 +88 -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/commonjs/utils/useSafeAreaInsets.js +41 -0
- package/lib/commonjs/utils/useSafeAreaInsets.js.map +1 -0
- package/lib/commonjs/utils/velionExtra.js +48 -0
- package/lib/commonjs/utils/velionExtra.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 +508 -0
- package/lib/module/camera/DocumentCapture.js.map +1 -0
- package/lib/module/camera/LivenessCamera.js +623 -0
- package/lib/module/camera/LivenessCamera.js.map +1 -0
- package/lib/module/camera/MapAddressPicker.js +326 -0
- package/lib/module/camera/MapAddressPicker.js.map +1 -0
- package/lib/module/core/VelionOnboarding.js +1109 -0
- package/lib/module/core/VelionOnboarding.js.map +1 -0
- package/lib/module/core/retryStepCopy.js +39 -0
- package/lib/module/core/retryStepCopy.js.map +1 -0
- package/lib/module/core/routingCommands.js +57 -0
- package/lib/module/core/routingCommands.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 +189 -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 +297 -0
- package/lib/module/i18n/strings/en.js.map +1 -0
- package/lib/module/i18n/strings/es.js +302 -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 +658 -0
- package/lib/module/steps/AddressInfoStep.js.map +1 -0
- package/lib/module/steps/DocumentsOcrStep.js +399 -0
- package/lib/module/steps/DocumentsOcrStep.js.map +1 -0
- package/lib/module/steps/EconomicActivityStep.js +209 -0
- package/lib/module/steps/EconomicActivityStep.js.map +1 -0
- package/lib/module/steps/EmailContactStep.js +145 -0
- package/lib/module/steps/EmailContactStep.js.map +1 -0
- package/lib/module/steps/EmailOtpStep.js +220 -0
- package/lib/module/steps/EmailOtpStep.js.map +1 -0
- package/lib/module/steps/FaceMatchStep.js +164 -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 +246 -0
- package/lib/module/steps/HumanBasicInfoStep.js.map +1 -0
- package/lib/module/steps/HumanExtendedInfoStep.js +270 -0
- package/lib/module/steps/HumanExtendedInfoStep.js.map +1 -0
- package/lib/module/steps/LegalBasicInfoStep.js +190 -0
- package/lib/module/steps/LegalBasicInfoStep.js.map +1 -0
- package/lib/module/steps/LegalExtendedInfoStep.js +168 -0
- package/lib/module/steps/LegalExtendedInfoStep.js.map +1 -0
- package/lib/module/steps/LivenessMatchStep.js +1177 -0
- package/lib/module/steps/LivenessMatchStep.js.map +1 -0
- package/lib/module/steps/PhoneContactStep.js +146 -0
- package/lib/module/steps/PhoneContactStep.js.map +1 -0
- package/lib/module/steps/PhoneOtpStep.js +219 -0
- package/lib/module/steps/PhoneOtpStep.js.map +1 -0
- package/lib/module/steps/SwornDeclarationStep.js +203 -0
- package/lib/module/steps/SwornDeclarationStep.js.map +1 -0
- package/lib/module/steps/TaxInfoStep.js +246 -0
- package/lib/module/steps/TaxInfoStep.js.map +1 -0
- package/lib/module/steps/TermsAndConditionsStep.js +240 -0
- package/lib/module/steps/TermsAndConditionsStep.js.map +1 -0
- package/lib/module/steps/_shared.js +52 -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 +532 -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 +246 -0
- package/lib/module/ui/StepShell.js.map +1 -0
- package/lib/module/ui/VelionOnboardingScreen.js +273 -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 +97 -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/BackButton.js +71 -0
- package/lib/module/ui/primitives/BackButton.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/SearchableSingleSelectList.js +153 -0
- package/lib/module/ui/primitives/SearchableSingleSelectList.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 +14 -0
- package/lib/module/ui/primitives/index.js.map +1 -0
- package/lib/module/ui/primitives/searchableSingleSelectFilter.js +27 -0
- package/lib/module/ui/primitives/searchableSingleSelectFilter.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 +84 -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/module/utils/useSafeAreaInsets.js +37 -0
- package/lib/module/utils/useSafeAreaInsets.js.map +1 -0
- package/lib/module/utils/velionExtra.js +44 -0
- package/lib/module/utils/velionExtra.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 +67 -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 +169 -0
- package/lib/typescript/core/VelionOnboarding.d.ts.map +1 -0
- package/lib/typescript/core/retryStepCopy.d.ts +27 -0
- package/lib/typescript/core/retryStepCopy.d.ts.map +1 -0
- package/lib/typescript/core/routingCommands.d.ts +39 -0
- package/lib/typescript/core/routingCommands.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 +52 -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 +297 -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/EconomicActivityStep.d.ts +29 -0
- package/lib/typescript/steps/EconomicActivityStep.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 +22 -0
- package/lib/typescript/steps/_shared.d.ts.map +1 -0
- package/lib/typescript/steps/types.d.ts +89 -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 +1219 -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 +29 -0
- package/lib/typescript/ui/StepShell.d.ts.map +1 -0
- package/lib/typescript/ui/VelionOnboardingScreen.d.ts +26 -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 +32 -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/BackButton.d.ts +20 -0
- package/lib/typescript/ui/primitives/BackButton.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/SearchableSingleSelectList.d.ts +33 -0
- package/lib/typescript/ui/primitives/SearchableSingleSelectList.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 +12 -0
- package/lib/typescript/ui/primitives/index.d.ts.map +1 -0
- package/lib/typescript/ui/primitives/searchableSingleSelectFilter.d.ts +25 -0
- package/lib/typescript/ui/primitives/searchableSingleSelectFilter.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 +52 -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/lib/typescript/utils/useSafeAreaInsets.d.ts +26 -0
- package/lib/typescript/utils/useSafeAreaInsets.d.ts.map +1 -0
- package/lib/typescript/utils/velionExtra.d.ts +24 -0
- package/lib/typescript/utils/velionExtra.d.ts.map +1 -0
- package/package.json +107 -0
- package/src/camera/AddressSearchBar.tsx +363 -0
- package/src/camera/DocumentCapture.tsx +514 -0
- package/src/camera/LivenessCamera.tsx +706 -0
- package/src/camera/MapAddressPicker.tsx +391 -0
- package/src/core/VelionOnboarding.ts +1291 -0
- package/src/core/retryStepCopy.ts +54 -0
- package/src/core/routingCommands.ts +63 -0
- package/src/core/sessionDeclinedCopy.ts +76 -0
- package/src/core/sessionStateMapper.ts +232 -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 +335 -0
- package/src/i18n/strings/es.ts +337 -0
- package/src/index.ts +146 -0
- package/src/steps/AddressInfoStep.tsx +744 -0
- package/src/steps/DocumentsOcrStep.tsx +481 -0
- package/src/steps/EconomicActivityStep.tsx +230 -0
- package/src/steps/EmailContactStep.tsx +165 -0
- package/src/steps/EmailOtpStep.tsx +256 -0
- package/src/steps/FaceMatchStep.tsx +176 -0
- package/src/steps/FingerprintStep.tsx +99 -0
- package/src/steps/HumanBasicInfoStep.tsx +286 -0
- package/src/steps/HumanExtendedInfoStep.tsx +362 -0
- package/src/steps/LegalBasicInfoStep.tsx +214 -0
- package/src/steps/LegalExtendedInfoStep.tsx +184 -0
- package/src/steps/LivenessMatchStep.tsx +1351 -0
- package/src/steps/PhoneContactStep.tsx +166 -0
- package/src/steps/PhoneOtpStep.tsx +255 -0
- package/src/steps/SwornDeclarationStep.tsx +237 -0
- package/src/steps/TaxInfoStep.tsx +288 -0
- package/src/steps/TermsAndConditionsStep.tsx +269 -0
- package/src/steps/_shared.ts +69 -0
- package/src/steps/types.ts +93 -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 +1421 -0
- package/src/ui/MapFallbackBoundary.tsx +46 -0
- package/src/ui/StepShell.tsx +273 -0
- package/src/ui/VelionOnboardingScreen.tsx +297 -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 +78 -0
- package/src/ui/overlays/AnalyzingOverlay.tsx +323 -0
- package/src/ui/overlays/LoadingOverlay.tsx +115 -0
- package/src/ui/overlays/ProgressBar.tsx +106 -0
- package/src/ui/overlays/RetryDialog.tsx +128 -0
- package/src/ui/overlays/index.ts +3 -0
- package/src/ui/primitives/BackButton.tsx +65 -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/SearchableSingleSelectList.tsx +195 -0
- package/src/ui/primitives/Select.tsx +259 -0
- package/src/ui/primitives/Spinner.tsx +17 -0
- package/src/ui/primitives/index.ts +16 -0
- package/src/ui/primitives/searchableSingleSelectFilter.ts +38 -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 +89 -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
- package/src/utils/useSafeAreaInsets.ts +37 -0
- package/src/utils/velionExtra.ts +46 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Shared safe-area inset hook with a dynamic, fail-safe loader.
|
|
5
|
+
*
|
|
6
|
+
* `react-native-safe-area-context` is a transitive peer of Expo SDK 54+ (and is
|
|
7
|
+
* declared as a peerDependency of this SDK), but we never import it statically:
|
|
8
|
+
* hosts that strip optional native deps, or render the SDK outside a
|
|
9
|
+
* `SafeAreaProvider`, must still get a usable layout. So the hook is loaded with
|
|
10
|
+
* a `require` inside a try/catch and falls back to zero insets.
|
|
11
|
+
*
|
|
12
|
+
* The `require` result is deterministic for the lifetime of the bundle (the
|
|
13
|
+
* module is either installed or not), so the conditional hook call below does
|
|
14
|
+
* not change across renders — it does not violate the rules of hooks. Callers
|
|
15
|
+
* MUST still invoke this hook unconditionally (before any early return).
|
|
16
|
+
*
|
|
17
|
+
* Insets are applied to UI chrome (headers, CTAs, camera controls) — never to
|
|
18
|
+
* the full-bleed `<Camera>` / `<MapView>` preview, which must keep covering the
|
|
19
|
+
* whole screen so OCR / liveness framing is not cropped.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const ZERO_INSETS = {
|
|
23
|
+
top: 0,
|
|
24
|
+
bottom: 0,
|
|
25
|
+
left: 0,
|
|
26
|
+
right: 0
|
|
27
|
+
};
|
|
28
|
+
export function useSafeAreaInsets() {
|
|
29
|
+
try {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
31
|
+
const mod = require('react-native-safe-area-context');
|
|
32
|
+
return mod.useSafeAreaInsets();
|
|
33
|
+
} catch {
|
|
34
|
+
return ZERO_INSETS;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=useSafeAreaInsets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ZERO_INSETS","top","bottom","left","right","useSafeAreaInsets","mod","require"],"sourceRoot":"../../../src","sources":["utils/useSafeAreaInsets.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,MAAMA,WAAuB,GAAG;EAAEC,GAAG,EAAE,CAAC;EAAEC,MAAM,EAAE,CAAC;EAAEC,IAAI,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC;AAExE,OAAO,SAASC,iBAAiBA,CAAA,EAAe;EAC9C,IAAI;IACF;IACA,MAAMC,GAAG,GAAGC,OAAO,CAAC,gCAAgC,CAAC;IACrD,OAAOD,GAAG,CAACD,iBAAiB,CAAC,CAAC;EAChC,CAAC,CAAC,MAAM;IACN,OAAOL,WAAW;EACpB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reads values that the SDK's Expo config plugin (`app.plugin.js`) stashed
|
|
5
|
+
* under `expoConfig.extra.*` during `expo prebuild`.
|
|
6
|
+
*
|
|
7
|
+
* The plugin lives at the package root and is meant to be registered by
|
|
8
|
+
* host apps. When it is, it copies the values it received from
|
|
9
|
+
* `app.json` into Expo's `extra` namespace so they survive into the
|
|
10
|
+
* runtime config exposed by `expo-constants`. This module is the runtime
|
|
11
|
+
* side of that hand-off.
|
|
12
|
+
*
|
|
13
|
+
* On bare React Native (no `expo-constants` installed) every getter
|
|
14
|
+
* returns `undefined`, and the SDK falls back to whatever the host
|
|
15
|
+
* passed via `VelionConfig`.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
function readVelionExtra() {
|
|
19
|
+
let Constants;
|
|
20
|
+
try {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
|
|
22
|
+
const mod = require('expo-constants');
|
|
23
|
+
Constants = mod?.default ?? mod;
|
|
24
|
+
} catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
const expoConfig = Constants?.expoConfig;
|
|
28
|
+
return expoConfig?.extra;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Returns the Google Maps API key the plugin wrote to
|
|
33
|
+
* `expoConfig.extra.velionGoogleMapsApiKey`, or `undefined` when the
|
|
34
|
+
* plugin wasn't registered or the value isn't a non-empty string.
|
|
35
|
+
*
|
|
36
|
+
* Hosts that pass `VelionConfig.googleMapsApiKey` at runtime take
|
|
37
|
+
* precedence over this value — see `VelionOnboarding`.
|
|
38
|
+
*/
|
|
39
|
+
export function getGoogleMapsApiKeyFromExpoExtra() {
|
|
40
|
+
const extra = readVelionExtra();
|
|
41
|
+
const key = extra?.velionGoogleMapsApiKey;
|
|
42
|
+
return typeof key === 'string' && key.trim().length > 0 ? key.trim() : undefined;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=velionExtra.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["readVelionExtra","Constants","mod","require","default","undefined","expoConfig","extra","getGoogleMapsApiKeyFromExpoExtra","key","velionGoogleMapsApiKey","trim","length"],"sourceRoot":"../../../src","sources":["utils/velionExtra.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,SAASA,eAAeA,CAAA,EAA4B;EAClD,IAAIC,SAAkB;EACtB,IAAI;IACF;IACA,MAAMC,GAAG,GAAGC,OAAO,CAAC,gBAAgB,CAAC;IACrCF,SAAS,GAAGC,GAAG,EAAEE,OAAO,IAAIF,GAAG;EACjC,CAAC,CAAC,MAAM;IACN,OAAOG,SAAS;EAClB;EACA,MAAMC,UAAU,GAAIL,SAAS,EACzBK,UAAU;EACd,OAAOA,UAAU,EAAEC,KAAK;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gCAAgCA,CAAA,EAAuB;EACrE,MAAMD,KAAK,GAAGP,eAAe,CAAC,CAAC;EAC/B,MAAMS,GAAG,GAAGF,KAAK,EAAEG,sBAAsB;EACzC,OAAO,OAAOD,GAAG,KAAK,QAAQ,IAAIA,GAAG,CAACE,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC,GAAGH,GAAG,CAACE,IAAI,CAAC,CAAC,GAAGN,SAAS;AAClF","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;AAKlE,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,+BAkOtB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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, type VideoFile } from 'react-native-vision-camera';
|
|
17
|
+
export interface LivenessCameraHandle {
|
|
18
|
+
takeFrame: () => Promise<PhotoFile | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Start an mp4/h264 video recording on the same `<Camera>` that feeds the
|
|
21
|
+
* frame loop. Audio is disabled. Errors during recording are delivered
|
|
22
|
+
* through `onRecordingError` — startup failures throw synchronously and
|
|
23
|
+
* must be caught by the caller. Best-effort: liveness must keep working
|
|
24
|
+
* even when this fails.
|
|
25
|
+
*/
|
|
26
|
+
startVideoRecording(opts: {
|
|
27
|
+
onRecordingFinished: (video: VideoFile) => void;
|
|
28
|
+
onRecordingError: (err: unknown) => void;
|
|
29
|
+
}): void;
|
|
30
|
+
/**
|
|
31
|
+
* Stop the active recording. Resolves once `onRecordingFinished` has been
|
|
32
|
+
* scheduled by vision-camera; the file path arrives there, not here.
|
|
33
|
+
* No-op when no recording is active.
|
|
34
|
+
*/
|
|
35
|
+
stopVideoRecording(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Visual cue applied to the oval guide. The parent maps the current Iris
|
|
39
|
+
* challenge to one of these so the oval animates in a way that reinforces
|
|
40
|
+
* the instruction (oval grows for MOVE_CLOSER, shrinks back for MOVE_FARTHER,
|
|
41
|
+
* stays neutral otherwise).
|
|
42
|
+
*/
|
|
43
|
+
export type LivenessOvalCue = 'NEUTRAL' | 'MOVE_CLOSER' | 'MOVE_FARTHER';
|
|
44
|
+
export interface LivenessCameraProps {
|
|
45
|
+
/** Status text rendered in the centred pill. Pass `null` to hide it. */
|
|
46
|
+
statusText: string | null;
|
|
47
|
+
/** Active challenge instruction (rendered above the oval). Optional. */
|
|
48
|
+
challengeText?: string | null | undefined;
|
|
49
|
+
/** Visual cue for the oval shape (size animation). Defaults to NEUTRAL. */
|
|
50
|
+
ovalCue?: LivenessOvalCue | undefined;
|
|
51
|
+
/** Toast text — passed in as a `{ kind, message }` so the parent owns timing. */
|
|
52
|
+
toast?: {
|
|
53
|
+
kind: 'success' | 'warning';
|
|
54
|
+
message: string;
|
|
55
|
+
} | null | undefined;
|
|
56
|
+
/** Linear progress 0–1 shown under the oval (CHALLENGE_PROGRESS). */
|
|
57
|
+
progress?: number | null | undefined;
|
|
58
|
+
/** Localized permission denied copy. */
|
|
59
|
+
permissionDeniedLabel: string;
|
|
60
|
+
/** Localized retry label for the permission CTA. */
|
|
61
|
+
retryLabel: string;
|
|
62
|
+
/** Localized cancel / back label. */
|
|
63
|
+
cancelLabel: string;
|
|
64
|
+
onCancel?: (() => void) | undefined;
|
|
65
|
+
}
|
|
66
|
+
export declare const LivenessCamera: import("react").ForwardRefExoticComponent<LivenessCameraProps & import("react").RefAttributes<LivenessCameraHandle>>;
|
|
67
|
+
//# 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,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,4BAA4B,CAAC;AAKpC,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAC3C;;;;;;OAMG;IACH,mBAAmB,CAAC,IAAI,EAAE;QACxB,mBAAmB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;QAChD,gBAAgB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;KAC1C,GAAG,IAAI,CAAC;IACT;;;;OAIG;IACH,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;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,sHAgP1B,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;AA0D/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,qBAsN7B"}
|
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
* - `RETRY_STEP` shows a retry dialog (Retry re-mounts the step, Cancel exits);
|
|
12
|
+
* once the retry quota is exhausted the backend emits SESSION_DECLINED instead
|
|
13
|
+
* - 45 s watchdog for terminal SSE event after final step → fallback GET
|
|
14
|
+
* - SESSION_DECLINED handling races with module.run()
|
|
15
|
+
*/
|
|
16
|
+
import { type VelionConfig as WebVelionConfig, type SdkStatus, type SdkEventMap, type SdkError, type OnboardingResult, type OnboardingExit } from '../types';
|
|
17
|
+
import { type ReactNode } from 'react';
|
|
18
|
+
/**
|
|
19
|
+
* RN-specific config. Drops web-only fields (`containerId`, `allowEmbedded`,
|
|
20
|
+
* `iframeParentOrigin`) and keeps everything else identical to
|
|
21
|
+
* `WebVelionConfig`, including `fingerprintEndpoint` and `fingerprintApiKey`
|
|
22
|
+
* — both are honoured by the native Fingerprint Pro SDK on mobile too.
|
|
23
|
+
*/
|
|
24
|
+
export type VelionConfig = Omit<WebVelionConfig, 'containerId' | 'allowEmbedded' | 'iframeParentOrigin'>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional view bridge given to the orchestrator by `VelionOnboardingScreen`.
|
|
27
|
+
*
|
|
28
|
+
* The orchestrator never reads from this — it only writes:
|
|
29
|
+
* - `setLoading(text)` to display a status message between steps
|
|
30
|
+
* - `setStepNode(node)` to mount the active step's UI
|
|
31
|
+
* - `setError(err)` to surface a fatal error
|
|
32
|
+
* - `setResult(result)` on flow completion (host may show their own result)
|
|
33
|
+
*/
|
|
34
|
+
export interface OrchestratorView {
|
|
35
|
+
setLoading?: (text: string | null) => void;
|
|
36
|
+
setStepNode?: (node: ReactNode | null) => void;
|
|
37
|
+
setError?: (err: SdkError) => void;
|
|
38
|
+
setResult?: (result: OnboardingResult) => void;
|
|
39
|
+
/** Called when the user leaves the flow via back on the first step. */
|
|
40
|
+
setExit?: (exit: OnboardingExit) => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Top-level entry point. Instantiate once per session, call `start()`, and
|
|
44
|
+
* `destroy()` from the host's unmount path.
|
|
45
|
+
*/
|
|
46
|
+
export declare class VelionOnboarding {
|
|
47
|
+
private readonly config;
|
|
48
|
+
private readonly emitter;
|
|
49
|
+
private readonly api;
|
|
50
|
+
private readonly constructionError;
|
|
51
|
+
private status;
|
|
52
|
+
private activeModule;
|
|
53
|
+
private view;
|
|
54
|
+
private readonly uiHandle;
|
|
55
|
+
private initAbortController;
|
|
56
|
+
private sseAbortController;
|
|
57
|
+
private sseCleanup;
|
|
58
|
+
private sseTerminalResolve;
|
|
59
|
+
private sseNextStepResolve;
|
|
60
|
+
private queuedNextStepCommand;
|
|
61
|
+
private lastSseEventId;
|
|
62
|
+
private previousStepResolve;
|
|
63
|
+
private queuedPreviousStepCommand;
|
|
64
|
+
private backExitResolve;
|
|
65
|
+
private queuedBackExitStep;
|
|
66
|
+
private backRequestInFlight;
|
|
67
|
+
/** Resolver for the in-flight retry dialog (RETRY_STEP), cleared on destroy. */
|
|
68
|
+
private retryDialogResolve;
|
|
69
|
+
/** Per-step reversibility (workflow order) cached from the initial GET, used to
|
|
70
|
+
* derive `can_go_back` for steps reached via SSE (which doesn't carry it). */
|
|
71
|
+
private stepReversibility;
|
|
72
|
+
private sessionDeclineHandler;
|
|
73
|
+
private pendingSessionDeclined;
|
|
74
|
+
private pendingTerminalEvent;
|
|
75
|
+
private sessionEnded;
|
|
76
|
+
constructor(config: VelionConfig);
|
|
77
|
+
/** Connects an `OrchestratorView` (typically `VelionOnboardingScreen`). */
|
|
78
|
+
attachView(view: OrchestratorView): void;
|
|
79
|
+
/** Detaches the active view (called from screen unmount). */
|
|
80
|
+
detachView(): void;
|
|
81
|
+
on<K extends keyof SdkEventMap>(event: K, listener: (payload: SdkEventMap[K]) => void): () => void;
|
|
82
|
+
getStatus(): SdkStatus;
|
|
83
|
+
/**
|
|
84
|
+
* Hot-rotate the bearer token used by every subsequent backend call. The SSE
|
|
85
|
+
* stream is also reopened so the new token reaches the server-side authenticator.
|
|
86
|
+
*/
|
|
87
|
+
refreshSessionToken(token: string, expiresAt?: string): void;
|
|
88
|
+
start(): Promise<void>;
|
|
89
|
+
destroy(): void;
|
|
90
|
+
private initialize;
|
|
91
|
+
private validateSessionState;
|
|
92
|
+
private runStepMachine;
|
|
93
|
+
private createModule;
|
|
94
|
+
private finalizeSessionWithTerminalEvent;
|
|
95
|
+
private finalizeSessionSingleGet;
|
|
96
|
+
private completeFlow;
|
|
97
|
+
/**
|
|
98
|
+
* Ends the flow without a verdict and notifies the host via `onExit`. Not an
|
|
99
|
+
* error: the UI is cleared so the host can dismiss the SDK. Triggered by
|
|
100
|
+
* backing out of the first reversible step (`BACK_EXIT`) or cancelling the
|
|
101
|
+
* retry dialog (`RETRY_CANCELLED`).
|
|
102
|
+
*/
|
|
103
|
+
private exitFlow;
|
|
104
|
+
/**
|
|
105
|
+
* Mounts the retry dialog for a `RETRY_STEP` and resolves with the user's
|
|
106
|
+
* choice. Copy is derived from the step (not the backend `reason`, which is a
|
|
107
|
+
* diagnostic string) and can be overridden per-step via `retryStepTexts`.
|
|
108
|
+
*/
|
|
109
|
+
private presentRetryStepDialog;
|
|
110
|
+
private endFlowWithSessionDeclined;
|
|
111
|
+
private openSseStream;
|
|
112
|
+
private handleSseEvent;
|
|
113
|
+
private extractNextStepCommand;
|
|
114
|
+
/**
|
|
115
|
+
* Fire-and-forget reverse navigation. POSTs `/sessions/:id/back`; the actual
|
|
116
|
+
* step transition arrives via SSE (`PREVIOUS_STEP`). A `400` (session not
|
|
117
|
+
* IN_PROGRESS) or any other failure is swallowed — the user keeps editing the
|
|
118
|
+
* current step. De-duplicated so rapid taps don't stack requests.
|
|
119
|
+
*/
|
|
120
|
+
private requestBackNavigation;
|
|
121
|
+
/**
|
|
122
|
+
* Derives `can_go_back` for a step from the cached workflow reversibility map.
|
|
123
|
+
* Matches the backend's barrier model: a step can go back when any earlier
|
|
124
|
+
* step is reversible (navigate) or the step itself is the first reversible one
|
|
125
|
+
* (back exits). Fallback only — an explicit `can_go_back` from the backend
|
|
126
|
+
* (GET, or a ROUTING_COMMAND that carries it) always wins.
|
|
127
|
+
*/
|
|
128
|
+
private resolveCanGoBack;
|
|
129
|
+
/**
|
|
130
|
+
* Wait for the next ROUTING_COMMAND. The orchestrator races this with a 30 s
|
|
131
|
+
* timeout that, on fire, falls back to a fresh GET /sessions/:id to recover
|
|
132
|
+
* if SSE was missed.
|
|
133
|
+
*/
|
|
134
|
+
private resolveNextStepAfterCompletion;
|
|
135
|
+
private waitForRoutingAfterBackendOnlyStep;
|
|
136
|
+
private waitForTerminalSseEvent;
|
|
137
|
+
/**
|
|
138
|
+
* Drain a pending terminal event (e.g. SESSION_APPROVED arrived while the
|
|
139
|
+
* orchestrator was busy mid-step). Returns true when the flow has been ended
|
|
140
|
+
* by the consumed event.
|
|
141
|
+
*/
|
|
142
|
+
private consumePendingTerminalEvent;
|
|
143
|
+
/**
|
|
144
|
+
* Runs the active step, resolving on the first of:
|
|
145
|
+
* - `completed` — the module's `run()` resolved (user advanced),
|
|
146
|
+
* - `declined` — SESSION_DECLINED arrived mid-step,
|
|
147
|
+
* - `back` — a PREVIOUS_STEP routing command arrived (user tapped back),
|
|
148
|
+
* - `exit` — a BACK_EXIT routing command arrived (back on the first
|
|
149
|
+
* reversible step → leave the flow).
|
|
150
|
+
*
|
|
151
|
+
* Rejects only if `run()` itself throws. Used in place of the plain decline
|
|
152
|
+
* race for the step loop so reverse navigation can interrupt an active form.
|
|
153
|
+
*/
|
|
154
|
+
private awaitModuleOutcome;
|
|
155
|
+
/**
|
|
156
|
+
* Race a step's promise against SESSION_DECLINED. If decline arrives first,
|
|
157
|
+
* `declined` is true so the caller can short-circuit cleanup.
|
|
158
|
+
*/
|
|
159
|
+
private withSessionDeclineRace;
|
|
160
|
+
private wireExternalCallbacks;
|
|
161
|
+
private setStatus;
|
|
162
|
+
private emitError;
|
|
163
|
+
private isEnglish;
|
|
164
|
+
private localizedLoadingMsg;
|
|
165
|
+
private localizedProcessingMsg;
|
|
166
|
+
private localizedFinalizingMsg;
|
|
167
|
+
private showLoading;
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=VelionOnboarding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VelionOnboarding.d.ts","sourceRoot":"","sources":["../../../src/core/VelionOnboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAuCH,OAAO,EAEL,KAAK,YAAY,IAAI,eAAe,EACpC,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAIpB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOtD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,eAAe,EACf,aAAa,GAAG,eAAe,GAAG,oBAAoB,CACvD,CAAC;AAsEF;;;;;;;;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;IAC/C,uEAAuE;IACvE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CAC1C;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8C;IACrE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwC;IAChE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAY;IAChC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAkB;IAEpD,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,IAAI,CAAwB;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAEvB;IAEF,OAAO,CAAC,mBAAmB,CAAyB;IACpD,OAAO,CAAC,kBAAkB,CAAyB;IACnD,OAAO,CAAC,UAAU,CAA6B;IAE/C,OAAO,CAAC,kBAAkB,CAA0D;IACpF,OAAO,CAAC,kBAAkB,CAAwD;IAClF,OAAO,CAAC,qBAAqB,CAAgC;IAC7D,OAAO,CAAC,cAAc,CAAO;IAE7B,OAAO,CAAC,mBAAmB,CAAqD;IAChF,OAAO,CAAC,yBAAyB,CAAoC;IACrE,OAAO,CAAC,eAAe,CAA6D;IACpF,OAAO,CAAC,kBAAkB,CAAqD;IAC/E,OAAO,CAAC,mBAAmB,CAAS;IAEpC,gFAAgF;IAChF,OAAO,CAAC,kBAAkB,CAAuD;IAEjF;kFAC8E;IAC9E,OAAO,CAAC,iBAAiB,CAAoE;IAE7F,OAAO,CAAC,qBAAqB,CAA0D;IACvF,OAAO,CAAC,sBAAsB,CAAuC;IACrE,OAAO,CAAC,oBAAoB,CAAuC;IACnE,OAAO,CAAC,YAAY,CAAS;gBAEjB,MAAM,EAAE,YAAY;IA0BhC,2EAA2E;IAC3E,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAIxC,6DAA6D;IAC7D,UAAU,IAAI,IAAI;IAIlB,EAAE,CAAC,CAAC,SAAS,MAAM,WAAW,EAC5B,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,GAC1C,MAAM,IAAI;IAIb,SAAS,IAAI,SAAS;IAItB;;;OAGG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAYtD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B5B,OAAO,IAAI,IAAI;YAsBD,UAAU;IAkDxB,OAAO,CAAC,oBAAoB;YAkBd,cAAc;IAiO5B,OAAO,CAAC,YAAY;YAmGN,gCAAgC;YA6BhC,wBAAwB;IAkBtC,OAAO,CAAC,YAAY;IAcpB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IAqBhB;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IA8B9B,OAAO,CAAC,0BAA0B;IA4BlC,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,cAAc;IA4GtB,OAAO,CAAC,sBAAsB;IAgB9B;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAe7B;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IAwDtC,OAAO,CAAC,kCAAkC;IAI1C,OAAO,CAAC,uBAAuB;IAqB/B;;;;OAIG;YACW,2BAA2B;IAYzC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,kBAAkB;IAoC1B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAkC9B,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,WAAW;CAGpB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Copy resolution for the retry dialog shown on
|
|
3
|
+
* `ROUTING_COMMAND / RETRY_STEP` (a step failed but the retry quota is not yet
|
|
4
|
+
* exhausted, so the backend asks the SDK to re-present it).
|
|
5
|
+
*
|
|
6
|
+
* The backend `reason` is intentionally NOT used here: it is a diagnostic string
|
|
7
|
+
* (e.g. `"STEP_FAILED_RETRY_ALLOWED (attempt 1/3)"`), not user-facing localized
|
|
8
|
+
* copy. The dialog title/message are derived from the step being retried, with a
|
|
9
|
+
* generic fallback, and can be overridden per-step by the host via
|
|
10
|
+
* `VelionConfig.retryStepTexts`.
|
|
11
|
+
*/
|
|
12
|
+
import type { OnboardingStep, VelionRetryStepTexts } from '../types';
|
|
13
|
+
export interface ResolvedRetryStepCopy {
|
|
14
|
+
title: string;
|
|
15
|
+
message: string;
|
|
16
|
+
retryLabel: string;
|
|
17
|
+
cancelLabel: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resolves the retry dialog copy for `step`. Precedence for title/message:
|
|
21
|
+
* 1. host override (`retryStepTexts[step][lang]`),
|
|
22
|
+
* 2. SDK per-step default (i18n `retryStep.steps[step]`),
|
|
23
|
+
* 3. generic SDK default (i18n `retryStep.default*`).
|
|
24
|
+
* The retry/cancel button labels always come from the i18n table.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveRetryStepCopy(locale: string | undefined, texts: VelionRetryStepTexts | undefined, step: OnboardingStep): ResolvedRetryStepCopy;
|
|
27
|
+
//# sourceMappingURL=retryStepCopy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retryStepCopy.d.ts","sourceRoot":"","sources":["../../../src/core/retryStepCopy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGrE,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAMD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,oBAAoB,GAAG,SAAS,EACvC,IAAI,EAAE,cAAc,GACnB,qBAAqB,CAgBvB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pure parsers for SSE `ROUTING_COMMAND` payloads.
|
|
3
|
+
*
|
|
4
|
+
* Kept free of React Native imports so they can be unit-tested in a plain node
|
|
5
|
+
* environment. The orchestrator owns the side effects (navigation, POSTs); these
|
|
6
|
+
* functions only translate a raw `OnboardingSessionEvent` into a typed command.
|
|
7
|
+
*/
|
|
8
|
+
import type { OnboardingSessionEvent, OnboardingStep } from '../types';
|
|
9
|
+
/**
|
|
10
|
+
* Reverse-navigation command (`ROUTING_COMMAND / PREVIOUS_STEP`). Carries the
|
|
11
|
+
* re-opened step plus its config and the previously-captured data for prefill.
|
|
12
|
+
*/
|
|
13
|
+
export interface PreviousStepCommand {
|
|
14
|
+
step: OnboardingStep;
|
|
15
|
+
stepConfig?: Record<string, unknown>;
|
|
16
|
+
stepResult?: Record<string, unknown>;
|
|
17
|
+
/** Whether the re-opened step can itself go back further (when the backend sends it). */
|
|
18
|
+
canGoBack?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parses a reverse-navigation command from an SSE event. Returns `null` for any
|
|
22
|
+
* event that is not a `ROUTING_COMMAND` with `action === 'PREVIOUS_STEP'` and a
|
|
23
|
+
* `step_code`. `step_config` (config) and `step_result` (prefill) are forwarded
|
|
24
|
+
* when present.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parsePreviousStepCommand(event: OnboardingSessionEvent): PreviousStepCommand | null;
|
|
27
|
+
/** Back-exit command (`ROUTING_COMMAND / BACK_EXIT`): leave the flow entirely. */
|
|
28
|
+
export interface BackExitCommand {
|
|
29
|
+
/** The step the user exited from (`step_code`), when the backend provides it. */
|
|
30
|
+
step?: OnboardingStep;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parses a back-exit command from an SSE event. The backend emits this when the
|
|
34
|
+
* user taps "back" on the first reversible step (no earlier step to return to),
|
|
35
|
+
* signalling the SDK to leave the flow. Returns `null` for any other event.
|
|
36
|
+
* `step_code` is forwarded when present but is not required.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseBackExitCommand(event: OnboardingSessionEvent): BackExitCommand | null;
|
|
39
|
+
//# sourceMappingURL=routingCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routingCommands.d.ts","sourceRoot":"","sources":["../../../src/core/routingCommands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,yFAAyF;IACzF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,sBAAsB,GAC5B,mBAAmB,GAAG,IAAI,CAW5B;AAED,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,iFAAiF;IACjF,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,sBAAsB,GAC5B,eAAe,GAAG,IAAI,CAKxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Default and merged copy for the SESSION_DECLINED SSE error screen.
|
|
3
|
+
*/
|
|
4
|
+
import type { VelionSessionDeclinedReasonTexts } from '../types';
|
|
5
|
+
export interface ResolvedSessionDeclinedCopy {
|
|
6
|
+
title: string;
|
|
7
|
+
message: string;
|
|
8
|
+
dismissLabel: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Resolves title, body, and dismiss label for a SESSION_DECLINED screen.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveSessionDeclinedCopy(locale: string | undefined, texts: VelionSessionDeclinedReasonTexts | undefined, reason: string | undefined,
|
|
14
|
+
/** Same dismiss as `VelionFinalResultScreenTexts.dismissLabel` when set. */
|
|
15
|
+
finalResultDismissLabel?: string): ResolvedSessionDeclinedCopy;
|
|
16
|
+
//# sourceMappingURL=sessionDeclinedCopy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionDeclinedCopy.d.ts","sourceRoot":"","sources":["../../../src/core/sessionDeclinedCopy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAGjE,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAoCD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,gCAAgC,GAAG,SAAS,EACnD,MAAM,EAAE,MAAM,GAAG,SAAS;AAC1B,4EAA4E;AAC5E,uBAAuB,CAAC,EAAE,MAAM,GAC/B,2BAA2B,CAmB7B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Maps backend OnboardingDto (GET /sessions/:id) to SDK SessionState.
|
|
3
|
+
*/
|
|
4
|
+
import type { OnboardingDtoResponse, OnboardingResult, OnboardingStep, SessionState } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Maps the onboarding DTO returned by GET /sessions/:sessionId to the
|
|
7
|
+
* SessionState shape used by the step machine.
|
|
8
|
+
*/
|
|
9
|
+
export declare function mapOnboardingDtoToSessionState(dto: OnboardingDtoResponse): SessionState;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves whether a step is reversible. Prefers an explicit boolean flag
|
|
12
|
+
* (e.g. `current_step.reversible`); otherwise reads the `reversible` key the
|
|
13
|
+
* backend stamps into the step config. Returns `undefined` when neither source
|
|
14
|
+
* carries the flag, so callers can distinguish "not reversible" from "unknown".
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveReversibleFlag(explicit: boolean | undefined, config: Record<string, unknown> | undefined): boolean | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Derives `can_go_back` for a step from the workflow reversibility map (used as a
|
|
19
|
+
* fallback when the backend doesn't send `can_go_back` explicitly — e.g. on a
|
|
20
|
+
* step reached via SSE). Matches the backend's barrier model: a step can go back
|
|
21
|
+
* when any earlier step is reversible (navigate to it) or the step itself is the
|
|
22
|
+
* first reversible step (back exits the flow). Returns `false` when the step is
|
|
23
|
+
* not in the cached order.
|
|
24
|
+
*/
|
|
25
|
+
export declare function deriveCanGoBack(step: OnboardingStep, order: ReadonlyArray<{
|
|
26
|
+
code: OnboardingStep;
|
|
27
|
+
reversible: boolean;
|
|
28
|
+
}>): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Maps GET /sessions `status` to {@link OnboardingResult.status}.
|
|
31
|
+
* Unknown values fall back to `MANUAL_REVIEW`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function mapSessionDtoStatusToResultStatus(raw: string | undefined): OnboardingResult['status'];
|
|
34
|
+
/**
|
|
35
|
+
* True when GET session has no runnable step but onboarding is already finished
|
|
36
|
+
* (no `current_step` expected).
|
|
37
|
+
*/
|
|
38
|
+
export declare function isTerminalSessionStatusFromDto(raw: string | undefined): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* True when the SDK must run workflow steps; backend should send `current_step`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function requiresCurrentStepForSessionStatus(raw: string | undefined): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Builds OnboardingResult from the same onboarding DTO when status is terminal.
|
|
45
|
+
*/
|
|
46
|
+
export declare function mapOnboardingDtoToResult(dto: OnboardingDtoResponse, sessionId: string): OnboardingResult;
|
|
47
|
+
/**
|
|
48
|
+
* Builds OnboardingResult using completed_at and referenceId from the DTO
|
|
49
|
+
* but with an explicit terminal status (e.g. from a terminal SSE event).
|
|
50
|
+
*/
|
|
51
|
+
export declare function mapOnboardingDtoToResultWithStatus(dto: OnboardingDtoResponse, sessionId: string, terminalStatus: OnboardingResult['status'], terminalReason?: string): OnboardingResult;
|
|
52
|
+
//# sourceMappingURL=sessionStateMapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionStateMapper.d.ts","sourceRoot":"","sources":["../../../src/core/sessionStateMapper.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,YAAY,EAGb,MAAM,UAAU,CAAC;AAIlB;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,qBAAqB,GACzB,YAAY,CAmFd;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAC1C,OAAO,GAAG,SAAS,CAMrB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,GAClE,OAAO,CAMT;AAeD;;;GAGG;AACH,wBAAgB,iCAAiC,CAC/C,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,gBAAgB,CAAC,QAAQ,CAAC,CAO5B;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAS/E;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAGpF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,qBAAqB,EAC1B,SAAS,EAAE,MAAM,GAChB,gBAAgB,CAGlB;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,GAAG,EAAE,qBAAqB,EAC1B,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAC1C,cAAc,CAAC,EAAE,MAAM,GACtB,gBAAgB,CAElB"}
|