@smileid/usesmileid 12.0.2 → 12.1.1
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 +12 -0
- package/README.md +65 -39
- package/dist/camera/camera_configuration.d.ts +0 -1
- package/dist/camera/camera_configuration.js +1 -2
- package/dist/camera/camera_defaults.d.ts +1 -2
- package/dist/camera/camera_defaults.js +1 -26
- package/dist/camera/camera_lens.d.ts +1 -5
- package/dist/camera/camera_lens.js +1 -12
- package/dist/camera/camera_permissions.d.ts +2 -7
- package/dist/camera/camera_permissions.js +1 -23
- package/dist/camera/document_image_pipeline.d.ts +0 -1
- package/dist/camera/document_image_pipeline.js +1 -70
- package/dist/camera/document_resize_target.d.ts +0 -1
- package/dist/camera/document_resize_target.js +1 -17
- package/dist/camera/focus_state.d.ts +0 -1
- package/dist/camera/focus_state.js +1 -13
- package/dist/camera/kamera_config_factory.d.ts +8 -0
- package/dist/camera/kamera_config_factory.js +1 -0
- package/dist/camera/kamera_error_mapping.d.ts +11 -0
- package/dist/camera/kamera_error_mapping.js +1 -0
- package/dist/camera/use_kamera_camera_permission.d.ts +8 -0
- package/dist/camera/use_kamera_camera_permission.js +1 -0
- package/dist/camera/use_kamera_orientation.d.ts +9 -0
- package/dist/camera/use_kamera_orientation.js +1 -0
- package/dist/camera/use_smile_id_frame_stream.d.ts +0 -1
- package/dist/camera/use_smile_id_frame_stream.js +1 -93
- package/dist/camera/use_smile_id_kamera_camera_system.d.ts +64 -0
- package/dist/camera/use_smile_id_kamera_camera_system.js +1 -0
- package/dist/camera/use_smile_id_kamera_preview.d.ts +12 -0
- package/dist/camera/use_smile_id_kamera_preview.js +1 -0
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.d.ts +0 -1
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.js +1 -17
- package/dist/core/exception/builder_validation_exception.d.ts +0 -1
- package/dist/core/exception/builder_validation_exception.js +1 -37
- package/dist/core/exception/capture_validation_exceptions.d.ts +0 -1
- package/dist/core/exception/capture_validation_exceptions.js +1 -10
- package/dist/core/exception/consent_validation_exceptions.d.ts +0 -1
- package/dist/core/exception/consent_validation_exceptions.js +1 -8
- package/dist/core/exception/duplicate_screen_type_exception.d.ts +0 -1
- package/dist/core/exception/duplicate_screen_type_exception.js +1 -20
- package/dist/core/exception/empty_screens_block_exception.d.ts +0 -1
- package/dist/core/exception/empty_screens_block_exception.js +1 -17
- package/dist/core/exception/flow_exceptions.d.ts +0 -1
- package/dist/core/exception/flow_exceptions.js +1 -38
- package/dist/core/exception/index.d.ts +3 -2
- package/dist/core/exception/index.js +1 -54
- package/dist/core/exception/invalid_consent_config_exception.d.ts +0 -1
- package/dist/core/exception/invalid_consent_config_exception.js +1 -18
- package/dist/core/exception/invalid_consent_information_exception.d.ts +0 -1
- package/dist/core/exception/invalid_consent_information_exception.js +1 -19
- package/dist/core/exception/invalid_document_capture_config_exception.d.ts +0 -1
- package/dist/core/exception/invalid_document_capture_config_exception.js +1 -20
- package/dist/core/exception/invalid_field_value_exception.d.ts +0 -1
- package/dist/core/exception/invalid_field_value_exception.js +1 -20
- package/dist/core/exception/invalid_job_type_screen_config_exception.d.ts +1 -1
- package/dist/core/exception/invalid_job_type_screen_config_exception.js +1 -61
- package/dist/core/exception/invalid_missing_capture_type_exception.d.ts +0 -1
- package/dist/core/exception/invalid_missing_capture_type_exception.js +1 -17
- package/dist/core/exception/invalid_screen_order_exception.d.ts +0 -1
- package/dist/core/exception/invalid_screen_order_exception.js +1 -22
- package/dist/core/exception/invalid_selfie_capture_config_exception.d.ts +0 -1
- package/dist/core/exception/invalid_selfie_capture_config_exception.js +1 -20
- package/dist/core/exception/issue_severity.d.ts +0 -1
- package/dist/core/exception/issue_severity.js +1 -13
- package/dist/core/exception/job_validation_exceptions.d.ts +0 -1
- package/dist/core/exception/job_validation_exceptions.js +1 -12
- package/dist/core/exception/liveness_frame_count_exception.d.ts +0 -1
- package/dist/core/exception/liveness_frame_count_exception.js +1 -19
- package/dist/core/exception/missing_capture_for_preview_exception.d.ts +0 -1
- package/dist/core/exception/missing_capture_for_preview_exception.js +1 -22
- package/dist/core/exception/missing_job_type_exception.d.ts +0 -1
- package/dist/core/exception/missing_job_type_exception.js +1 -15
- package/dist/core/exception/missing_ml_configuration_block_exception.d.ts +0 -1
- package/dist/core/exception/missing_ml_configuration_block_exception.js +1 -19
- package/dist/core/exception/missing_network_configuration_block_exception.d.ts +0 -1
- package/dist/core/exception/missing_network_configuration_block_exception.js +1 -19
- package/dist/core/exception/missing_partner_config_exception.d.ts +4 -1
- package/dist/core/exception/missing_partner_config_exception.js +1 -35
- package/dist/core/exception/missing_required_field_exception.d.ts +0 -1
- package/dist/core/exception/missing_required_field_exception.js +1 -18
- package/dist/core/exception/screen_config_validation_exceptions.d.ts +0 -1
- package/dist/core/exception/screen_config_validation_exceptions.js +1 -11
- package/dist/core/exception/unused_job_params_exception.d.ts +16 -0
- package/dist/core/exception/unused_job_params_exception.js +1 -0
- package/dist/core/exception/use_smile_id_attestation_exception.d.ts +0 -1
- package/dist/core/exception/use_smile_id_attestation_exception.js +1 -12
- package/dist/core/exception/use_smile_id_builder_exception.d.ts +0 -1
- package/dist/core/exception/use_smile_id_builder_exception.js +1 -19
- package/dist/core/exception/use_smile_id_camera_exception.d.ts +0 -1
- package/dist/core/exception/use_smile_id_camera_exception.js +1 -13
- package/dist/core/exception/use_smile_id_camera_surface_exception.d.ts +15 -0
- package/dist/core/exception/use_smile_id_camera_surface_exception.js +1 -0
- package/dist/core/exception/use_smile_id_error_code.d.ts +8 -1
- package/dist/core/exception/use_smile_id_error_code.js +1 -71
- package/dist/core/exception/use_smile_id_exception.d.ts +0 -1
- package/dist/core/exception/use_smile_id_exception.js +1 -39
- package/dist/core/exception/use_smile_id_general_exception.d.ts +0 -1
- package/dist/core/exception/use_smile_id_general_exception.js +1 -13
- package/dist/core/exception/use_smile_id_network_exception.d.ts +0 -1
- package/dist/core/exception/use_smile_id_network_exception.js +1 -203
- package/dist/core/exception/use_smile_id_validation_exception.d.ts +0 -1
- package/dist/core/exception/use_smile_id_validation_exception.js +1 -13
- package/dist/core/models/config.d.ts +8 -1
- package/dist/core/models/config.js +1 -2
- package/dist/core/models/document_capture_mode.d.ts +0 -1
- package/dist/core/models/document_capture_mode.js +1 -47
- package/dist/core/models/document_type.d.ts +5 -1
- package/dist/core/models/document_type.js +1 -47
- package/dist/core/models/flow_step.d.ts +0 -1
- package/dist/core/models/flow_step.js +1 -16
- package/dist/core/models/global_privacy_control.d.ts +0 -1
- package/dist/core/models/global_privacy_control.js +1 -39
- package/dist/core/models/head_turn_direction.d.ts +0 -1
- package/dist/core/models/head_turn_direction.js +1 -14
- package/dist/core/models/job_type.d.ts +0 -1
- package/dist/core/models/job_type.js +1 -43
- package/dist/core/models/ml_config.d.ts +0 -1
- package/dist/core/models/ml_config.js +1 -27
- package/dist/core/models/network_config.d.ts +0 -1
- package/dist/core/models/network_config.js +1 -41
- package/dist/core/models/params.d.ts +0 -1
- package/dist/core/models/params.js +1 -5
- package/dist/core/models/result.d.ts +0 -1
- package/dist/core/models/result.js +1 -17
- package/dist/data/api/auth/token_holder.d.ts +0 -1
- package/dist/data/api/auth/token_holder.js +1 -67
- package/dist/data/api/interceptors/gzip_interceptor.d.ts +0 -1
- package/dist/data/api/interceptors/gzip_interceptor.js +1 -29
- package/dist/data/api/interceptors/logging_interceptor.d.ts +0 -1
- package/dist/data/api/interceptors/logging_interceptor.js +1 -108
- package/dist/data/api/interceptors/sensitive_headers.d.ts +0 -1
- package/dist/data/api/interceptors/sensitive_headers.js +1 -42
- package/dist/data/api/interceptors/smile_auth_interceptor.d.ts +0 -1
- package/dist/data/api/interceptors/smile_auth_interceptor.js +1 -57
- package/dist/data/api/interceptors/smile_integrity_interceptor.d.ts +0 -1
- package/dist/data/api/interceptors/smile_integrity_interceptor.js +1 -79
- package/dist/data/api/interceptors/smile_request_mac_interceptor.d.ts +0 -1
- package/dist/data/api/interceptors/smile_request_mac_interceptor.js +1 -77
- package/dist/data/api/interceptors/token_refresh_interceptor.d.ts +0 -1
- package/dist/data/api/interceptors/token_refresh_interceptor.js +1 -58
- package/dist/data/api/smile_id_api.d.ts +0 -1
- package/dist/data/api/smile_id_api.js +1 -374
- package/dist/data/compression/compressible_asset.d.ts +0 -1
- package/dist/data/compression/compressible_asset.js +1 -34
- package/dist/data/compression/payload_compression_config.d.ts +0 -1
- package/dist/data/compression/payload_compression_config.js +1 -52
- package/dist/data/compression/payload_compression_runner.d.ts +8 -1
- package/dist/data/compression/payload_compression_runner.js +1 -55
- package/dist/data/compression/payload_compressor.d.ts +0 -1
- package/dist/data/compression/payload_compressor.js +1 -126
- package/dist/data/compression/uri_compressible_asset.d.ts +0 -1
- package/dist/data/compression/uri_compressible_asset.js +1 -77
- package/dist/data/dsl/builder/cache_config_builder.d.ts +0 -1
- package/dist/data/dsl/builder/cache_config_builder.js +1 -24
- package/dist/data/dsl/builder/config_builder.d.ts +0 -1
- package/dist/data/dsl/builder/config_builder.js +1 -137
- package/dist/data/dsl/builder/interceptor_config_builder.d.ts +0 -1
- package/dist/data/dsl/builder/interceptor_config_builder.js +1 -71
- package/dist/data/dsl/builder/retry_config_builder.d.ts +0 -1
- package/dist/data/dsl/builder/retry_config_builder.js +1 -46
- package/dist/data/dsl/builder/timeout_config_builder.d.ts +0 -1
- package/dist/data/dsl/builder/timeout_config_builder.js +1 -26
- package/dist/data/dsl/use_smile_id_network_builder.d.ts +0 -1
- package/dist/data/dsl/use_smile_id_network_builder.js +1 -83
- package/dist/data/factory/networking_factory.d.ts +0 -1
- package/dist/data/factory/networking_factory.js +1 -174
- package/dist/data/model/image_dimensions.d.ts +0 -1
- package/dist/data/model/image_dimensions.js +1 -2
- package/dist/data/model/job_request.d.ts +4 -6
- package/dist/data/model/job_request.js +1 -2
- package/dist/data/model/job_submission_response.d.ts +0 -1
- package/dist/data/model/job_submission_response.js +1 -2
- package/dist/data/model/sdk_config.d.ts +0 -1
- package/dist/data/model/sdk_config.js +1 -68
- package/dist/data/model/sdk_config_capture.d.ts +0 -1
- package/dist/data/model/sdk_config_capture.js +1 -69
- package/dist/data/model/sdk_config_source.d.ts +0 -1
- package/dist/data/model/sdk_config_source.js +1 -24
- package/dist/data/model/token_payload.d.ts +0 -1
- package/dist/data/model/token_payload.js +1 -132
- package/dist/data/model/user_details_payload.d.ts +0 -1
- package/dist/data/model/user_details_payload.js +1 -53
- package/dist/data/repository/use_smile_id_repository.d.ts +2 -2
- package/dist/data/repository/use_smile_id_repository.js +1 -2
- package/dist/data/repository/use_smile_id_repository_impl.d.ts +2 -2
- package/dist/data/repository/use_smile_id_repository_impl.js +1 -149
- package/dist/data/security/request_canonicalizer.d.ts +0 -1
- package/dist/data/security/request_canonicalizer.js +1 -132
- package/dist/data/security/request_timestamp.d.ts +0 -1
- package/dist/data/security/request_timestamp.js +1 -13
- package/dist/data/security/security_policy.d.ts +0 -1
- package/dist/data/security/security_policy.js +1 -61
- package/dist/data/security/signing_crypto.d.ts +0 -1
- package/dist/data/security/signing_crypto.js +1 -145
- package/dist/data/security/smile_id_crypto_error.d.ts +0 -1
- package/dist/data/security/smile_id_crypto_error.js +1 -14
- package/dist/data/security/smile_id_crypto_manager.d.ts +0 -1
- package/dist/data/security/smile_id_crypto_manager.js +1 -40
- package/dist/data/smile_id_urls.d.ts +0 -1
- package/dist/data/smile_id_urls.js +1 -14
- package/dist/data/util/retry_util.d.ts +0 -1
- package/dist/data/util/retry_util.js +1 -74
- package/dist/data/util/use_smile_id_token_decoder.d.ts +0 -1
- package/dist/data/util/use_smile_id_token_decoder.js +1 -148
- package/dist/index.d.ts +3 -6
- package/dist/index.js +1 -142
- package/dist/l10n/strings_en.d.ts +18 -14
- package/dist/l10n/strings_en.js +2 -145
- package/dist/l10n/use_smile_id_localizations.d.ts +14 -10
- package/dist/l10n/use_smile_id_localizations.js +1 -546
- package/dist/l10n/use_smile_id_localizations_provider.d.ts +0 -1
- package/dist/l10n/use_smile_id_localizations_provider.js +1 -53
- package/dist/metadata/builder_configuration.d.ts +0 -1
- package/dist/metadata/builder_configuration.js +1 -35
- package/dist/metadata/captured_image_properties.d.ts +0 -1
- package/dist/metadata/captured_image_properties.js +1 -11
- package/dist/metadata/device_orientation_collector.d.ts +0 -1
- package/dist/metadata/device_orientation_collector.js +1 -66
- package/dist/metadata/document_image_origin.d.ts +0 -1
- package/dist/metadata/document_image_origin.js +1 -19
- package/dist/metadata/geolocation.d.ts +0 -1
- package/dist/metadata/geolocation.js +1 -40
- package/dist/metadata/metadata_configuration_mappers.d.ts +0 -1
- package/dist/metadata/metadata_configuration_mappers.js +1 -178
- package/dist/metadata/model_configuration.d.ts +0 -1
- package/dist/metadata/model_configuration.js +1 -44
- package/dist/metadata/optional_native_modules.d.ts +0 -1
- package/dist/metadata/optional_native_modules.js +1 -206
- package/dist/metadata/use_smile_id_metadata.d.ts +0 -1
- package/dist/metadata/use_smile_id_metadata.js +1 -188
- package/dist/metadata/use_smile_id_metadata_factory.d.ts +11 -1
- package/dist/metadata/use_smile_id_metadata_factory.js +1 -501
- package/dist/presentation/assets/si_document_green_book_hero_animation.json +4740 -0
- package/dist/presentation/assets/si_document_hero_animation.json +4870 -0
- package/dist/presentation/assets/si_document_hero_back_animation.json +2122 -0
- package/dist/presentation/assets/si_document_passport_hero_animation.json +14540 -0
- package/dist/presentation/assets/si_ess_all_directions_hero_animation.json +5906 -0
- package/dist/presentation/assets/si_ess_animation_all_directions.json +5906 -0
- package/dist/presentation/assets/si_selfie_hero_animation.json +1468 -0
- package/dist/presentation/assets/si_smile_to_capture_animation.json +1412 -0
- package/dist/presentation/assets/svg/document_shimmer_strings.d.ts +0 -1
- package/dist/presentation/assets/svg/document_shimmer_strings.js +1 -14
- package/dist/presentation/assets/svg/instruction_svg_strings.d.ts +0 -1
- package/dist/presentation/assets/svg/instruction_svg_strings.js +1 -32
- package/dist/presentation/assets/svg/svg_strings.d.ts +0 -1
- package/dist/presentation/assets/svg/svg_strings.js +15 -46
- package/dist/presentation/components/face_oval_defaults.d.ts +0 -1
- package/dist/presentation/components/face_oval_defaults.js +1 -41
- package/dist/presentation/components/helpers/animated_lottie_view.d.ts +0 -1
- package/dist/presentation/components/helpers/animated_lottie_view.js +1 -9
- package/dist/presentation/components/helpers/capture_instruction_animation_spec.d.ts +2 -1
- package/dist/presentation/components/helpers/capture_instruction_animation_spec.js +1 -47
- package/dist/presentation/components/helpers/captured_document_image_fit.d.ts +6 -0
- package/dist/presentation/components/helpers/captured_document_image_fit.js +1 -0
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.d.ts +0 -1
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.js +1 -44
- package/dist/presentation/components/helpers/scaled_oval_geometry.d.ts +0 -1
- package/dist/presentation/components/helpers/scaled_oval_geometry.js +1 -29
- package/dist/presentation/components/icons/index.d.ts +0 -1
- package/dist/presentation/components/icons/index.js +1 -117
- package/dist/presentation/components/status_indicator_state.d.ts +0 -1
- package/dist/presentation/components/status_indicator_state.js +1 -19
- package/dist/presentation/components/use_smile_id_attribution.d.ts +2 -1
- package/dist/presentation/components/use_smile_id_attribution.js +1 -25
- package/dist/presentation/components/use_smile_id_back_button.d.ts +2 -1
- package/dist/presentation/components/use_smile_id_back_button.js +1 -38
- package/dist/presentation/components/use_smile_id_button.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_button.js +1 -69
- package/dist/presentation/components/use_smile_id_capture_content.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_capture_content.js +1 -137
- package/dist/presentation/components/use_smile_id_capture_instruction_animation.d.ts +3 -4
- package/dist/presentation/components/use_smile_id_capture_instruction_animation.js +1 -50
- package/dist/presentation/components/use_smile_id_capture_spinner.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_capture_spinner.js +1 -30
- package/dist/presentation/components/use_smile_id_captured_document_image.d.ts +4 -5
- package/dist/presentation/components/use_smile_id_captured_document_image.js +1 -39
- package/dist/presentation/components/use_smile_id_captured_image_oval.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_captured_image_oval.js +1 -63
- package/dist/presentation/components/use_smile_id_card_surface.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_card_surface.js +1 -37
- package/dist/presentation/components/use_smile_id_confirmation_buttons.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_confirmation_buttons.js +1 -48
- package/dist/presentation/components/use_smile_id_consent_row.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_consent_row.js +1 -32
- package/dist/presentation/components/use_smile_id_content_card.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_content_card.js +1 -41
- package/dist/presentation/components/use_smile_id_document_capture_controls.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_document_capture_controls.js +1 -120
- package/dist/presentation/components/use_smile_id_document_overlay.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_document_overlay.js +1 -158
- package/dist/presentation/components/use_smile_id_document_shimmer.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_document_shimmer.js +1 -23
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js +1 -77
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.js +1 -21
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.js +1 -14
- package/dist/presentation/components/use_smile_id_expandable_icon.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_expandable_icon.js +1 -55
- package/dist/presentation/components/use_smile_id_face_oval_image.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_face_oval_image.js +1 -41
- package/dist/presentation/components/use_smile_id_face_overlay.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_face_overlay.js +1 -194
- package/dist/presentation/components/use_smile_id_failed_content.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_failed_content.js +1 -44
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.js +1 -179
- package/dist/presentation/components/use_smile_id_instructions_hero.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_instructions_hero.js +1 -164
- package/dist/presentation/components/use_smile_id_learn_more_content.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_learn_more_content.js +1 -70
- package/dist/presentation/components/use_smile_id_loading_content.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_loading_content.js +1 -31
- package/dist/presentation/components/use_smile_id_loading_indicator.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_loading_indicator.js +1 -48
- package/dist/presentation/components/use_smile_id_oval_border_palette.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_oval_border_palette.js +1 -49
- package/dist/presentation/components/use_smile_id_partner_icon.d.ts +3 -1
- package/dist/presentation/components/use_smile_id_partner_icon.js +1 -34
- package/dist/presentation/components/use_smile_id_processing_center_indicator.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_processing_center_indicator.js +1 -44
- package/dist/presentation/components/use_smile_id_rounded_checkbox.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_rounded_checkbox.js +1 -41
- package/dist/presentation/components/use_smile_id_status_indicator.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_status_indicator.js +1 -22
- package/dist/presentation/components/use_smile_id_success_content.d.ts +0 -1
- package/dist/presentation/components/use_smile_id_success_content.js +1 -39
- package/dist/presentation/flow/analytics/use_smile_id_analytics_event.d.ts +0 -1
- package/dist/presentation/flow/analytics/use_smile_id_analytics_event.js +1 -71
- package/dist/presentation/flow/config/attribution_resolver.d.ts +17 -0
- package/dist/presentation/flow/config/attribution_resolver.js +1 -0
- package/dist/presentation/flow/config/flow_configuration.d.ts +0 -1
- package/dist/presentation/flow/config/flow_configuration.js +1 -2
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts +5 -1
- package/dist/presentation/flow/dsl/builder/config_builder.js +1 -50
- package/dist/presentation/flow/dsl/builder/ml_builder.d.ts +0 -1
- package/dist/presentation/flow/dsl/builder/ml_builder.js +1 -164
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts +0 -21
- package/dist/presentation/flow/dsl/builder/screens_builder.js +1 -215
- package/dist/presentation/flow/dsl/builder/theme_builder.d.ts +0 -1
- package/dist/presentation/flow/dsl/builder/theme_builder.js +1 -83
- package/dist/presentation/flow/dsl/flow_build_result.d.ts +0 -1
- package/dist/presentation/flow/dsl/flow_build_result.js +1 -2
- package/dist/presentation/flow/dsl/use_smile_id_builder.d.ts +0 -1
- package/dist/presentation/flow/dsl/use_smile_id_builder.js +1 -49
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.d.ts +0 -1
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js +1 -356
- package/dist/presentation/flow/flow_navigation_context.d.ts +0 -1
- package/dist/presentation/flow/flow_navigation_context.js +1 -34
- package/dist/presentation/flow/flow_navigation_manager.d.ts +2 -1
- package/dist/presentation/flow/flow_navigation_manager.js +1 -935
- package/dist/presentation/flow/graph/screen_renderer.d.ts +0 -1
- package/dist/presentation/flow/graph/screen_renderer.js +1 -31
- package/dist/presentation/flow/graph/screen_transition.d.ts +8 -0
- package/dist/presentation/flow/graph/screen_transition.js +1 -0
- package/dist/presentation/flow/job_submission_state.d.ts +0 -1
- package/dist/presentation/flow/job_submission_state.js +1 -2
- package/dist/presentation/flow/model/instruction_guideline.d.ts +0 -1
- package/dist/presentation/flow/model/instruction_guideline.js +1 -2
- package/dist/presentation/flow/model/instructions_defaults.d.ts +0 -1
- package/dist/presentation/flow/model/instructions_defaults.js +1 -130
- package/dist/presentation/flow/screen/helpers/analyzer_lifecycle.d.ts +18 -0
- package/dist/presentation/flow/screen/helpers/analyzer_lifecycle.js +1 -0
- package/dist/presentation/flow/screen/helpers/face_session_config.d.ts +0 -1
- package/dist/presentation/flow/screen/helpers/face_session_config.js +1 -65
- package/dist/presentation/flow/screen/helpers/failure_message.d.ts +3 -0
- package/dist/presentation/flow/screen/helpers/failure_message.js +1 -0
- package/dist/presentation/flow/screen/orchestrated_capture_screen.d.ts +0 -1
- package/dist/presentation/flow/screen/orchestrated_capture_screen.js +1 -237
- package/dist/presentation/flow/screen/orchestrated_consent_screen.d.ts +0 -1
- package/dist/presentation/flow/screen/orchestrated_consent_screen.js +1 -49
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.d.ts +0 -1
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.js +1 -47
- package/dist/presentation/flow/screen/orchestrated_preview_screen.d.ts +0 -1
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js +1 -34
- package/dist/presentation/flow/screen/orchestrated_processing_screen.d.ts +0 -1
- package/dist/presentation/flow/screen/orchestrated_processing_screen.js +1 -79
- package/dist/presentation/flow/screen/use_smile_id_orchestrated_screen_host.d.ts +0 -1
- package/dist/presentation/flow/screen/use_smile_id_orchestrated_screen_host.js +1 -22
- package/dist/presentation/flow/screen/validation_error_screen.d.ts +0 -1
- package/dist/presentation/flow/screen/validation_error_screen.js +1 -87
- package/dist/presentation/flow/use_smile_id_flow.d.ts +1 -2
- package/dist/presentation/flow/use_smile_id_flow.js +1 -297
- package/dist/presentation/flow/validation/flow_validator.d.ts +2 -13
- package/dist/presentation/flow/validation/flow_validator.js +1 -300
- package/dist/presentation/flow/validation/job_type_validator.d.ts +3 -1
- package/dist/presentation/flow/validation/job_type_validator.js +1 -459
- package/dist/presentation/flow/validation/user_details_validator.d.ts +0 -1
- package/dist/presentation/flow/validation/user_details_validator.js +1 -40
- package/dist/presentation/flow/validation/validation_state.d.ts +3 -4
- package/dist/presentation/flow/validation/validation_state.js +1 -23
- package/dist/presentation/screen/helpers/capture_screen_helpers.d.ts +0 -1
- package/dist/presentation/screen/helpers/capture_screen_helpers.js +1 -135
- package/dist/presentation/screen/helpers/capture_ui_state.d.ts +0 -1
- package/dist/presentation/screen/helpers/capture_ui_state.js +1 -179
- package/dist/presentation/screen/helpers/consent_screen_helpers.d.ts +0 -1
- package/dist/presentation/screen/helpers/consent_screen_helpers.js +1 -68
- package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts +0 -1
- package/dist/presentation/screen/helpers/ess_turn_haptics.js +1 -53
- package/dist/presentation/screen/helpers/feedback_debouncer.d.ts +0 -1
- package/dist/presentation/screen/helpers/feedback_debouncer.js +1 -77
- package/dist/presentation/screen/helpers/instructions_screen_helpers.d.ts +0 -3
- package/dist/presentation/screen/helpers/instructions_screen_helpers.js +1 -54
- package/dist/presentation/screen/helpers/preview_screen_helpers.d.ts +0 -1
- package/dist/presentation/screen/helpers/preview_screen_helpers.js +1 -27
- package/dist/presentation/screen/helpers/processing_screen_helpers.d.ts +0 -1
- package/dist/presentation/screen/helpers/processing_screen_helpers.js +1 -12
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts +7 -1
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js +1 -107
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts +0 -1
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.js +1 -79
- package/dist/presentation/screen/helpers/use_debounced_feedback_key.d.ts +0 -1
- package/dist/presentation/screen/helpers/use_debounced_feedback_key.js +1 -44
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts +8 -11
- package/dist/presentation/screen/use_smile_id_capture_screen.js +1 -640
- package/dist/presentation/screen/use_smile_id_consent_screen.d.ts +0 -1
- package/dist/presentation/screen/use_smile_id_consent_screen.js +1 -176
- package/dist/presentation/screen/use_smile_id_document_back_instructions.d.ts +6 -1
- package/dist/presentation/screen/use_smile_id_document_back_instructions.js +1 -43
- package/dist/presentation/screen/use_smile_id_document_preview_screen.d.ts +0 -1
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js +1 -69
- package/dist/presentation/screen/use_smile_id_instructions_screen.d.ts +0 -1
- package/dist/presentation/screen/use_smile_id_instructions_screen.js +2 -66
- package/dist/presentation/screen/use_smile_id_permission_screen.d.ts +0 -1
- package/dist/presentation/screen/use_smile_id_permission_screen.js +1 -28
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts +0 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.js +1 -71
- package/dist/presentation/screen/use_smile_id_processing_screen.d.ts +0 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.js +1 -85
- package/dist/presentation/state/processing_state.d.ts +0 -1
- package/dist/presentation/state/processing_state.js +1 -2
- package/dist/presentation/state/use_smile_id_overlay_state.d.ts +1 -3
- package/dist/presentation/state/use_smile_id_overlay_state.js +1 -56
- package/dist/presentation/theme/theme.d.ts +0 -1
- package/dist/presentation/theme/theme.js +1 -226
- package/dist/presentation/theme/theme_context.d.ts +0 -1
- package/dist/presentation/theme/theme_context.js +1 -31
- package/dist/presentation/theme/use_smile_id_motion.d.ts +0 -1
- package/dist/presentation/theme/use_smile_id_motion.js +1 -13
- package/dist/presentation/theme/use_use_smile_id_fonts.d.ts +0 -1
- package/dist/presentation/theme/use_use_smile_id_fonts.js +1 -64
- package/dist/presentation/utils/force_max_brightness.d.ts +0 -1
- package/dist/presentation/utils/force_max_brightness.js +1 -105
- package/dist/presentation/utils/locale_utils.d.ts +0 -1
- package/dist/presentation/utils/locale_utils.js +1 -74
- package/dist/presentation/utils/use_reduced_motion.d.ts +0 -1
- package/dist/presentation/utils/use_reduced_motion.js +1 -24
- package/dist/testing/fake_face_analyzer.d.ts +6 -1
- package/dist/testing/fake_face_analyzer.js +1 -52
- package/dist/testing/index.d.ts +0 -1
- package/dist/testing/index.js +1 -7
- package/dist/testing/scenario_expectations.d.ts +0 -1
- package/dist/testing/scenario_expectations.js +1 -65
- package/dist/testing/scenario_loader.d.ts +0 -1
- package/dist/testing/scenario_loader.js +1 -64
- package/dist/testing/scripted_scan_results.d.ts +3 -2
- package/dist/testing/scripted_scan_results.js +1 -52
- package/package.json +28 -30
- package/dist/camera/camera_configuration.d.ts.map +0 -1
- package/dist/camera/camera_configuration.js.map +0 -1
- package/dist/camera/camera_defaults.d.ts.map +0 -1
- package/dist/camera/camera_defaults.js.map +0 -1
- package/dist/camera/camera_lens.d.ts.map +0 -1
- package/dist/camera/camera_lens.js.map +0 -1
- package/dist/camera/camera_permissions.d.ts.map +0 -1
- package/dist/camera/camera_permissions.js.map +0 -1
- package/dist/camera/camera_preview_image.d.ts +0 -18
- package/dist/camera/camera_preview_image.d.ts.map +0 -1
- package/dist/camera/camera_preview_image.js +0 -8
- package/dist/camera/camera_preview_image.js.map +0 -1
- package/dist/camera/document_image_pipeline.d.ts.map +0 -1
- package/dist/camera/document_image_pipeline.js.map +0 -1
- package/dist/camera/document_resize_target.d.ts.map +0 -1
- package/dist/camera/document_resize_target.js.map +0 -1
- package/dist/camera/focus_state.d.ts.map +0 -1
- package/dist/camera/focus_state.js.map +0 -1
- package/dist/camera/orientation_degrees.d.ts +0 -10
- package/dist/camera/orientation_degrees.d.ts.map +0 -1
- package/dist/camera/orientation_degrees.js +0 -20
- package/dist/camera/orientation_degrees.js.map +0 -1
- package/dist/camera/use_smile_id_camera_preview.d.ts +0 -64
- package/dist/camera/use_smile_id_camera_preview.d.ts.map +0 -1
- package/dist/camera/use_smile_id_camera_preview.js +0 -141
- package/dist/camera/use_smile_id_camera_preview.js.map +0 -1
- package/dist/camera/use_smile_id_camera_system.d.ts +0 -97
- package/dist/camera/use_smile_id_camera_system.d.ts.map +0 -1
- package/dist/camera/use_smile_id_camera_system.js +0 -185
- package/dist/camera/use_smile_id_camera_system.js.map +0 -1
- package/dist/camera/use_smile_id_frame_stream.d.ts.map +0 -1
- package/dist/camera/use_smile_id_frame_stream.js.map +0 -1
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.d.ts.map +0 -1
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.js.map +0 -1
- package/dist/core/exception/builder_validation_exception.d.ts.map +0 -1
- package/dist/core/exception/builder_validation_exception.js.map +0 -1
- package/dist/core/exception/capture_validation_exceptions.d.ts.map +0 -1
- package/dist/core/exception/capture_validation_exceptions.js.map +0 -1
- package/dist/core/exception/consent_validation_exceptions.d.ts.map +0 -1
- package/dist/core/exception/consent_validation_exceptions.js.map +0 -1
- package/dist/core/exception/duplicate_screen_type_exception.d.ts.map +0 -1
- package/dist/core/exception/duplicate_screen_type_exception.js.map +0 -1
- package/dist/core/exception/empty_screens_block_exception.d.ts.map +0 -1
- package/dist/core/exception/empty_screens_block_exception.js.map +0 -1
- package/dist/core/exception/flow_exceptions.d.ts.map +0 -1
- package/dist/core/exception/flow_exceptions.js.map +0 -1
- package/dist/core/exception/index.d.ts.map +0 -1
- package/dist/core/exception/index.js.map +0 -1
- package/dist/core/exception/invalid_consent_config_exception.d.ts.map +0 -1
- package/dist/core/exception/invalid_consent_config_exception.js.map +0 -1
- package/dist/core/exception/invalid_consent_information_exception.d.ts.map +0 -1
- package/dist/core/exception/invalid_consent_information_exception.js.map +0 -1
- package/dist/core/exception/invalid_document_capture_config_exception.d.ts.map +0 -1
- package/dist/core/exception/invalid_document_capture_config_exception.js.map +0 -1
- package/dist/core/exception/invalid_field_value_exception.d.ts.map +0 -1
- package/dist/core/exception/invalid_field_value_exception.js.map +0 -1
- package/dist/core/exception/invalid_job_type_screen_config_exception.d.ts.map +0 -1
- package/dist/core/exception/invalid_job_type_screen_config_exception.js.map +0 -1
- package/dist/core/exception/invalid_missing_capture_type_exception.d.ts.map +0 -1
- package/dist/core/exception/invalid_missing_capture_type_exception.js.map +0 -1
- package/dist/core/exception/invalid_screen_order_exception.d.ts.map +0 -1
- package/dist/core/exception/invalid_screen_order_exception.js.map +0 -1
- package/dist/core/exception/invalid_selfie_capture_config_exception.d.ts.map +0 -1
- package/dist/core/exception/invalid_selfie_capture_config_exception.js.map +0 -1
- package/dist/core/exception/issue_severity.d.ts.map +0 -1
- package/dist/core/exception/issue_severity.js.map +0 -1
- package/dist/core/exception/job_validation_exceptions.d.ts.map +0 -1
- package/dist/core/exception/job_validation_exceptions.js.map +0 -1
- package/dist/core/exception/liveness_frame_count_exception.d.ts.map +0 -1
- package/dist/core/exception/liveness_frame_count_exception.js.map +0 -1
- package/dist/core/exception/missing_capture_for_preview_exception.d.ts.map +0 -1
- package/dist/core/exception/missing_capture_for_preview_exception.js.map +0 -1
- package/dist/core/exception/missing_job_type_exception.d.ts.map +0 -1
- package/dist/core/exception/missing_job_type_exception.js.map +0 -1
- package/dist/core/exception/missing_ml_configuration_block_exception.d.ts.map +0 -1
- package/dist/core/exception/missing_ml_configuration_block_exception.js.map +0 -1
- package/dist/core/exception/missing_network_configuration_block_exception.d.ts.map +0 -1
- package/dist/core/exception/missing_network_configuration_block_exception.js.map +0 -1
- package/dist/core/exception/missing_partner_config_exception.d.ts.map +0 -1
- package/dist/core/exception/missing_partner_config_exception.js.map +0 -1
- package/dist/core/exception/missing_required_field_exception.d.ts.map +0 -1
- package/dist/core/exception/missing_required_field_exception.js.map +0 -1
- package/dist/core/exception/screen_config_validation_exceptions.d.ts.map +0 -1
- package/dist/core/exception/screen_config_validation_exceptions.js.map +0 -1
- package/dist/core/exception/use_smile_id_attestation_exception.d.ts.map +0 -1
- package/dist/core/exception/use_smile_id_attestation_exception.js.map +0 -1
- package/dist/core/exception/use_smile_id_builder_exception.d.ts.map +0 -1
- package/dist/core/exception/use_smile_id_builder_exception.js.map +0 -1
- package/dist/core/exception/use_smile_id_camera_exception.d.ts.map +0 -1
- package/dist/core/exception/use_smile_id_camera_exception.js.map +0 -1
- package/dist/core/exception/use_smile_id_error_code.d.ts.map +0 -1
- package/dist/core/exception/use_smile_id_error_code.js.map +0 -1
- package/dist/core/exception/use_smile_id_exception.d.ts.map +0 -1
- package/dist/core/exception/use_smile_id_exception.js.map +0 -1
- package/dist/core/exception/use_smile_id_general_exception.d.ts.map +0 -1
- package/dist/core/exception/use_smile_id_general_exception.js.map +0 -1
- package/dist/core/exception/use_smile_id_network_exception.d.ts.map +0 -1
- package/dist/core/exception/use_smile_id_network_exception.js.map +0 -1
- package/dist/core/exception/use_smile_id_validation_exception.d.ts.map +0 -1
- package/dist/core/exception/use_smile_id_validation_exception.js.map +0 -1
- package/dist/core/models/config.d.ts.map +0 -1
- package/dist/core/models/config.js.map +0 -1
- package/dist/core/models/document_capture_mode.d.ts.map +0 -1
- package/dist/core/models/document_capture_mode.js.map +0 -1
- package/dist/core/models/document_type.d.ts.map +0 -1
- package/dist/core/models/document_type.js.map +0 -1
- package/dist/core/models/flow_step.d.ts.map +0 -1
- package/dist/core/models/flow_step.js.map +0 -1
- package/dist/core/models/global_privacy_control.d.ts.map +0 -1
- package/dist/core/models/global_privacy_control.js.map +0 -1
- package/dist/core/models/head_turn_direction.d.ts.map +0 -1
- package/dist/core/models/head_turn_direction.js.map +0 -1
- package/dist/core/models/job_type.d.ts.map +0 -1
- package/dist/core/models/job_type.js.map +0 -1
- package/dist/core/models/ml_config.d.ts.map +0 -1
- package/dist/core/models/ml_config.js.map +0 -1
- package/dist/core/models/network_config.d.ts.map +0 -1
- package/dist/core/models/network_config.js.map +0 -1
- package/dist/core/models/params.d.ts.map +0 -1
- package/dist/core/models/params.js.map +0 -1
- package/dist/core/models/result.d.ts.map +0 -1
- package/dist/core/models/result.js.map +0 -1
- package/dist/data/api/auth/token_holder.d.ts.map +0 -1
- package/dist/data/api/auth/token_holder.js.map +0 -1
- package/dist/data/api/interceptors/gzip_interceptor.d.ts.map +0 -1
- package/dist/data/api/interceptors/gzip_interceptor.js.map +0 -1
- package/dist/data/api/interceptors/logging_interceptor.d.ts.map +0 -1
- package/dist/data/api/interceptors/logging_interceptor.js.map +0 -1
- package/dist/data/api/interceptors/sensitive_headers.d.ts.map +0 -1
- package/dist/data/api/interceptors/sensitive_headers.js.map +0 -1
- package/dist/data/api/interceptors/smile_auth_interceptor.d.ts.map +0 -1
- package/dist/data/api/interceptors/smile_auth_interceptor.js.map +0 -1
- package/dist/data/api/interceptors/smile_integrity_interceptor.d.ts.map +0 -1
- package/dist/data/api/interceptors/smile_integrity_interceptor.js.map +0 -1
- package/dist/data/api/interceptors/smile_request_mac_interceptor.d.ts.map +0 -1
- package/dist/data/api/interceptors/smile_request_mac_interceptor.js.map +0 -1
- package/dist/data/api/interceptors/token_refresh_interceptor.d.ts.map +0 -1
- package/dist/data/api/interceptors/token_refresh_interceptor.js.map +0 -1
- package/dist/data/api/smile_id_api.d.ts.map +0 -1
- package/dist/data/api/smile_id_api.js.map +0 -1
- package/dist/data/compression/compressible_asset.d.ts.map +0 -1
- package/dist/data/compression/compressible_asset.js.map +0 -1
- package/dist/data/compression/payload_compression_config.d.ts.map +0 -1
- package/dist/data/compression/payload_compression_config.js.map +0 -1
- package/dist/data/compression/payload_compression_runner.d.ts.map +0 -1
- package/dist/data/compression/payload_compression_runner.js.map +0 -1
- package/dist/data/compression/payload_compressor.d.ts.map +0 -1
- package/dist/data/compression/payload_compressor.js.map +0 -1
- package/dist/data/compression/uri_compressible_asset.d.ts.map +0 -1
- package/dist/data/compression/uri_compressible_asset.js.map +0 -1
- package/dist/data/dsl/builder/cache_config_builder.d.ts.map +0 -1
- package/dist/data/dsl/builder/cache_config_builder.js.map +0 -1
- package/dist/data/dsl/builder/config_builder.d.ts.map +0 -1
- package/dist/data/dsl/builder/config_builder.js.map +0 -1
- package/dist/data/dsl/builder/interceptor_config_builder.d.ts.map +0 -1
- package/dist/data/dsl/builder/interceptor_config_builder.js.map +0 -1
- package/dist/data/dsl/builder/retry_config_builder.d.ts.map +0 -1
- package/dist/data/dsl/builder/retry_config_builder.js.map +0 -1
- package/dist/data/dsl/builder/timeout_config_builder.d.ts.map +0 -1
- package/dist/data/dsl/builder/timeout_config_builder.js.map +0 -1
- package/dist/data/dsl/use_smile_id_network_builder.d.ts.map +0 -1
- package/dist/data/dsl/use_smile_id_network_builder.js.map +0 -1
- package/dist/data/factory/networking_factory.d.ts.map +0 -1
- package/dist/data/factory/networking_factory.js.map +0 -1
- package/dist/data/model/image_dimensions.d.ts.map +0 -1
- package/dist/data/model/image_dimensions.js.map +0 -1
- package/dist/data/model/job_request.d.ts.map +0 -1
- package/dist/data/model/job_request.js.map +0 -1
- package/dist/data/model/job_submission_response.d.ts.map +0 -1
- package/dist/data/model/job_submission_response.js.map +0 -1
- package/dist/data/model/sdk_config.d.ts.map +0 -1
- package/dist/data/model/sdk_config.js.map +0 -1
- package/dist/data/model/sdk_config_capture.d.ts.map +0 -1
- package/dist/data/model/sdk_config_capture.js.map +0 -1
- package/dist/data/model/sdk_config_source.d.ts.map +0 -1
- package/dist/data/model/sdk_config_source.js.map +0 -1
- package/dist/data/model/token_payload.d.ts.map +0 -1
- package/dist/data/model/token_payload.js.map +0 -1
- package/dist/data/model/user_details_payload.d.ts.map +0 -1
- package/dist/data/model/user_details_payload.js.map +0 -1
- package/dist/data/repository/use_smile_id_repository.d.ts.map +0 -1
- package/dist/data/repository/use_smile_id_repository.js.map +0 -1
- package/dist/data/repository/use_smile_id_repository_impl.d.ts.map +0 -1
- package/dist/data/repository/use_smile_id_repository_impl.js.map +0 -1
- package/dist/data/security/request_canonicalizer.d.ts.map +0 -1
- package/dist/data/security/request_canonicalizer.js.map +0 -1
- package/dist/data/security/request_timestamp.d.ts.map +0 -1
- package/dist/data/security/request_timestamp.js.map +0 -1
- package/dist/data/security/security_policy.d.ts.map +0 -1
- package/dist/data/security/security_policy.js.map +0 -1
- package/dist/data/security/signing_crypto.d.ts.map +0 -1
- package/dist/data/security/signing_crypto.js.map +0 -1
- package/dist/data/security/smile_id_crypto_error.d.ts.map +0 -1
- package/dist/data/security/smile_id_crypto_error.js.map +0 -1
- package/dist/data/security/smile_id_crypto_manager.d.ts.map +0 -1
- package/dist/data/security/smile_id_crypto_manager.js.map +0 -1
- package/dist/data/smile_id_urls.d.ts.map +0 -1
- package/dist/data/smile_id_urls.js.map +0 -1
- package/dist/data/util/retry_util.d.ts.map +0 -1
- package/dist/data/util/retry_util.js.map +0 -1
- package/dist/data/util/use_smile_id_token_decoder.d.ts.map +0 -1
- package/dist/data/util/use_smile_id_token_decoder.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/l10n/strings_en.d.ts.map +0 -1
- package/dist/l10n/strings_en.js.map +0 -1
- package/dist/l10n/use_smile_id_localizations.d.ts.map +0 -1
- package/dist/l10n/use_smile_id_localizations.js.map +0 -1
- package/dist/l10n/use_smile_id_localizations_provider.d.ts.map +0 -1
- package/dist/l10n/use_smile_id_localizations_provider.js.map +0 -1
- package/dist/metadata/builder_configuration.d.ts.map +0 -1
- package/dist/metadata/builder_configuration.js.map +0 -1
- package/dist/metadata/captured_image_properties.d.ts.map +0 -1
- package/dist/metadata/captured_image_properties.js.map +0 -1
- package/dist/metadata/device_orientation_collector.d.ts.map +0 -1
- package/dist/metadata/device_orientation_collector.js.map +0 -1
- package/dist/metadata/document_image_origin.d.ts.map +0 -1
- package/dist/metadata/document_image_origin.js.map +0 -1
- package/dist/metadata/geolocation.d.ts.map +0 -1
- package/dist/metadata/geolocation.js.map +0 -1
- package/dist/metadata/metadata_configuration_mappers.d.ts.map +0 -1
- package/dist/metadata/metadata_configuration_mappers.js.map +0 -1
- package/dist/metadata/model_configuration.d.ts.map +0 -1
- package/dist/metadata/model_configuration.js.map +0 -1
- package/dist/metadata/optional_native_modules.d.ts.map +0 -1
- package/dist/metadata/optional_native_modules.js.map +0 -1
- package/dist/metadata/use_smile_id_metadata.d.ts.map +0 -1
- package/dist/metadata/use_smile_id_metadata.js.map +0 -1
- package/dist/metadata/use_smile_id_metadata_factory.d.ts.map +0 -1
- package/dist/metadata/use_smile_id_metadata_factory.js.map +0 -1
- package/dist/presentation/assets/svg/document_shimmer_strings.d.ts.map +0 -1
- package/dist/presentation/assets/svg/document_shimmer_strings.js.map +0 -1
- package/dist/presentation/assets/svg/instruction_svg_strings.d.ts.map +0 -1
- package/dist/presentation/assets/svg/instruction_svg_strings.js.map +0 -1
- package/dist/presentation/assets/svg/svg_strings.d.ts.map +0 -1
- package/dist/presentation/assets/svg/svg_strings.js.map +0 -1
- package/dist/presentation/components/face_oval_defaults.d.ts.map +0 -1
- package/dist/presentation/components/face_oval_defaults.js.map +0 -1
- package/dist/presentation/components/helpers/animated_lottie_view.d.ts.map +0 -1
- package/dist/presentation/components/helpers/animated_lottie_view.js.map +0 -1
- package/dist/presentation/components/helpers/capture_instruction_animation_spec.d.ts.map +0 -1
- package/dist/presentation/components/helpers/capture_instruction_animation_spec.js.map +0 -1
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.d.ts.map +0 -1
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.js.map +0 -1
- package/dist/presentation/components/helpers/scaled_oval_geometry.d.ts.map +0 -1
- package/dist/presentation/components/helpers/scaled_oval_geometry.js.map +0 -1
- package/dist/presentation/components/icons/index.d.ts.map +0 -1
- package/dist/presentation/components/icons/index.js.map +0 -1
- package/dist/presentation/components/status_indicator_state.d.ts.map +0 -1
- package/dist/presentation/components/status_indicator_state.js.map +0 -1
- package/dist/presentation/components/use_smile_id_attribution.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_attribution.js.map +0 -1
- package/dist/presentation/components/use_smile_id_back_button.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_back_button.js.map +0 -1
- package/dist/presentation/components/use_smile_id_button.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_button.js.map +0 -1
- package/dist/presentation/components/use_smile_id_capture_content.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_capture_content.js.map +0 -1
- package/dist/presentation/components/use_smile_id_capture_instruction_animation.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_capture_instruction_animation.js.map +0 -1
- package/dist/presentation/components/use_smile_id_capture_spinner.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_capture_spinner.js.map +0 -1
- package/dist/presentation/components/use_smile_id_captured_document_image.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_captured_document_image.js.map +0 -1
- package/dist/presentation/components/use_smile_id_captured_image_oval.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_captured_image_oval.js.map +0 -1
- package/dist/presentation/components/use_smile_id_card_surface.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_card_surface.js.map +0 -1
- package/dist/presentation/components/use_smile_id_confirmation_buttons.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_confirmation_buttons.js.map +0 -1
- package/dist/presentation/components/use_smile_id_consent_row.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_consent_row.js.map +0 -1
- package/dist/presentation/components/use_smile_id_content_card.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_content_card.js.map +0 -1
- package/dist/presentation/components/use_smile_id_document_capture_controls.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_document_capture_controls.js.map +0 -1
- package/dist/presentation/components/use_smile_id_document_overlay.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_document_overlay.js.map +0 -1
- package/dist/presentation/components/use_smile_id_document_shimmer.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_document_shimmer.js.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.js.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.js.map +0 -1
- package/dist/presentation/components/use_smile_id_expandable_icon.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_expandable_icon.js.map +0 -1
- package/dist/presentation/components/use_smile_id_face_oval_image.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_face_oval_image.js.map +0 -1
- package/dist/presentation/components/use_smile_id_face_overlay.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_face_overlay.js.map +0 -1
- package/dist/presentation/components/use_smile_id_failed_content.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_failed_content.js.map +0 -1
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.js.map +0 -1
- package/dist/presentation/components/use_smile_id_instructions_hero.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_instructions_hero.js.map +0 -1
- package/dist/presentation/components/use_smile_id_learn_more_content.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_learn_more_content.js.map +0 -1
- package/dist/presentation/components/use_smile_id_loading_content.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_loading_content.js.map +0 -1
- package/dist/presentation/components/use_smile_id_loading_indicator.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_loading_indicator.js.map +0 -1
- package/dist/presentation/components/use_smile_id_oval_border_palette.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_oval_border_palette.js.map +0 -1
- package/dist/presentation/components/use_smile_id_partner_icon.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_partner_icon.js.map +0 -1
- package/dist/presentation/components/use_smile_id_processing_center_indicator.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_processing_center_indicator.js.map +0 -1
- package/dist/presentation/components/use_smile_id_rounded_checkbox.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_rounded_checkbox.js.map +0 -1
- package/dist/presentation/components/use_smile_id_status_indicator.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_status_indicator.js.map +0 -1
- package/dist/presentation/components/use_smile_id_success_content.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_success_content.js.map +0 -1
- package/dist/presentation/flow/analytics/use_smile_id_analytics_event.d.ts.map +0 -1
- package/dist/presentation/flow/analytics/use_smile_id_analytics_event.js.map +0 -1
- package/dist/presentation/flow/config/flow_configuration.d.ts.map +0 -1
- package/dist/presentation/flow/config/flow_configuration.js.map +0 -1
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts.map +0 -1
- package/dist/presentation/flow/dsl/builder/config_builder.js.map +0 -1
- package/dist/presentation/flow/dsl/builder/ml_builder.d.ts.map +0 -1
- package/dist/presentation/flow/dsl/builder/ml_builder.js.map +0 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts.map +0 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.js.map +0 -1
- package/dist/presentation/flow/dsl/builder/theme_builder.d.ts.map +0 -1
- package/dist/presentation/flow/dsl/builder/theme_builder.js.map +0 -1
- package/dist/presentation/flow/dsl/flow_build_result.d.ts.map +0 -1
- package/dist/presentation/flow/dsl/flow_build_result.js.map +0 -1
- package/dist/presentation/flow/dsl/use_smile_id_builder.d.ts.map +0 -1
- package/dist/presentation/flow/dsl/use_smile_id_builder.js.map +0 -1
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.d.ts.map +0 -1
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js.map +0 -1
- package/dist/presentation/flow/flow_navigation_context.d.ts.map +0 -1
- package/dist/presentation/flow/flow_navigation_context.js.map +0 -1
- package/dist/presentation/flow/flow_navigation_manager.d.ts.map +0 -1
- package/dist/presentation/flow/flow_navigation_manager.js.map +0 -1
- package/dist/presentation/flow/graph/screen_renderer.d.ts.map +0 -1
- package/dist/presentation/flow/graph/screen_renderer.js.map +0 -1
- package/dist/presentation/flow/job_submission_state.d.ts.map +0 -1
- package/dist/presentation/flow/job_submission_state.js.map +0 -1
- package/dist/presentation/flow/model/instruction_guideline.d.ts.map +0 -1
- package/dist/presentation/flow/model/instruction_guideline.js.map +0 -1
- package/dist/presentation/flow/model/instructions_defaults.d.ts.map +0 -1
- package/dist/presentation/flow/model/instructions_defaults.js.map +0 -1
- package/dist/presentation/flow/screen/helpers/face_session_config.d.ts.map +0 -1
- package/dist/presentation/flow/screen/helpers/face_session_config.js.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_capture_screen.d.ts.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_capture_screen.js.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_consent_screen.d.ts.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_consent_screen.js.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.d.ts.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.js.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_preview_screen.d.ts.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_processing_screen.d.ts.map +0 -1
- package/dist/presentation/flow/screen/orchestrated_processing_screen.js.map +0 -1
- package/dist/presentation/flow/screen/use_smile_id_orchestrated_screen_host.d.ts.map +0 -1
- package/dist/presentation/flow/screen/use_smile_id_orchestrated_screen_host.js.map +0 -1
- package/dist/presentation/flow/screen/validation_error_screen.d.ts.map +0 -1
- package/dist/presentation/flow/screen/validation_error_screen.js.map +0 -1
- package/dist/presentation/flow/use_smile_id_flow.d.ts.map +0 -1
- package/dist/presentation/flow/use_smile_id_flow.js.map +0 -1
- package/dist/presentation/flow/validation/flow_validator.d.ts.map +0 -1
- package/dist/presentation/flow/validation/flow_validator.js.map +0 -1
- package/dist/presentation/flow/validation/job_type_validator.d.ts.map +0 -1
- package/dist/presentation/flow/validation/job_type_validator.js.map +0 -1
- package/dist/presentation/flow/validation/user_details_validator.d.ts.map +0 -1
- package/dist/presentation/flow/validation/user_details_validator.js.map +0 -1
- package/dist/presentation/flow/validation/validation_state.d.ts.map +0 -1
- package/dist/presentation/flow/validation/validation_state.js.map +0 -1
- package/dist/presentation/screen/helpers/capture_screen_helpers.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/capture_screen_helpers.js.map +0 -1
- package/dist/presentation/screen/helpers/capture_ui_state.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/capture_ui_state.js.map +0 -1
- package/dist/presentation/screen/helpers/consent_screen_helpers.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/consent_screen_helpers.js.map +0 -1
- package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/ess_turn_haptics.js.map +0 -1
- package/dist/presentation/screen/helpers/feedback_debouncer.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/feedback_debouncer.js.map +0 -1
- package/dist/presentation/screen/helpers/instructions_screen_helpers.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/instructions_screen_helpers.js.map +0 -1
- package/dist/presentation/screen/helpers/preview_screen_helpers.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/preview_screen_helpers.js.map +0 -1
- package/dist/presentation/screen/helpers/processing_screen_helpers.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/processing_screen_helpers.js.map +0 -1
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js.map +0 -1
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.js.map +0 -1
- package/dist/presentation/screen/helpers/use_debounced_feedback_key.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/use_debounced_feedback_key.js.map +0 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts.map +0 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.js.map +0 -1
- package/dist/presentation/screen/use_smile_id_consent_screen.d.ts.map +0 -1
- package/dist/presentation/screen/use_smile_id_consent_screen.js.map +0 -1
- package/dist/presentation/screen/use_smile_id_document_back_instructions.d.ts.map +0 -1
- package/dist/presentation/screen/use_smile_id_document_back_instructions.js.map +0 -1
- package/dist/presentation/screen/use_smile_id_document_preview_screen.d.ts.map +0 -1
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js.map +0 -1
- package/dist/presentation/screen/use_smile_id_instructions_screen.d.ts.map +0 -1
- package/dist/presentation/screen/use_smile_id_instructions_screen.js.map +0 -1
- package/dist/presentation/screen/use_smile_id_permission_screen.d.ts.map +0 -1
- package/dist/presentation/screen/use_smile_id_permission_screen.js.map +0 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts.map +0 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.js.map +0 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.d.ts.map +0 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.js.map +0 -1
- package/dist/presentation/state/processing_state.d.ts.map +0 -1
- package/dist/presentation/state/processing_state.js.map +0 -1
- package/dist/presentation/state/use_smile_id_overlay_state.d.ts.map +0 -1
- package/dist/presentation/state/use_smile_id_overlay_state.js.map +0 -1
- package/dist/presentation/theme/theme.d.ts.map +0 -1
- package/dist/presentation/theme/theme.js.map +0 -1
- package/dist/presentation/theme/theme_context.d.ts.map +0 -1
- package/dist/presentation/theme/theme_context.js.map +0 -1
- package/dist/presentation/theme/use_smile_id_motion.d.ts.map +0 -1
- package/dist/presentation/theme/use_smile_id_motion.js.map +0 -1
- package/dist/presentation/theme/use_use_smile_id_fonts.d.ts.map +0 -1
- package/dist/presentation/theme/use_use_smile_id_fonts.js.map +0 -1
- package/dist/presentation/utils/force_max_brightness.d.ts.map +0 -1
- package/dist/presentation/utils/force_max_brightness.js.map +0 -1
- package/dist/presentation/utils/locale_utils.d.ts.map +0 -1
- package/dist/presentation/utils/locale_utils.js.map +0 -1
- package/dist/presentation/utils/use_reduced_motion.d.ts.map +0 -1
- package/dist/presentation/utils/use_reduced_motion.js.map +0 -1
- package/dist/testing/fake_face_analyzer.d.ts.map +0 -1
- package/dist/testing/fake_face_analyzer.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
- package/dist/testing/scenario_expectations.d.ts.map +0 -1
- package/dist/testing/scenario_expectations.js.map +0 -1
- package/dist/testing/scenario_loader.d.ts.map +0 -1
- package/dist/testing/scenario_loader.js.map +0 -1
- package/dist/testing/scripted_scan_results.d.ts.map +0 -1
- package/dist/testing/scripted_scan_results.js.map +0 -1
- package/src/__tests__/dsl.test.ts +0 -1165
- package/src/__tests__/enum_parity.test.ts +0 -84
- package/src/__tests__/react_native_mock.tsx +0 -240
- package/src/__tests__/setup_react_native.ts +0 -368
- package/src/__tests__/snapshots/__snapshots__/screens_structural.test.tsx.snap +0 -5267
- package/src/__tests__/snapshots/screens_structural.test.tsx +0 -230
- package/src/__tests__/theme.test.ts +0 -156
- package/src/camera/__tests__/camera_defaults.test.ts +0 -28
- package/src/camera/__tests__/camera_lens.test.ts +0 -18
- package/src/camera/__tests__/camera_permissions.test.ts +0 -72
- package/src/camera/__tests__/camera_system_focus.test.ts +0 -173
- package/src/camera/__tests__/document_resize_target.test.ts +0 -44
- package/src/camera/__tests__/focus_state.test.ts +0 -48
- package/src/camera/__tests__/orientation_degrees.test.ts +0 -21
- package/src/camera/__tests__/use_smile_id_camera_preview.test.tsx +0 -461
- package/src/camera/__tests__/use_smile_id_camera_system.test.ts +0 -103
- package/src/camera/__tests__/use_smile_id_frame_stream.test.ts +0 -227
- package/src/camera/__tests__/use_smile_id_frame_stream_hook.test.tsx +0 -229
- package/src/camera/camera_configuration.ts +0 -32
- package/src/camera/camera_defaults.ts +0 -28
- package/src/camera/camera_lens.ts +0 -13
- package/src/camera/camera_permissions.ts +0 -36
- package/src/camera/camera_preview_image.ts +0 -19
- package/src/camera/document_image_pipeline.ts +0 -101
- package/src/camera/document_resize_target.ts +0 -22
- package/src/camera/focus_state.ts +0 -26
- package/src/camera/orientation_degrees.ts +0 -21
- package/src/camera/use_smile_id_camera_preview.tsx +0 -256
- package/src/camera/use_smile_id_camera_system.ts +0 -236
- package/src/camera/use_smile_id_frame_stream.ts +0 -189
- package/src/core/exception/__tests__/builder_validation_exceptions.test.ts +0 -81
- package/src/core/exception/__tests__/network_exception_mapper.test.ts +0 -179
- package/src/core/exception/agent_mode_with_enhanced_liveness_exception.ts +0 -20
- package/src/core/exception/builder_validation_exception.ts +0 -40
- package/src/core/exception/capture_validation_exceptions.ts +0 -9
- package/src/core/exception/consent_validation_exceptions.ts +0 -7
- package/src/core/exception/duplicate_screen_type_exception.ts +0 -22
- package/src/core/exception/empty_screens_block_exception.ts +0 -19
- package/src/core/exception/flow_exceptions.test.ts +0 -49
- package/src/core/exception/flow_exceptions.ts +0 -43
- package/src/core/exception/index.ts +0 -74
- package/src/core/exception/invalid_consent_config_exception.ts +0 -20
- package/src/core/exception/invalid_consent_information_exception.ts +0 -21
- package/src/core/exception/invalid_document_capture_config_exception.ts +0 -22
- package/src/core/exception/invalid_field_value_exception.ts +0 -21
- package/src/core/exception/invalid_job_type_screen_config_exception.ts +0 -70
- package/src/core/exception/invalid_missing_capture_type_exception.ts +0 -19
- package/src/core/exception/invalid_screen_order_exception.ts +0 -28
- package/src/core/exception/invalid_selfie_capture_config_exception.ts +0 -22
- package/src/core/exception/issue_severity.ts +0 -14
- package/src/core/exception/job_validation_exceptions.ts +0 -11
- package/src/core/exception/liveness_frame_count_exception.ts +0 -21
- package/src/core/exception/missing_capture_for_preview_exception.ts +0 -24
- package/src/core/exception/missing_job_type_exception.ts +0 -18
- package/src/core/exception/missing_ml_configuration_block_exception.ts +0 -21
- package/src/core/exception/missing_network_configuration_block_exception.ts +0 -22
- package/src/core/exception/missing_partner_config_exception.ts +0 -38
- package/src/core/exception/missing_required_field_exception.ts +0 -19
- package/src/core/exception/screen_config_validation_exceptions.ts +0 -10
- package/src/core/exception/use_smile_id_attestation_exception.ts +0 -11
- package/src/core/exception/use_smile_id_builder_exception.ts +0 -18
- package/src/core/exception/use_smile_id_camera_exception.ts +0 -12
- package/src/core/exception/use_smile_id_error_code.ts +0 -84
- package/src/core/exception/use_smile_id_exception.ts +0 -52
- package/src/core/exception/use_smile_id_general_exception.ts +0 -12
- package/src/core/exception/use_smile_id_network_exception.ts +0 -279
- package/src/core/exception/use_smile_id_validation_exception.ts +0 -12
- package/src/core/models/__tests__/document_capture_mode.test.ts +0 -43
- package/src/core/models/__tests__/document_type.test.ts +0 -66
- package/src/core/models/__tests__/flow_models.test.ts +0 -26
- package/src/core/models/__tests__/job_type.test.ts +0 -48
- package/src/core/models/config.ts +0 -58
- package/src/core/models/document_capture_mode.ts +0 -73
- package/src/core/models/document_type.ts +0 -79
- package/src/core/models/flow_step.ts +0 -17
- package/src/core/models/global_privacy_control.ts +0 -45
- package/src/core/models/head_turn_direction.ts +0 -15
- package/src/core/models/job_type.ts +0 -53
- package/src/core/models/ml_config.ts +0 -47
- package/src/core/models/network_config.ts +0 -138
- package/src/core/models/params.ts +0 -98
- package/src/core/models/result.test.ts +0 -20
- package/src/core/models/result.ts +0 -33
- package/src/data/api/__tests__/smile_id_api.test.ts +0 -1471
- package/src/data/api/auth/token_holder.ts +0 -72
- package/src/data/api/interceptors/__tests__/credential_header_redaction.test.ts +0 -144
- package/src/data/api/interceptors/__tests__/gzip_interceptor.test.ts +0 -83
- package/src/data/api/interceptors/__tests__/logging_interceptor.test.ts +0 -252
- package/src/data/api/interceptors/__tests__/sensitive_headers.test.ts +0 -29
- package/src/data/api/interceptors/__tests__/smile_integrity_interceptor.test.ts +0 -192
- package/src/data/api/interceptors/__tests__/smile_request_mac_interceptor.test.ts +0 -156
- package/src/data/api/interceptors/__tests__/token_refresh_interceptor.test.ts +0 -173
- package/src/data/api/interceptors/gzip_interceptor.ts +0 -31
- package/src/data/api/interceptors/logging_interceptor.ts +0 -155
- package/src/data/api/interceptors/sensitive_headers.ts +0 -46
- package/src/data/api/interceptors/smile_auth_interceptor.ts +0 -73
- package/src/data/api/interceptors/smile_integrity_interceptor.ts +0 -99
- package/src/data/api/interceptors/smile_request_mac_interceptor.ts +0 -106
- package/src/data/api/interceptors/token_refresh_interceptor.ts +0 -122
- package/src/data/api/smile_id_api.ts +0 -475
- package/src/data/compression/__tests__/payload_compressor.test.ts +0 -200
- package/src/data/compression/__tests__/payload_compressor_real_jpeg.test.ts +0 -226
- package/src/data/compression/compressible_asset.ts +0 -62
- package/src/data/compression/payload_compression_config.ts +0 -53
- package/src/data/compression/payload_compression_runner.ts +0 -102
- package/src/data/compression/payload_compressor.ts +0 -164
- package/src/data/compression/uri_compressible_asset.ts +0 -85
- package/src/data/dsl/__tests__/use_smile_id_network_builder.test.ts +0 -157
- package/src/data/dsl/builder/__tests__/config_builders.test.ts +0 -62
- package/src/data/dsl/builder/__tests__/interceptor_config_builder.test.ts +0 -173
- package/src/data/dsl/builder/cache_config_builder.ts +0 -28
- package/src/data/dsl/builder/config_builder.ts +0 -156
- package/src/data/dsl/builder/interceptor_config_builder.ts +0 -83
- package/src/data/dsl/builder/retry_config_builder.ts +0 -57
- package/src/data/dsl/builder/timeout_config_builder.ts +0 -31
- package/src/data/dsl/use_smile_id_network_builder.ts +0 -86
- package/src/data/factory/__tests__/networking_factory_order.test.ts +0 -201
- package/src/data/factory/__tests__/retry_gzip_mac_composition.test.ts +0 -163
- package/src/data/factory/__tests__/signed_job_submission_headers.test.ts +0 -110
- package/src/data/factory/networking_factory.ts +0 -201
- package/src/data/model/__tests__/sdk_config.test.ts +0 -85
- package/src/data/model/__tests__/sdk_config_capture.test.ts +0 -140
- package/src/data/model/__tests__/token_payload.test.ts +0 -224
- package/src/data/model/__tests__/user_details_payload.test.ts +0 -100
- package/src/data/model/image_dimensions.ts +0 -15
- package/src/data/model/job_request.ts +0 -165
- package/src/data/model/job_submission_response.ts +0 -17
- package/src/data/model/sdk_config.ts +0 -74
- package/src/data/model/sdk_config_capture.ts +0 -78
- package/src/data/model/sdk_config_source.ts +0 -26
- package/src/data/model/token_payload.ts +0 -182
- package/src/data/model/user_details_payload.ts +0 -84
- package/src/data/repository/__tests__/network_retries.test.ts +0 -117
- package/src/data/repository/__tests__/repository_dispatch.test.ts +0 -366
- package/src/data/repository/__tests__/use_smile_id_repository.test.ts +0 -118
- package/src/data/repository/use_smile_id_repository.ts +0 -19
- package/src/data/repository/use_smile_id_repository_impl.ts +0 -181
- package/src/data/security/__tests__/request_canonicalizer.test.ts +0 -132
- package/src/data/security/__tests__/security_policy.test.ts +0 -96
- package/src/data/security/__tests__/signing_crypto.test.ts +0 -203
- package/src/data/security/__tests__/smile_id_crypto_manager.test.ts +0 -176
- package/src/data/security/request_canonicalizer.ts +0 -161
- package/src/data/security/request_timestamp.ts +0 -12
- package/src/data/security/security_policy.ts +0 -70
- package/src/data/security/signing_crypto.ts +0 -219
- package/src/data/security/smile_id_crypto_error.ts +0 -13
- package/src/data/security/smile_id_crypto_manager.ts +0 -46
- package/src/data/smile_id_urls.ts +0 -13
- package/src/data/util/__tests__/retry_util.test.ts +0 -182
- package/src/data/util/__tests__/use_smile_id_token_decoder.test.ts +0 -430
- package/src/data/util/retry_util.ts +0 -81
- package/src/data/util/use_smile_id_token_decoder.ts +0 -207
- package/src/index.ts +0 -514
- package/src/l10n/__tests__/use_smile_id_localizations.test.ts +0 -244
- package/src/l10n/__tests__/use_smile_id_localizations_provider.test.tsx +0 -112
- package/src/l10n/__tests__/use_smile_id_localizations_surface.test.ts +0 -231
- package/src/l10n/strings_en.ts +0 -176
- package/src/l10n/use_smile_id_localizations.ts +0 -768
- package/src/l10n/use_smile_id_localizations_provider.tsx +0 -71
- package/src/metadata/__tests__/device_orientation_collector.test.ts +0 -15
- package/src/metadata/__tests__/device_orientation_sampling.test.ts +0 -165
- package/src/metadata/__tests__/geolocation.test.ts +0 -150
- package/src/metadata/__tests__/metadata_configuration_mappers.test.ts +0 -254
- package/src/metadata/__tests__/metadata_configuration_objects.test.ts +0 -86
- package/src/metadata/__tests__/metadata_device_context.test.ts +0 -147
- package/src/metadata/__tests__/metadata_device_os_android.test.ts +0 -18
- package/src/metadata/__tests__/metadata_golden_fixture.json +0 -13
- package/src/metadata/__tests__/metadata_payload_golden.test.ts +0 -193
- package/src/metadata/__tests__/optional_native_modules.test.ts +0 -234
- package/src/metadata/__tests__/use_smile_id_metadata.test.ts +0 -430
- package/src/metadata/__tests__/use_smile_id_metadata_factory.test.ts +0 -615
- package/src/metadata/builder_configuration.ts +0 -69
- package/src/metadata/captured_image_properties.ts +0 -10
- package/src/metadata/device_orientation_collector.ts +0 -75
- package/src/metadata/document_image_origin.ts +0 -22
- package/src/metadata/geolocation.ts +0 -46
- package/src/metadata/metadata_configuration_mappers.ts +0 -248
- package/src/metadata/model_configuration.ts +0 -68
- package/src/metadata/optional_native_modules.ts +0 -274
- package/src/metadata/use_smile_id_metadata.ts +0 -305
- package/src/metadata/use_smile_id_metadata_factory.ts +0 -580
- package/src/presentation/assets/si_document_green_book_hero_animation.json +0 -1
- package/src/presentation/assets/si_document_hero_animation.json +0 -1
- package/src/presentation/assets/si_document_hero_back_animation.json +0 -1
- package/src/presentation/assets/si_document_passport_hero_animation.json +0 -1
- package/src/presentation/assets/si_ess_all_directions_hero_animation.json +0 -1
- package/src/presentation/assets/si_ess_animation_all_directions.json +0 -1
- package/src/presentation/assets/si_selfie_hero_animation.json +0 -1
- package/src/presentation/assets/si_smile_to_capture_animation.json +0 -1
- package/src/presentation/assets/svg/document_shimmer_strings.ts +0 -17
- package/src/presentation/assets/svg/instruction_svg_strings.ts +0 -54
- package/src/presentation/assets/svg/svg_strings.ts +0 -158
- package/src/presentation/components/__tests__/capture_instruction_animation_spec.test.ts +0 -49
- package/src/presentation/components/__tests__/enhanced_smart_selfie_animation_frames.test.ts +0 -89
- package/src/presentation/components/__tests__/use_smile_id_capture_content.test.tsx +0 -348
- package/src/presentation/components/__tests__/use_smile_id_confirmation_buttons.test.tsx +0 -131
- package/src/presentation/components/__tests__/use_smile_id_content_card.test.tsx +0 -112
- package/src/presentation/components/__tests__/use_smile_id_enhanced_smart_selfie_clip.test.tsx +0 -256
- package/src/presentation/components/__tests__/use_smile_id_enhanced_smart_selfie_direction_animation.test.tsx +0 -138
- package/src/presentation/components/__tests__/use_smile_id_face_oval_image.test.tsx +0 -190
- package/src/presentation/components/__tests__/use_smile_id_face_overlay.test.tsx +0 -211
- package/src/presentation/components/__tests__/use_smile_id_guideline_thumbnail.test.tsx +0 -112
- package/src/presentation/components/__tests__/use_smile_id_instructions_hero.test.tsx +0 -150
- package/src/presentation/components/__tests__/use_smile_id_learn_more_content.test.tsx +0 -159
- package/src/presentation/components/__tests__/use_smile_id_loading_indicator.test.tsx +0 -45
- package/src/presentation/components/__tests__/use_smile_id_oval_border_palette.test.ts +0 -103
- package/src/presentation/components/__tests__/use_smile_id_processing_center_indicator.test.tsx +0 -88
- package/src/presentation/components/face_oval_defaults.ts +0 -51
- package/src/presentation/components/helpers/__tests__/scaled_oval_geometry.test.ts +0 -69
- package/src/presentation/components/helpers/animated_lottie_view.ts +0 -9
- package/src/presentation/components/helpers/capture_instruction_animation_spec.ts +0 -77
- package/src/presentation/components/helpers/enhanced_smart_selfie_animation_frames.ts +0 -64
- package/src/presentation/components/helpers/scaled_oval_geometry.ts +0 -44
- package/src/presentation/components/icons/index.tsx +0 -334
- package/src/presentation/components/status_indicator_state.ts +0 -21
- package/src/presentation/components/use_smile_id_attribution.tsx +0 -48
- package/src/presentation/components/use_smile_id_back_button.tsx +0 -59
- package/src/presentation/components/use_smile_id_button.tsx +0 -98
- package/src/presentation/components/use_smile_id_capture_content.tsx +0 -368
- package/src/presentation/components/use_smile_id_capture_instruction_animation.tsx +0 -84
- package/src/presentation/components/use_smile_id_capture_spinner.tsx +0 -63
- package/src/presentation/components/use_smile_id_captured_document_image.tsx +0 -81
- package/src/presentation/components/use_smile_id_captured_image_oval.tsx +0 -151
- package/src/presentation/components/use_smile_id_card_surface.tsx +0 -54
- package/src/presentation/components/use_smile_id_confirmation_buttons.tsx +0 -123
- package/src/presentation/components/use_smile_id_consent_row.tsx +0 -58
- package/src/presentation/components/use_smile_id_content_card.tsx +0 -65
- package/src/presentation/components/use_smile_id_document_capture_controls.tsx +0 -219
- package/src/presentation/components/use_smile_id_document_overlay.tsx +0 -335
- package/src/presentation/components/use_smile_id_document_shimmer.tsx +0 -51
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_clip.tsx +0 -155
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.tsx +0 -46
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.tsx +0 -29
- package/src/presentation/components/use_smile_id_expandable_icon.tsx +0 -102
- package/src/presentation/components/use_smile_id_face_oval_image.tsx +0 -90
- package/src/presentation/components/use_smile_id_face_overlay.tsx +0 -387
- package/src/presentation/components/use_smile_id_failed_content.tsx +0 -94
- package/src/presentation/components/use_smile_id_guideline_thumbnail.tsx +0 -263
- package/src/presentation/components/use_smile_id_instructions_hero.tsx +0 -296
- package/src/presentation/components/use_smile_id_learn_more_content.tsx +0 -115
- package/src/presentation/components/use_smile_id_loading_content.tsx +0 -54
- package/src/presentation/components/use_smile_id_loading_indicator.tsx +0 -81
- package/src/presentation/components/use_smile_id_oval_border_palette.ts +0 -64
- package/src/presentation/components/use_smile_id_partner_icon.tsx +0 -56
- package/src/presentation/components/use_smile_id_processing_center_indicator.tsx +0 -77
- package/src/presentation/components/use_smile_id_rounded_checkbox.tsx +0 -67
- package/src/presentation/components/use_smile_id_status_indicator.tsx +0 -44
- package/src/presentation/components/use_smile_id_success_content.tsx +0 -76
- package/src/presentation/flow/__tests__/document_flow_navigation.test.ts +0 -484
- package/src/presentation/flow/__tests__/flow_navigation_manager.test.ts +0 -1534
- package/src/presentation/flow/__tests__/use_smile_id_flow.test.tsx +0 -651
- package/src/presentation/flow/analytics/__tests__/use_smile_id_analytics_event.test.ts +0 -105
- package/src/presentation/flow/analytics/use_smile_id_analytics_event.ts +0 -83
- package/src/presentation/flow/config/flow_configuration.ts +0 -12
- package/src/presentation/flow/dsl/__tests__/use_smile_id_builder_component.test.tsx +0 -120
- package/src/presentation/flow/dsl/builder/__tests__/config_builder.test.ts +0 -25
- package/src/presentation/flow/dsl/builder/__tests__/ml_builder.test.ts +0 -161
- package/src/presentation/flow/dsl/builder/__tests__/theme_builder.test.ts +0 -102
- package/src/presentation/flow/dsl/builder/config_builder.ts +0 -57
- package/src/presentation/flow/dsl/builder/ml_builder.ts +0 -210
- package/src/presentation/flow/dsl/builder/screens_builder.ts +0 -276
- package/src/presentation/flow/dsl/builder/theme_builder.ts +0 -119
- package/src/presentation/flow/dsl/flow_build_result.ts +0 -37
- package/src/presentation/flow/dsl/use_smile_id_builder.tsx +0 -125
- package/src/presentation/flow/dsl/use_smile_id_flow_builder.ts +0 -454
- package/src/presentation/flow/flow_navigation_context.tsx +0 -50
- package/src/presentation/flow/flow_navigation_manager.ts +0 -1166
- package/src/presentation/flow/graph/__tests__/screen_renderer.test.tsx +0 -102
- package/src/presentation/flow/graph/screen_renderer.tsx +0 -35
- package/src/presentation/flow/job_submission_state.ts +0 -17
- package/src/presentation/flow/model/instruction_guideline.ts +0 -21
- package/src/presentation/flow/model/instructions_defaults.ts +0 -198
- package/src/presentation/flow/screen/__tests__/orchestrated_capture_screen.test.tsx +0 -836
- package/src/presentation/flow/screen/__tests__/orchestrated_consent_screen.test.tsx +0 -165
- package/src/presentation/flow/screen/__tests__/orchestrated_instructions_screen.test.tsx +0 -163
- package/src/presentation/flow/screen/__tests__/orchestrated_preview_screen.test.tsx +0 -224
- package/src/presentation/flow/screen/__tests__/orchestrated_processing_screen.test.tsx +0 -338
- package/src/presentation/flow/screen/helpers/__tests__/face_session_config.test.ts +0 -115
- package/src/presentation/flow/screen/helpers/face_session_config.ts +0 -77
- package/src/presentation/flow/screen/orchestrated_capture_screen.tsx +0 -344
- package/src/presentation/flow/screen/orchestrated_consent_screen.tsx +0 -71
- package/src/presentation/flow/screen/orchestrated_instructions_screen.tsx +0 -103
- package/src/presentation/flow/screen/orchestrated_preview_screen.tsx +0 -62
- package/src/presentation/flow/screen/orchestrated_processing_screen.tsx +0 -148
- package/src/presentation/flow/screen/use_smile_id_orchestrated_screen_host.tsx +0 -39
- package/src/presentation/flow/screen/validation_error_screen.tsx +0 -147
- package/src/presentation/flow/use_smile_id_flow.tsx +0 -389
- package/src/presentation/flow/validation/__tests__/flow_validator.test.ts +0 -616
- package/src/presentation/flow/validation/__tests__/job_type_validator.test.ts +0 -968
- package/src/presentation/flow/validation/flow_validator.ts +0 -461
- package/src/presentation/flow/validation/job_type_validator.ts +0 -703
- package/src/presentation/flow/validation/user_details_validator.ts +0 -53
- package/src/presentation/flow/validation/validation_state.ts +0 -65
- package/src/presentation/screen/__tests__/capture_screen_helpers.test.ts +0 -112
- package/src/presentation/screen/__tests__/capture_ui_state.test.ts +0 -398
- package/src/presentation/screen/__tests__/consent_screen_helpers.test.ts +0 -63
- package/src/presentation/screen/__tests__/ess_turn_haptics.test.ts +0 -82
- package/src/presentation/screen/__tests__/feedback_copy_table.test.ts +0 -145
- package/src/presentation/screen/__tests__/feedback_debouncer.test.ts +0 -111
- package/src/presentation/screen/__tests__/instructions_screen_helpers.test.ts +0 -154
- package/src/presentation/screen/__tests__/preview_screen_helpers.test.ts +0 -53
- package/src/presentation/screen/__tests__/processing_screen_helpers.test.ts +0 -39
- package/src/presentation/screen/__tests__/scan_state_to_overlay_state.test.ts +0 -223
- package/src/presentation/screen/__tests__/use_smile_id_capture_screen.test.tsx +0 -1128
- package/src/presentation/screen/__tests__/use_smile_id_consent_screen.test.tsx +0 -288
- package/src/presentation/screen/__tests__/use_smile_id_document_back_instructions.test.tsx +0 -138
- package/src/presentation/screen/__tests__/use_smile_id_instructions_screen.test.tsx +0 -245
- package/src/presentation/screen/__tests__/use_smile_id_permission_screen.test.tsx +0 -68
- package/src/presentation/screen/__tests__/use_smile_id_preview_screen.test.tsx +0 -193
- package/src/presentation/screen/__tests__/use_smile_id_processing_screen.test.tsx +0 -333
- package/src/presentation/screen/helpers/__tests__/use_capture_orientation_lock.test.tsx +0 -212
- package/src/presentation/screen/helpers/capture_screen_helpers.ts +0 -153
- package/src/presentation/screen/helpers/capture_ui_state.ts +0 -298
- package/src/presentation/screen/helpers/consent_screen_helpers.ts +0 -106
- package/src/presentation/screen/helpers/ess_turn_haptics.ts +0 -67
- package/src/presentation/screen/helpers/feedback_debouncer.ts +0 -89
- package/src/presentation/screen/helpers/instructions_screen_helpers.ts +0 -113
- package/src/presentation/screen/helpers/preview_screen_helpers.ts +0 -41
- package/src/presentation/screen/helpers/processing_screen_helpers.ts +0 -27
- package/src/presentation/screen/helpers/scan_state_to_overlay_state.ts +0 -131
- package/src/presentation/screen/helpers/use_capture_orientation_lock.ts +0 -108
- package/src/presentation/screen/helpers/use_debounced_feedback_key.ts +0 -52
- package/src/presentation/screen/use_smile_id_capture_screen.tsx +0 -912
- package/src/presentation/screen/use_smile_id_consent_screen.tsx +0 -393
- package/src/presentation/screen/use_smile_id_document_back_instructions.tsx +0 -125
- package/src/presentation/screen/use_smile_id_document_preview_screen.tsx +0 -152
- package/src/presentation/screen/use_smile_id_instructions_screen.tsx +0 -198
- package/src/presentation/screen/use_smile_id_permission_screen.tsx +0 -52
- package/src/presentation/screen/use_smile_id_preview_screen.tsx +0 -127
- package/src/presentation/screen/use_smile_id_processing_screen.tsx +0 -223
- package/src/presentation/state/__tests__/use_smile_id_overlay_state.test.ts +0 -30
- package/src/presentation/state/processing_state.ts +0 -19
- package/src/presentation/state/use_smile_id_overlay_state.ts +0 -70
- package/src/presentation/theme/__tests__/use_use_smile_id_fonts.test.tsx +0 -166
- package/src/presentation/theme/theme.ts +0 -401
- package/src/presentation/theme/theme_context.tsx +0 -45
- package/src/presentation/theme/use_smile_id_motion.ts +0 -12
- package/src/presentation/theme/use_use_smile_id_fonts.ts +0 -71
- package/src/presentation/utils/__tests__/force_max_brightness.test.tsx +0 -237
- package/src/presentation/utils/__tests__/locale_utils.test.ts +0 -78
- package/src/presentation/utils/force_max_brightness.tsx +0 -113
- package/src/presentation/utils/locale_utils.ts +0 -80
- package/src/presentation/utils/use_reduced_motion.ts +0 -26
- package/src/testing/__tests__/fake_face_analyzer.test.ts +0 -42
- package/src/testing/__tests__/scenario_expectations.test.ts +0 -110
- package/src/testing/__tests__/scenario_loader.test.ts +0 -64
- package/src/testing/fake_face_analyzer.ts +0 -82
- package/src/testing/index.ts +0 -15
- package/src/testing/scenario_expectations.ts +0 -87
- package/src/testing/scenario_loader.ts +0 -83
- package/src/testing/scripted_scan_results.ts +0 -66
- /package/{src → dist}/presentation/assets/fonts/DMSans-Bold.ttf +0 -0
- /package/{src → dist}/presentation/assets/fonts/DMSans-ExtraBold.ttf +0 -0
- /package/{src → dist}/presentation/assets/fonts/DMSans-Medium.ttf +0 -0
- /package/{src → dist}/presentation/assets/fonts/DMSans-Regular.ttf +0 -0
- /package/{src → dist}/presentation/assets/fonts/DMSans-SemiBold.ttf +0 -0
- /package/{src → dist}/presentation/assets/fonts/OFL.txt +0 -0
- /package/{src → dist}/presentation/assets/si_dark_lighting_animation.json +0 -0
- /package/{src → dist}/presentation/assets/si_device_orientation_animation.json +0 -0
- /package/{src → dist}/presentation/assets/svg/si_attribution.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_attribution_dark.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_checkbox_check.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_consent_biometric.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_consent_biometric_dark.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_consent_contact.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_consent_contact_dark.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_consent_device.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_consent_device_dark.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_consent_personal.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_consent_personal_dark.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_expand_more.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_plus.svg +0 -0
- /package/{src → dist}/presentation/assets/svg/si_smile_consent_icon.svg +0 -0
|
@@ -1,935 +1 @@
|
|
|
1
|
-
import { JobType } from "../../core/models/job_type";
|
|
2
|
-
import { CaptureType } from "../../core/models/ml_config";
|
|
3
|
-
import { defaultFrameAspectRatio, } from "../../core/models/document_type";
|
|
4
|
-
import { MissingJobTypeException, MissingRequiredFieldException, } from "../../core/exception/job_validation_exceptions";
|
|
5
|
-
import { UseSmileIDAnalyticsEventTypes, UseSmileIDAnalyticsParamKeys, UseSmileIDAnalyticsScreenNames, } from "./analytics/use_smile_id_analytics_event";
|
|
6
|
-
import { UseSmileIDMetadataFactory, } from "../../metadata/use_smile_id_metadata_factory";
|
|
7
|
-
import { DOCUMENT_BACK_IMAGE_ORIGIN_KEY, DOCUMENT_FRONT_IMAGE_ORIGIN_KEY, } from "../../metadata/document_image_origin";
|
|
8
|
-
import { configurationMetadataEntries } from "../../metadata/metadata_configuration_mappers";
|
|
9
|
-
import { CAPTURE_IMAGE_COLOR_DEPTH, CAPTURE_IMAGE_PIXEL_CONFIG, } from "../../metadata/captured_image_properties";
|
|
10
|
-
import { numSamplesOverride } from "../../data/model/sdk_config";
|
|
11
|
-
import { decodeSmileIDToken, } from "../../data/util/use_smile_id_token_decoder";
|
|
12
|
-
import { isTokenConsentComplete, bindsRequiredUserDetails, } from "../../data/model/token_payload";
|
|
13
|
-
import { isUserDetailsPayloadEmpty, userDetailsPayloadFrom, } from "../../data/model/user_details_payload";
|
|
14
|
-
import { DocumentSide, EnhancedSmartSelfieConfig, } from "@smileid/usesmileid_bridge";
|
|
15
|
-
import { ScanPerformanceProfile } from "@smileid/usesmileid_bridge";
|
|
16
|
-
const DEFAULT_CONSENT = Object.freeze({
|
|
17
|
-
granted: false,
|
|
18
|
-
grantedAt: "",
|
|
19
|
-
noticeLanguage: "",
|
|
20
|
-
noticePrivacyPolicyUrl: "",
|
|
21
|
-
});
|
|
22
|
-
export class FlowNavigationManager {
|
|
23
|
-
/**
|
|
24
|
-
* Navigation stack and source of truth — top is the active screen.
|
|
25
|
-
* Active screen + first/last predicates derive from this path (no
|
|
26
|
-
* parallel index). Mutated only via the navigate* methods.
|
|
27
|
-
*/
|
|
28
|
-
_navigationPath = [];
|
|
29
|
-
_captured = { livenessPaths: [] };
|
|
30
|
-
/**
|
|
31
|
-
* Set once the partner skips the document back side via the flip
|
|
32
|
-
* interstitial. Routes `getNextScreen()` past the back capture's preview so
|
|
33
|
-
* submission proceeds with `backDocument` unset. Cleared when the front is
|
|
34
|
-
* retaken.
|
|
35
|
-
*/
|
|
36
|
-
_documentBackSkipped = false;
|
|
37
|
-
/**
|
|
38
|
-
* How each captured document side was produced (auto / manual / gallery).
|
|
39
|
-
* Emitted as `DocumentFront/BackImageOrigin` submission metadata; an entry is
|
|
40
|
-
* removed when its side is retaken.
|
|
41
|
-
*/
|
|
42
|
-
_documentImageOrigins = new Map();
|
|
43
|
-
// Capture telemetry recorded at capture completion (selfie + per document side).
|
|
44
|
-
_selfieCaptureTelemetry;
|
|
45
|
-
_documentCaptureTelemetry = new Map();
|
|
46
|
-
// Identifier of the camera used for the most recent capture.
|
|
47
|
-
_cameraName;
|
|
48
|
-
// Accelerometer telemetry from the most recent capture (device_positions / movement).
|
|
49
|
-
_devicePositions = [];
|
|
50
|
-
_deviceMovementDetected = null;
|
|
51
|
-
_jobSubmissionState = { kind: "notAttempted" };
|
|
52
|
-
_listeners = new Set();
|
|
53
|
-
_steps;
|
|
54
|
-
_configuration;
|
|
55
|
-
_repository;
|
|
56
|
-
_metadataProvider;
|
|
57
|
-
_onExit;
|
|
58
|
-
_disposed = false;
|
|
59
|
-
_submissionResponse;
|
|
60
|
-
/**
|
|
61
|
-
* Decoded `sdk_config` JWT claim, resolved once at construction.
|
|
62
|
-
* `undefined` for offline mode / no token / no valid claim — SDK
|
|
63
|
-
* defaults apply throughout the flow in those cases.
|
|
64
|
-
*/
|
|
65
|
-
resolvedSdkConfig;
|
|
66
|
-
/** Canonical `partner_id` decoded from the JWT (raw); resolved via the [partnerId] getter. */
|
|
67
|
-
_resolvedPartnerId;
|
|
68
|
-
/**
|
|
69
|
-
* Token-bound user-detail/consent bindings decoded from the JWT
|
|
70
|
-
* `payload` claim, resolved once at construction alongside
|
|
71
|
-
* `resolvedSdkConfig`. `undefined` for offline mode / no token /
|
|
72
|
-
* legacy token — assembly then requires and sends everything exactly
|
|
73
|
-
* as before token support existed.
|
|
74
|
-
*/
|
|
75
|
-
_resolvedTokenPayload;
|
|
76
|
-
/**
|
|
77
|
-
* Partner identifier the capture screen stamps into the Smile EXIF tag — the tag's HMAC/AES
|
|
78
|
-
* keys derive from it and the backend validates the tag against the request's partner_id.
|
|
79
|
-
*
|
|
80
|
-
* Sourced from the JWT `partner_id` claim (server-canonical form, e.g. `"002"`) so the stamped
|
|
81
|
-
* value matches what the backend keys on; falls back to the partner-supplied config value when
|
|
82
|
-
* the claim is absent/blank. Empty = skip tagging.
|
|
83
|
-
*/
|
|
84
|
-
get partnerId() {
|
|
85
|
-
const jwtPartnerId = this._resolvedPartnerId;
|
|
86
|
-
if (jwtPartnerId && jwtPartnerId.length > 0)
|
|
87
|
-
return jwtPartnerId;
|
|
88
|
-
return this._configuration.network?.config?.partnerConfig?.partnerId ?? "";
|
|
89
|
-
}
|
|
90
|
-
/** Stable per-flow session id, stamped into every analytics event's `session_id`. */
|
|
91
|
-
_sessionId;
|
|
92
|
-
/** Submission attempts so far — stamped into `job_submitted` as `attempt`. */
|
|
93
|
-
_submissionAttemptCount = 0;
|
|
94
|
-
constructor(options) {
|
|
95
|
-
this._configuration = options.configuration;
|
|
96
|
-
this._onExit = options.onExit;
|
|
97
|
-
this._repository = options.repository;
|
|
98
|
-
// Fall back to a fresh factory so capture-only harnesses still build
|
|
99
|
-
// well-formed requests; the factory reads expo-device lazily and
|
|
100
|
-
// degrades to empty values when the peer dep is absent.
|
|
101
|
-
this._metadataProvider =
|
|
102
|
-
options.metadataProvider ?? new UseSmileIDMetadataFactory();
|
|
103
|
-
this._sessionId = this._metadataProvider.sessionId;
|
|
104
|
-
const decodedToken = FlowNavigationManager._decodeToken(options.configuration);
|
|
105
|
-
this.resolvedSdkConfig = decodedToken?.sdkConfig;
|
|
106
|
-
this._resolvedPartnerId = decodedToken?.partnerId;
|
|
107
|
-
this._resolvedTokenPayload = decodedToken?.tokenPayload;
|
|
108
|
-
// Token consent always wins: a complete binding drops the consent
|
|
109
|
-
// screen from the flow — the server injects the token's record, so
|
|
110
|
-
// nothing is collected here.
|
|
111
|
-
const steps = options.configuration.screens.steps;
|
|
112
|
-
this._steps = isTokenConsentComplete(decodedToken?.tokenPayload?.consent)
|
|
113
|
-
? steps.filter((s) => s.kind !== "consent")
|
|
114
|
-
: steps;
|
|
115
|
-
// Seed the path with the first screen so currentScreen/renderer have a
|
|
116
|
-
// deterministic start. Empty path → host renders the "no screens"
|
|
117
|
-
// sentinel (validation rejects empty screens at build time anyway).
|
|
118
|
-
const firstScreen = this._steps[0];
|
|
119
|
-
if (firstScreen) {
|
|
120
|
-
this._navigationPath = [firstScreen];
|
|
121
|
-
}
|
|
122
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.flowStarted, {
|
|
123
|
-
[UseSmileIDAnalyticsParamKeys.jobType]: this._jobTypeName(),
|
|
124
|
-
});
|
|
125
|
-
if (firstScreen) {
|
|
126
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.screenViewed, {
|
|
127
|
-
[UseSmileIDAnalyticsParamKeys.screenName]: this._screenAnalyticsName(firstScreen),
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
get configuration() {
|
|
132
|
-
return this._configuration;
|
|
133
|
-
}
|
|
134
|
-
/** Whether any selfie step enabled Enhanced Smart Selfie (drives the instructions hero swap and oval-progress suppression). */
|
|
135
|
-
get enhancedLivenessEnabled() {
|
|
136
|
-
return this._steps.some((step) => step.kind === "capture" &&
|
|
137
|
-
step.config.selfieConfig?.enableEnhancedLiveness === true);
|
|
138
|
-
}
|
|
139
|
-
/** Document type from the flow's document capture step, if any (drives the instructions document variant). */
|
|
140
|
-
get documentType() {
|
|
141
|
-
for (const step of this._steps) {
|
|
142
|
-
if (step.kind === "capture" &&
|
|
143
|
-
step.config.captureType === CaptureType.document) {
|
|
144
|
-
return step.config.documentConfig?.documentType;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return undefined;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Resolved document capture-frame aspect ratio (width / height), shared by
|
|
151
|
-
* capture, preview, and processing. Precedence: type `knownAspectRatio` →
|
|
152
|
-
* partner `knownIdAspectRatio` → orientation default.
|
|
153
|
-
*/
|
|
154
|
-
get documentFrameAspectRatio() {
|
|
155
|
-
for (const step of this._steps) {
|
|
156
|
-
if (step.kind === "capture" &&
|
|
157
|
-
step.config.captureType === CaptureType.document) {
|
|
158
|
-
const documentConfig = step.config.documentConfig;
|
|
159
|
-
return (documentConfig?.resolvedAspectRatio ??
|
|
160
|
-
defaultFrameAspectRatio(documentConfig?.documentType?.orientation ?? "Landscape"));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return undefined;
|
|
164
|
-
}
|
|
165
|
-
// --- navigation path --------------------------------------------------
|
|
166
|
-
/** Read-only navigation stack; top is the active screen. */
|
|
167
|
-
get navigationPath() {
|
|
168
|
-
return this._navigationPath;
|
|
169
|
-
}
|
|
170
|
-
/** Active screen (top of the path); `undefined` only when no screens are configured. */
|
|
171
|
-
get currentScreen() {
|
|
172
|
-
return this._navigationPath[this._navigationPath.length - 1];
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Depth of the active screen — stable id for React view identity so
|
|
176
|
-
* stack frames at the same configured-screen position stay distinct.
|
|
177
|
-
*/
|
|
178
|
-
get currentDepth() {
|
|
179
|
-
return this._navigationPath.length - 1;
|
|
180
|
-
}
|
|
181
|
-
get isFirstScreen() {
|
|
182
|
-
return this._navigationPath.length <= 1;
|
|
183
|
-
}
|
|
184
|
-
get isLastScreen() {
|
|
185
|
-
return this.getNextScreen() === undefined;
|
|
186
|
-
}
|
|
187
|
-
/** Next screen `navigateToNext()` would land on; `undefined` at the terminal screen. */
|
|
188
|
-
getNextScreen() {
|
|
189
|
-
const current = this.currentScreen;
|
|
190
|
-
if (!current)
|
|
191
|
-
return undefined;
|
|
192
|
-
const currentIdx = this._steps.indexOf(current);
|
|
193
|
-
if (currentIdx < 0)
|
|
194
|
-
return undefined;
|
|
195
|
-
// Per-side document loop: after previewing the FRONT, route back to the
|
|
196
|
-
// document capture step to capture the BACK. Gated so it fires only on a
|
|
197
|
-
// document preview with the back still pending and not skipped — the back
|
|
198
|
-
// preview (back already captured) falls through to the linear next step.
|
|
199
|
-
if (current.kind === "preview" &&
|
|
200
|
-
this._precedingStepIsDocumentCapture(currentIdx) &&
|
|
201
|
-
this.documentCapturesBack() &&
|
|
202
|
-
this._captured.backDocumentPath === undefined &&
|
|
203
|
-
!this._documentBackSkipped) {
|
|
204
|
-
const documentCapture = this._steps[currentIdx - 1];
|
|
205
|
-
if (documentCapture !== undefined)
|
|
206
|
-
return documentCapture;
|
|
207
|
-
}
|
|
208
|
-
// Back skipped at the interstitial: skip the document preview that would
|
|
209
|
-
// otherwise follow the capture and advance past it (no back to preview).
|
|
210
|
-
if (current.kind === "capture" &&
|
|
211
|
-
current.config.captureType === CaptureType.document &&
|
|
212
|
-
this._documentBackSkipped) {
|
|
213
|
-
const next = this._steps[currentIdx + 1];
|
|
214
|
-
if (next?.kind === "preview")
|
|
215
|
-
return this._steps[currentIdx + 2];
|
|
216
|
-
}
|
|
217
|
-
// At the document capture step with the front captured, the back still
|
|
218
|
-
// pending, and no document preview to drive the per-side loop, re-enter the
|
|
219
|
-
// capture step for the back side so captureBothSides is honoured even when
|
|
220
|
-
// the flow omits the document preview { } step. When a preview does follow,
|
|
221
|
-
// the per-side loop above handles the back instead.
|
|
222
|
-
if (current.kind === "capture" &&
|
|
223
|
-
current.config.captureType === CaptureType.document &&
|
|
224
|
-
this.documentCapturesBack() &&
|
|
225
|
-
this._captured.frontDocumentPath !== undefined &&
|
|
226
|
-
this._captured.backDocumentPath === undefined &&
|
|
227
|
-
!this._documentBackSkipped &&
|
|
228
|
-
!this.documentPreviewFollowsCapture()) {
|
|
229
|
-
return current;
|
|
230
|
-
}
|
|
231
|
-
return this._steps[currentIdx + 1];
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Advance to the next screen. Past the last screen, exits via `onExit`
|
|
235
|
-
* `{ kind: 'completed', job }` (job is the successful response, or an
|
|
236
|
-
* empty-fields stand-in for flows with no processing screen).
|
|
237
|
-
*
|
|
238
|
-
* Advancing into a `processing` screen sets `loading` synchronously
|
|
239
|
-
* before the async submit, closing the race with the screen's
|
|
240
|
-
* mount-time `beginSubmissionIfNeeded()` so it never flashes
|
|
241
|
-
* `notAttempted`.
|
|
242
|
-
*/
|
|
243
|
-
navigateToNext() {
|
|
244
|
-
if (this._disposed)
|
|
245
|
-
return;
|
|
246
|
-
const nextScreen = this.getNextScreen();
|
|
247
|
-
if (!nextScreen) {
|
|
248
|
-
// Past the last screen: deliver the stored success response,
|
|
249
|
-
// surface a failure, else the empty-fields completed carrier
|
|
250
|
-
// (flows with no processing screen still get `completed`).
|
|
251
|
-
const state = this._jobSubmissionState;
|
|
252
|
-
if (this._submissionResponse) {
|
|
253
|
-
this._finishFlow({ kind: "completed", job: this._submissionResponse });
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
if (state.kind === "failure") {
|
|
257
|
-
this._finishFlow({ kind: "failed", error: state.error });
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
const job = state.kind === "success"
|
|
261
|
-
? state.response
|
|
262
|
-
: { userId: "", jobId: "", status: "", message: "" };
|
|
263
|
-
this._finishFlow({ kind: "completed", job });
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
this._navigationPath = [...this._navigationPath, nextScreen];
|
|
267
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.screenViewed, {
|
|
268
|
-
[UseSmileIDAnalyticsParamKeys.screenName]: this._screenAnalyticsName(nextScreen),
|
|
269
|
-
});
|
|
270
|
-
// Mark loading synchronously so the processing screen's mount-time
|
|
271
|
-
// beginSubmissionIfNeeded() sees the transition has started — guards
|
|
272
|
-
// the brief notAttempted flash before the async submit is scheduled.
|
|
273
|
-
if (nextScreen.kind === "processing" &&
|
|
274
|
-
this._jobSubmissionState.kind === "notAttempted" &&
|
|
275
|
-
this._repository !== undefined) {
|
|
276
|
-
this._jobSubmissionState = { kind: "loading" };
|
|
277
|
-
}
|
|
278
|
-
this._notify();
|
|
279
|
-
if (nextScreen.kind === "processing" &&
|
|
280
|
-
this._jobSubmissionState.kind === "loading" &&
|
|
281
|
-
this._repository !== undefined) {
|
|
282
|
-
// Macrotask defer so React paints the loading processing screen
|
|
283
|
-
// before _submit blocks the JS thread with request assembly +
|
|
284
|
-
// signing. The pre-set loading keeps beginSubmissionIfNeeded() a
|
|
285
|
-
// no-op, so it still submits exactly once.
|
|
286
|
-
setTimeout(() => {
|
|
287
|
-
if (this._disposed)
|
|
288
|
-
return;
|
|
289
|
-
void this._submit();
|
|
290
|
-
}, 0);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
/** Pop the active screen; from the first screen, exits via `onExit` `{ kind: 'cancelled' }`. */
|
|
294
|
-
navigateBack() {
|
|
295
|
-
if (this._disposed)
|
|
296
|
-
return;
|
|
297
|
-
if (this.isFirstScreen) {
|
|
298
|
-
this._onExit({ kind: "cancelled" });
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
// Going back from a non-first screen is a retake of the prior step.
|
|
302
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.retakeRequested);
|
|
303
|
-
this._navigationPath = this._navigationPath.slice(0, -1);
|
|
304
|
-
this._notify();
|
|
305
|
-
}
|
|
306
|
-
/** Reset the path to the first screen (flow restart after terminal failure, manager kept alive). */
|
|
307
|
-
navigateToStart() {
|
|
308
|
-
if (this._disposed)
|
|
309
|
-
return;
|
|
310
|
-
const firstScreen = this._steps[0];
|
|
311
|
-
this._navigationPath = firstScreen ? [firstScreen] : [];
|
|
312
|
-
this._notify();
|
|
313
|
-
}
|
|
314
|
-
/** Exit the flow with a partner-supplied reason (processing onExit, consent denied, etc.). */
|
|
315
|
-
exit(reason = { kind: "cancelled" }) {
|
|
316
|
-
if (this._disposed)
|
|
317
|
-
return;
|
|
318
|
-
this._finishFlow(reason);
|
|
319
|
-
}
|
|
320
|
-
// --- captured artifacts -----------------------------------------------
|
|
321
|
-
get captured() {
|
|
322
|
-
return this._captured;
|
|
323
|
-
}
|
|
324
|
-
setCapturedSelfie(selfiePath, livenessPaths) {
|
|
325
|
-
if (this._disposed)
|
|
326
|
-
return;
|
|
327
|
-
this._captured = {
|
|
328
|
-
...this._captured,
|
|
329
|
-
selfiePath,
|
|
330
|
-
livenessPaths: Object.freeze([...livenessPaths]),
|
|
331
|
-
};
|
|
332
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.selfieCaptured, {
|
|
333
|
-
[UseSmileIDAnalyticsParamKeys.livenessImageCount]: String(livenessPaths.length),
|
|
334
|
-
});
|
|
335
|
-
this._notify();
|
|
336
|
-
}
|
|
337
|
-
setCapturedFrontDocument(path) {
|
|
338
|
-
if (this._disposed)
|
|
339
|
-
return;
|
|
340
|
-
this._captured = { ...this._captured, frontDocumentPath: path };
|
|
341
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.documentCaptured, {
|
|
342
|
-
[UseSmileIDAnalyticsParamKeys.documentSide]: "front",
|
|
343
|
-
});
|
|
344
|
-
this._notify();
|
|
345
|
-
}
|
|
346
|
-
setCapturedBackDocument(path) {
|
|
347
|
-
if (this._disposed)
|
|
348
|
-
return;
|
|
349
|
-
this._captured = { ...this._captured, backDocumentPath: path };
|
|
350
|
-
// `both` is the single completion-event value for a two-sided capture.
|
|
351
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.documentCaptured, {
|
|
352
|
-
[UseSmileIDAnalyticsParamKeys.documentSide]: "both",
|
|
353
|
-
});
|
|
354
|
-
this._notify();
|
|
355
|
-
}
|
|
356
|
-
// --- document per-side preview loop -----------------------------------
|
|
357
|
-
/** Whether the configured document capture asks for a back side. */
|
|
358
|
-
documentCapturesBack() {
|
|
359
|
-
for (const step of this._steps) {
|
|
360
|
-
if (step.kind === "capture" &&
|
|
361
|
-
step.config.captureType === CaptureType.document) {
|
|
362
|
-
const documentConfig = step.config.documentConfig;
|
|
363
|
-
return (documentConfig?.documentType?.hasBackSide === true &&
|
|
364
|
-
(documentConfig?.captureBothSides ?? false));
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return false;
|
|
368
|
-
}
|
|
369
|
-
/** Whether a `preview {}` immediately follows the document capture step. */
|
|
370
|
-
documentPreviewFollowsCapture() {
|
|
371
|
-
const index = this._steps.findIndex((step) => step.kind === "capture" &&
|
|
372
|
-
step.config.captureType === CaptureType.document);
|
|
373
|
-
if (index < 0)
|
|
374
|
-
return false;
|
|
375
|
-
return this._steps[index + 1]?.kind === "preview";
|
|
376
|
-
}
|
|
377
|
-
/** Whether the active preview previews a document side (vs the selfie). */
|
|
378
|
-
currentPreviewIsDocument() {
|
|
379
|
-
const current = this.currentScreen;
|
|
380
|
-
if (!current || current.kind !== "preview")
|
|
381
|
-
return false;
|
|
382
|
-
return this._precedingStepIsDocumentCapture(this._steps.indexOf(current));
|
|
383
|
-
}
|
|
384
|
-
/** Path of the document side under review: the back if captured, else the front. */
|
|
385
|
-
currentDocumentPreviewPath() {
|
|
386
|
-
return this._captured.backDocumentPath ?? this._captured.frontDocumentPath;
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Discard the side under review for re-capture: the back if captured,
|
|
390
|
-
* else the front (which also un-skips the back). Does not navigate.
|
|
391
|
-
*/
|
|
392
|
-
retakeCurrentDocumentSide() {
|
|
393
|
-
if (this._disposed)
|
|
394
|
-
return;
|
|
395
|
-
const next = { ...this._captured };
|
|
396
|
-
if (next.backDocumentPath !== undefined) {
|
|
397
|
-
delete next.backDocumentPath;
|
|
398
|
-
this._documentImageOrigins.delete(DocumentSide.Back);
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
delete next.frontDocumentPath;
|
|
402
|
-
this._documentImageOrigins.delete(DocumentSide.Front);
|
|
403
|
-
this._documentBackSkipped = false;
|
|
404
|
-
}
|
|
405
|
-
this._captured = next;
|
|
406
|
-
this._notify();
|
|
407
|
-
}
|
|
408
|
-
/** Skip the document back side from the flip interstitial ("Skip"). */
|
|
409
|
-
skipDocumentBack() {
|
|
410
|
-
if (this._disposed)
|
|
411
|
-
return;
|
|
412
|
-
this._documentBackSkipped = true;
|
|
413
|
-
this._notify();
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* Record how a side was produced (→ `DocumentFront/BackImageOrigin`
|
|
417
|
-
* metadata). Metadata-only, so it intentionally does not `_notify()`.
|
|
418
|
-
*/
|
|
419
|
-
recordDocumentImageOrigin(side, origin) {
|
|
420
|
-
if (this._disposed)
|
|
421
|
-
return;
|
|
422
|
-
this._documentImageOrigins.set(side, origin);
|
|
423
|
-
}
|
|
424
|
-
/** Records selfie capture telemetry (duration + retries) at capture completion. */
|
|
425
|
-
recordSelfieCaptureTelemetry(telemetry) {
|
|
426
|
-
if (this._disposed)
|
|
427
|
-
return;
|
|
428
|
-
this._selfieCaptureTelemetry = telemetry;
|
|
429
|
-
this._captureCameraName(telemetry);
|
|
430
|
-
}
|
|
431
|
-
/** Records per-side document capture telemetry at each side's completion. */
|
|
432
|
-
recordDocumentCaptureTelemetry(side, telemetry) {
|
|
433
|
-
if (this._disposed)
|
|
434
|
-
return;
|
|
435
|
-
this._documentCaptureTelemetry.set(side, telemetry);
|
|
436
|
-
this._captureCameraName(telemetry);
|
|
437
|
-
}
|
|
438
|
-
_captureCameraName(telemetry) {
|
|
439
|
-
if (telemetry.cameraName)
|
|
440
|
-
this._cameraName = telemetry.cameraName;
|
|
441
|
-
if (telemetry.devicePositions.length > 0) {
|
|
442
|
-
this._devicePositions = telemetry.devicePositions;
|
|
443
|
-
this._deviceMovementDetected = telemetry.deviceMovementDetected;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
/** Per-side document origin wire entries (front then back; omitted when unset). */
|
|
447
|
-
_documentImageOriginEntries() {
|
|
448
|
-
const entries = [];
|
|
449
|
-
const front = this._documentImageOrigins.get(DocumentSide.Front);
|
|
450
|
-
if (front !== undefined) {
|
|
451
|
-
entries.push({ name: DOCUMENT_FRONT_IMAGE_ORIGIN_KEY, value: front });
|
|
452
|
-
}
|
|
453
|
-
const back = this._documentImageOrigins.get(DocumentSide.Back);
|
|
454
|
-
if (back !== undefined) {
|
|
455
|
-
entries.push({ name: DOCUMENT_BACK_IMAGE_ORIGIN_KEY, value: back });
|
|
456
|
-
}
|
|
457
|
-
return entries;
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* Capture telemetry + image-property wire entries. Durations and retries keep
|
|
461
|
-
* a meaningful 0 (capture ran) and are omitted only when that capture type
|
|
462
|
-
* never ran. Color depth / pixel config are emitted for each present capture;
|
|
463
|
-
* document sizes when measured.
|
|
464
|
-
*/
|
|
465
|
-
_captureTelemetryEntries() {
|
|
466
|
-
const entries = [];
|
|
467
|
-
const push = (name, value) => entries.push({ name, value });
|
|
468
|
-
const selfie = this._selfieCaptureTelemetry;
|
|
469
|
-
if (selfie) {
|
|
470
|
-
// Duration + retries keep a meaningful 0 (capture ran); telemetry is absent only when the
|
|
471
|
-
// capture type never ran.
|
|
472
|
-
push("selfie_capture_duration_ms", String(selfie.durationMs));
|
|
473
|
-
push("selfie_capture_retries", String(selfie.retries));
|
|
474
|
-
}
|
|
475
|
-
if (this._captured.selfiePath !== undefined) {
|
|
476
|
-
push("selfie_image_color_depth", String(CAPTURE_IMAGE_COLOR_DEPTH));
|
|
477
|
-
push("selfie_image_pixel_config", CAPTURE_IMAGE_PIXEL_CONFIG);
|
|
478
|
-
}
|
|
479
|
-
if (this._cameraName) {
|
|
480
|
-
push("camera_name", this._cameraName);
|
|
481
|
-
}
|
|
482
|
-
if (this._devicePositions.length > 0) {
|
|
483
|
-
push("device_positions", JSON.stringify(this._devicePositions));
|
|
484
|
-
if (this._deviceMovementDetected !== null) {
|
|
485
|
-
push("device_movement_detected", String(this._deviceMovementDetected));
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
const sideKey = (side) => side === DocumentSide.Back ? "back" : "front";
|
|
489
|
-
for (const side of [DocumentSide.Front, DocumentSide.Back]) {
|
|
490
|
-
const key = sideKey(side);
|
|
491
|
-
const telemetry = this._documentCaptureTelemetry.get(side);
|
|
492
|
-
if (telemetry) {
|
|
493
|
-
push(`document_${key}_capture_duration_ms`, String(telemetry.durationMs));
|
|
494
|
-
push(`document_${key}_capture_retries`, String(telemetry.retries));
|
|
495
|
-
push(`document_${key}_image_color_depth`, String(CAPTURE_IMAGE_COLOR_DEPTH));
|
|
496
|
-
push(`document_${key}_image_pixel_config`, CAPTURE_IMAGE_PIXEL_CONFIG);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
// Per-image original + final compressed sizes are stamped in the repository around the
|
|
500
|
-
// compression pass (it owns both the before and after byte counts), not here.
|
|
501
|
-
return entries;
|
|
502
|
-
}
|
|
503
|
-
_precedingStepIsDocumentCapture(index) {
|
|
504
|
-
const preceding = this._steps[index - 1];
|
|
505
|
-
return (preceding?.kind === "capture" &&
|
|
506
|
-
preceding.config.captureType === CaptureType.document);
|
|
507
|
-
}
|
|
508
|
-
setConsent(info) {
|
|
509
|
-
if (this._disposed)
|
|
510
|
-
return;
|
|
511
|
-
this._captured = { ...this._captured, consentInformation: info };
|
|
512
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.consentCaptured, {
|
|
513
|
-
[UseSmileIDAnalyticsParamKeys.decision]: "granted",
|
|
514
|
-
});
|
|
515
|
-
this._notify();
|
|
516
|
-
}
|
|
517
|
-
// --- job submission ---------------------------------------------------
|
|
518
|
-
get jobSubmissionState() {
|
|
519
|
-
return this._jobSubmissionState;
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* Idempotent submission entry point (called on processing-screen
|
|
523
|
-
* mount). The `notAttempted` guard prevents re-mounts re-firing.
|
|
524
|
-
*/
|
|
525
|
-
beginSubmissionIfNeeded() {
|
|
526
|
-
if (this._disposed)
|
|
527
|
-
return;
|
|
528
|
-
if (this._jobSubmissionState.kind !== "notAttempted")
|
|
529
|
-
return;
|
|
530
|
-
void this._submit();
|
|
531
|
-
}
|
|
532
|
-
/**
|
|
533
|
-
* Reset to `notAttempted` and re-fire submission (processing screen's
|
|
534
|
-
* onRetry). Ignored while a submission is in flight — resetting then would
|
|
535
|
-
* defeat `beginSubmissionIfNeeded()`'s single-flight guard.
|
|
536
|
-
*/
|
|
537
|
-
retrySubmission() {
|
|
538
|
-
if (this._disposed)
|
|
539
|
-
return;
|
|
540
|
-
if (this._jobSubmissionState.kind === "loading")
|
|
541
|
-
return;
|
|
542
|
-
this._setSubmissionState({ kind: "notAttempted" });
|
|
543
|
-
this.beginSubmissionIfNeeded();
|
|
544
|
-
}
|
|
545
|
-
_setSubmissionState(state) {
|
|
546
|
-
if (this._disposed)
|
|
547
|
-
return;
|
|
548
|
-
this._jobSubmissionState = state;
|
|
549
|
-
this._notify();
|
|
550
|
-
}
|
|
551
|
-
/**
|
|
552
|
-
* Build the request, dispatch via repository, update state. Errors
|
|
553
|
-
* from `_assembleJob` (missing captures / bad job type) map to the
|
|
554
|
-
* `failure` state rather than propagating as unhandled rejections.
|
|
555
|
-
*/
|
|
556
|
-
async _submit() {
|
|
557
|
-
if (!this._repository) {
|
|
558
|
-
this._setSubmissionState({
|
|
559
|
-
kind: "failure",
|
|
560
|
-
error: new Error("Job submission not configured — no network/repository was " +
|
|
561
|
-
"supplied to <UseSmileIDBuilder>. Call `b.network((n) => n.config((c) => " +
|
|
562
|
-
"{ c.token = ...; c.partnerConfig((p) => { p.partnerId = ...; }); }))`."),
|
|
563
|
-
});
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
|
-
let request;
|
|
567
|
-
try {
|
|
568
|
-
request = this._assembleJob();
|
|
569
|
-
}
|
|
570
|
-
catch (error) {
|
|
571
|
-
this._setSubmissionState({
|
|
572
|
-
kind: "failure",
|
|
573
|
-
error: error instanceof Error ? error : new Error(String(error)),
|
|
574
|
-
});
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
this._setSubmissionState({ kind: "loading" });
|
|
578
|
-
this._submissionAttemptCount += 1;
|
|
579
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.jobSubmitted, {
|
|
580
|
-
[UseSmileIDAnalyticsParamKeys.jobType]: this._jobTypeName(),
|
|
581
|
-
[UseSmileIDAnalyticsParamKeys.attempt]: String(this._submissionAttemptCount),
|
|
582
|
-
});
|
|
583
|
-
const result = await this._repository.submit(request);
|
|
584
|
-
if (this._disposed)
|
|
585
|
-
return;
|
|
586
|
-
if (result.status === "success") {
|
|
587
|
-
// Cache so a later navigateToNext() past the last screen can
|
|
588
|
-
// deliver the result without rebuilding the request (capture
|
|
589
|
-
// artifacts may have been released by then).
|
|
590
|
-
this._submissionResponse = result.value;
|
|
591
|
-
this._setSubmissionState({ kind: "success", response: result.value });
|
|
592
|
-
}
|
|
593
|
-
else if (result.status === "failure") {
|
|
594
|
-
// `result.error` is `unknown`; coerce defensively in case a
|
|
595
|
-
// mock/partner repository hands back a non-Error.
|
|
596
|
-
const error = result.error instanceof Error
|
|
597
|
-
? result.error
|
|
598
|
-
: new Error(String(result.error));
|
|
599
|
-
this._setSubmissionState({ kind: "failure", error });
|
|
600
|
-
}
|
|
601
|
-
// No `cancelled` branch: that outcome comes only from a user-initiated exit.
|
|
602
|
-
}
|
|
603
|
-
/**
|
|
604
|
-
* Build a typed `JobRequest` from `jobType` + captured artifacts.
|
|
605
|
-
* Throws a descriptive message when a required capture is missing.
|
|
606
|
-
*/
|
|
607
|
-
_assembleJob() {
|
|
608
|
-
const config = this._configuration;
|
|
609
|
-
const jobType = config.network?.config?.jobType ?? JobType.unknown;
|
|
610
|
-
// Token consent always wins: the `consent` part is omitted — the
|
|
611
|
-
// server injects the token's record — and any local preset or
|
|
612
|
-
// capture is ignored. Without a token binding, a local source
|
|
613
|
-
// (captured on the consent screen, else the builder preset) is
|
|
614
|
-
// sent in full, and the legacy DEFAULT_CONSENT placeholder covers
|
|
615
|
-
// the no-source case.
|
|
616
|
-
const consent = isTokenConsentComplete(this._resolvedTokenPayload?.consent)
|
|
617
|
-
? undefined
|
|
618
|
-
: (this._captured.consentInformation ??
|
|
619
|
-
config.consentInformation ??
|
|
620
|
-
DEFAULT_CONSENT);
|
|
621
|
-
const consentField = consent !== undefined ? { consent } : {};
|
|
622
|
-
// Build the per-submission metadata snapshot so it travels on the
|
|
623
|
-
// request (API layer serializes `request.metadata` directly).
|
|
624
|
-
// Dynamic fields (orientation, locale, timezone) re-resolve per
|
|
625
|
-
// make() so a mid-flow rotation is captured. resolvedSdkConfig drives
|
|
626
|
-
// sdk_config_source + image_width/height provenance.
|
|
627
|
-
const baseMetadata = this._metadataProvider.make(this.resolvedSdkConfig);
|
|
628
|
-
// Append the per-side document origins plus the partner's builder setup and
|
|
629
|
-
// the active detection models, all as flat wire entries.
|
|
630
|
-
// configurationMetadataEntries always contributes the builder + model config objects, so
|
|
631
|
-
// there is always at least one extra entry to append.
|
|
632
|
-
const extraEntries = [
|
|
633
|
-
...this._documentImageOriginEntries(),
|
|
634
|
-
...this._captureTelemetryEntries(),
|
|
635
|
-
...configurationMetadataEntries(config),
|
|
636
|
-
];
|
|
637
|
-
const metadata = baseMetadata.withAdditionalEntries(extraEntries);
|
|
638
|
-
switch (jobType) {
|
|
639
|
-
// enableEnhancedLiveness is a screen-level capture flag, not a
|
|
640
|
-
// distinct job type — enrollment still hits /v3/registration.
|
|
641
|
-
case JobType.smartSelfieEnrollment: {
|
|
642
|
-
const selfie = this._requireSelfie();
|
|
643
|
-
const userDetails = this._requireUserDetails(config);
|
|
644
|
-
return {
|
|
645
|
-
jobType: JobType.smartSelfieEnrollment,
|
|
646
|
-
selfieImage: selfie.selfiePath,
|
|
647
|
-
livenessImages: selfie.livenessPaths,
|
|
648
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
649
|
-
...consentField,
|
|
650
|
-
metadata,
|
|
651
|
-
enhanced: false,
|
|
652
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
|
-
case JobType.smartSelfieAuthentication: {
|
|
656
|
-
const selfie = this._requireSelfie();
|
|
657
|
-
const userDetails = this._requireUserDetails(config);
|
|
658
|
-
const userId = this._requireUserId(config);
|
|
659
|
-
return {
|
|
660
|
-
jobType: JobType.smartSelfieAuthentication,
|
|
661
|
-
selfieImage: selfie.selfiePath,
|
|
662
|
-
livenessImages: selfie.livenessPaths,
|
|
663
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
664
|
-
userId,
|
|
665
|
-
...consentField,
|
|
666
|
-
metadata,
|
|
667
|
-
enhanced: false,
|
|
668
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
case JobType.biometricKyc: {
|
|
672
|
-
const selfie = this._requireSelfie();
|
|
673
|
-
const params = config.biometricKYCParams;
|
|
674
|
-
if (!params) {
|
|
675
|
-
throw new MissingRequiredFieldException({
|
|
676
|
-
fieldName: "biometricKYCParams",
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
const userDetails = this._requireUserDetails(config);
|
|
680
|
-
return {
|
|
681
|
-
jobType: JobType.biometricKyc,
|
|
682
|
-
selfieImage: selfie.selfiePath,
|
|
683
|
-
livenessImages: selfie.livenessPaths,
|
|
684
|
-
params,
|
|
685
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
686
|
-
...consentField,
|
|
687
|
-
metadata,
|
|
688
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
689
|
-
};
|
|
690
|
-
}
|
|
691
|
-
case JobType.documentVerification: {
|
|
692
|
-
const selfie = this._requireSelfie();
|
|
693
|
-
const front = this._requireFrontDocument();
|
|
694
|
-
const params = config.documentVerificationParams;
|
|
695
|
-
if (!params) {
|
|
696
|
-
throw new MissingRequiredFieldException({
|
|
697
|
-
fieldName: "documentVerificationParams",
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
const userDetails = this._requireUserDetails(config);
|
|
701
|
-
return {
|
|
702
|
-
jobType: JobType.documentVerification,
|
|
703
|
-
...this._documentRequestFields(selfie, front),
|
|
704
|
-
country: params.country,
|
|
705
|
-
// Optional — omit when unset so the server classifies the document.
|
|
706
|
-
...(params.idType ? { idType: params.idType } : {}),
|
|
707
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
708
|
-
...consentField,
|
|
709
|
-
metadata,
|
|
710
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
case JobType.enhancedDocumentVerification: {
|
|
714
|
-
const selfie = this._requireSelfie();
|
|
715
|
-
const front = this._requireFrontDocument();
|
|
716
|
-
const params = config.enhancedDocumentVerificationParams;
|
|
717
|
-
if (!params) {
|
|
718
|
-
throw new MissingRequiredFieldException({
|
|
719
|
-
fieldName: "enhancedDocumentVerificationParams",
|
|
720
|
-
});
|
|
721
|
-
}
|
|
722
|
-
const userDetails = this._requireUserDetails(config);
|
|
723
|
-
return {
|
|
724
|
-
jobType: JobType.enhancedDocumentVerification,
|
|
725
|
-
...this._documentRequestFields(selfie, front),
|
|
726
|
-
country: params.country,
|
|
727
|
-
idType: params.idType,
|
|
728
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
729
|
-
...consentField,
|
|
730
|
-
metadata,
|
|
731
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
case JobType.enhancedKyc: {
|
|
735
|
-
const params = config.enhancedKYCParams;
|
|
736
|
-
if (!params) {
|
|
737
|
-
throw new MissingRequiredFieldException({
|
|
738
|
-
fieldName: "enhancedKYCParams",
|
|
739
|
-
});
|
|
740
|
-
}
|
|
741
|
-
const userDetails = this._requireUserDetails(config);
|
|
742
|
-
return {
|
|
743
|
-
jobType: JobType.enhancedKyc,
|
|
744
|
-
params,
|
|
745
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
746
|
-
...consentField,
|
|
747
|
-
metadata,
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
case JobType.bvn: {
|
|
751
|
-
// Dedicated `bvn` request kind; the repository rejects it with
|
|
752
|
-
// "BVN submission is not yet supported" until the endpoint lands.
|
|
753
|
-
// Deliberately not silently mapped onto /v3/enhanced_kyc so
|
|
754
|
-
// partners see the unsupported state explicitly.
|
|
755
|
-
const params = config.enhancedKYCParams;
|
|
756
|
-
if (!params) {
|
|
757
|
-
throw new MissingRequiredFieldException({
|
|
758
|
-
fieldName: "enhancedKYCParams",
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
const userDetails = this._requireUserDetails(config);
|
|
762
|
-
return {
|
|
763
|
-
jobType: JobType.bvn,
|
|
764
|
-
params,
|
|
765
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
766
|
-
...consentField,
|
|
767
|
-
metadata,
|
|
768
|
-
};
|
|
769
|
-
}
|
|
770
|
-
case JobType.unknown:
|
|
771
|
-
default:
|
|
772
|
-
throw new MissingJobTypeException();
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
_requireSelfie() {
|
|
776
|
-
const { selfiePath, livenessPaths } = this._captured;
|
|
777
|
-
if (!selfiePath) {
|
|
778
|
-
throw new MissingRequiredFieldException({ fieldName: "selfieImage" });
|
|
779
|
-
}
|
|
780
|
-
return { selfiePath, livenessPaths };
|
|
781
|
-
}
|
|
782
|
-
/**
|
|
783
|
-
* Resolve `b.userDetails` for the wire. May legitimately return
|
|
784
|
-
* `undefined` when the token binds every required field
|
|
785
|
-
* (`given_names`, `last_name`, and a contact field) — the
|
|
786
|
-
* `user_details` part is then omitted and the server injects the
|
|
787
|
-
* token's values. Otherwise throws exactly as before token support.
|
|
788
|
-
*/
|
|
789
|
-
_requireUserDetails(config) {
|
|
790
|
-
const userDetails = config.userDetails;
|
|
791
|
-
if (!userDetails) {
|
|
792
|
-
if (bindsRequiredUserDetails(this._resolvedTokenPayload)) {
|
|
793
|
-
return undefined;
|
|
794
|
-
}
|
|
795
|
-
throw new MissingRequiredFieldException({ fieldName: "userDetails" });
|
|
796
|
-
}
|
|
797
|
-
const payload = userDetailsPayloadFrom(userDetails, this._resolvedTokenPayload);
|
|
798
|
-
return isUserDetailsPayloadEmpty(payload) ? undefined : payload;
|
|
799
|
-
}
|
|
800
|
-
/**
|
|
801
|
-
* Resolve `b.userId` for smartSelfieAuthentication —
|
|
802
|
-
* `/v3/authentication` requires the prior-enrollment `user_id` to
|
|
803
|
-
* match the attempt. Throws `MissingRequiredFieldException` if blank.
|
|
804
|
-
*/
|
|
805
|
-
_requireUserId(config) {
|
|
806
|
-
const userId = config.userId?.trim();
|
|
807
|
-
if (!userId) {
|
|
808
|
-
throw new MissingRequiredFieldException({ fieldName: "userId" });
|
|
809
|
-
}
|
|
810
|
-
return userId;
|
|
811
|
-
}
|
|
812
|
-
_requireFrontDocument() {
|
|
813
|
-
const { frontDocumentPath } = this._captured;
|
|
814
|
-
if (!frontDocumentPath) {
|
|
815
|
-
throw new MissingRequiredFieldException({ fieldName: "frontDocument" });
|
|
816
|
-
}
|
|
817
|
-
return frontDocumentPath;
|
|
818
|
-
}
|
|
819
|
-
/** Capture-artifact fields shared by both document request variants. */
|
|
820
|
-
_documentRequestFields(selfie, frontDocument) {
|
|
821
|
-
const { backDocumentPath } = this._captured;
|
|
822
|
-
return {
|
|
823
|
-
selfieImage: selfie.selfiePath,
|
|
824
|
-
livenessImages: selfie.livenessPaths,
|
|
825
|
-
frontDocument,
|
|
826
|
-
...(backDocumentPath ? { backDocument: backDocumentPath } : {}),
|
|
827
|
-
};
|
|
828
|
-
}
|
|
829
|
-
// --- analytics --------------------------------------------------------
|
|
830
|
-
/** Emit terminal `flow_completed` (completed/failed only; not cancelled), then exit via `onExit`. */
|
|
831
|
-
_finishFlow(reason) {
|
|
832
|
-
if (reason.kind === "completed") {
|
|
833
|
-
const extras = {
|
|
834
|
-
[UseSmileIDAnalyticsParamKeys.result]: "success",
|
|
835
|
-
};
|
|
836
|
-
if (reason.job.jobId) {
|
|
837
|
-
extras[UseSmileIDAnalyticsParamKeys.jobId] = reason.job.jobId;
|
|
838
|
-
}
|
|
839
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.flowCompleted, extras);
|
|
840
|
-
}
|
|
841
|
-
else if (reason.kind === "failed") {
|
|
842
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.flowCompleted, {
|
|
843
|
-
[UseSmileIDAnalyticsParamKeys.result]: "failure",
|
|
844
|
-
[UseSmileIDAnalyticsParamKeys.errorMessage]: reason.error instanceof Error
|
|
845
|
-
? reason.error.message
|
|
846
|
-
: String(reason.error),
|
|
847
|
-
});
|
|
848
|
-
}
|
|
849
|
-
this._onExit(reason);
|
|
850
|
-
}
|
|
851
|
-
/** Forward a lifecycle event to `onAnalyticsEvent`, adding `session_id` + `timestamp`. No-op without a callback. */
|
|
852
|
-
_logEvent(type, extras = {}) {
|
|
853
|
-
const onAnalyticsEvent = this._configuration.onAnalyticsEvent;
|
|
854
|
-
if (!onAnalyticsEvent)
|
|
855
|
-
return;
|
|
856
|
-
onAnalyticsEvent({
|
|
857
|
-
type,
|
|
858
|
-
extras: {
|
|
859
|
-
...extras,
|
|
860
|
-
[UseSmileIDAnalyticsParamKeys.sessionId]: this._sessionId,
|
|
861
|
-
[UseSmileIDAnalyticsParamKeys.timestamp]: String(Date.now()),
|
|
862
|
-
},
|
|
863
|
-
});
|
|
864
|
-
}
|
|
865
|
-
_jobTypeName() {
|
|
866
|
-
return String(this._configuration.network?.config?.jobType ?? JobType.unknown);
|
|
867
|
-
}
|
|
868
|
-
_screenAnalyticsName(screen) {
|
|
869
|
-
const names = {
|
|
870
|
-
consent: UseSmileIDAnalyticsScreenNames.consent,
|
|
871
|
-
instructions: UseSmileIDAnalyticsScreenNames.instructions,
|
|
872
|
-
capture: UseSmileIDAnalyticsScreenNames.capture,
|
|
873
|
-
preview: UseSmileIDAnalyticsScreenNames.preview,
|
|
874
|
-
processing: UseSmileIDAnalyticsScreenNames.processing,
|
|
875
|
-
};
|
|
876
|
-
return names[screen.kind];
|
|
877
|
-
}
|
|
878
|
-
// --- subscription -----------------------------------------------------
|
|
879
|
-
/** Subscribe to state changes; returns an unsubscribe (safe after `dispose()`). */
|
|
880
|
-
subscribe(listener) {
|
|
881
|
-
this._listeners.add(listener);
|
|
882
|
-
return () => {
|
|
883
|
-
this._listeners.delete(listener);
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
/** Tear down — drop listeners, make methods no-ops (orchestrator's useEffect cleanup). */
|
|
887
|
-
dispose() {
|
|
888
|
-
this._disposed = true;
|
|
889
|
-
this._listeners.clear();
|
|
890
|
-
}
|
|
891
|
-
/**
|
|
892
|
-
* Expected liveness image count: ESS uses its fixed count (head-turn
|
|
893
|
-
* flow self-manages); else the token's livenessImageCount override;
|
|
894
|
-
* else the ScanPerformanceProfile default (`numSamples - 1`).
|
|
895
|
-
*/
|
|
896
|
-
_expectedLivenessImageCount() {
|
|
897
|
-
const isEnhancedLiveness = this.enhancedLivenessEnabled;
|
|
898
|
-
if (isEnhancedLiveness) {
|
|
899
|
-
return EnhancedSmartSelfieConfig.EXPECTED_LIVENESS_IMAGE_COUNT;
|
|
900
|
-
}
|
|
901
|
-
const override = numSamplesOverride(this.resolvedSdkConfig);
|
|
902
|
-
if (override !== undefined) {
|
|
903
|
-
// numSamplesOverride = livenessImageCount + 1; subtract the selfie.
|
|
904
|
-
return override - 1;
|
|
905
|
-
}
|
|
906
|
-
// Profile numSamples (default Balanced = 8) minus the reference selfie.
|
|
907
|
-
const profileNumSamples = this._configuration.ml?.analyzers.selfieConfig?.numSamples ??
|
|
908
|
-
ScanPerformanceProfile.Balanced.numSamples;
|
|
909
|
-
return profileNumSamples - 1;
|
|
910
|
-
}
|
|
911
|
-
/**
|
|
912
|
-
* Decode the partner JWT into its claims (`sdk_config`, `partner_id`). `undefined` for offline
|
|
913
|
-
* mode, no token, or an unparseable token — SDK defaults apply in those cases.
|
|
914
|
-
*/
|
|
915
|
-
static _decodeToken(configuration) {
|
|
916
|
-
if (configuration.config?.allowOfflineMode)
|
|
917
|
-
return undefined;
|
|
918
|
-
const token = configuration.network?.config?.token;
|
|
919
|
-
if (!token || token.length === 0)
|
|
920
|
-
return undefined;
|
|
921
|
-
return decodeSmileIDToken(token);
|
|
922
|
-
}
|
|
923
|
-
_notify() {
|
|
924
|
-
for (const listener of this._listeners) {
|
|
925
|
-
try {
|
|
926
|
-
listener();
|
|
927
|
-
}
|
|
928
|
-
catch {
|
|
929
|
-
// Swallow so one bad listener can't poison the dispatch chain;
|
|
930
|
-
// the orchestrator-level boundary handles crash reporting.
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
//# sourceMappingURL=flow_navigation_manager.js.map
|
|
1
|
+
"use strict";import{File as b}from"expo-file-system";import{JobType as n}from"../../core/models/job_type";import{CaptureType as _}from"../../core/models/ml_config";import{defaultFrameAspectRatio as y}from"../../core/models/document_type";import{MissingJobTypeException as P,MissingRequiredFieldException as h}from"../../core/exception/job_validation_exceptions";import{InvalidFieldValueException as I}from"../../core/exception/invalid_field_value_exception";import{UseSmileIDAnalyticsEventTypes as m,UseSmileIDAnalyticsParamKeys as a,UseSmileIDAnalyticsScreenNames as g}from"./analytics/use_smile_id_analytics_event";import{UseSmileIDMetadataFactory as C}from"../../metadata/use_smile_id_metadata_factory";import{DOCUMENT_BACK_IMAGE_ORIGIN_KEY as D,DOCUMENT_FRONT_IMAGE_ORIGIN_KEY as T}from"../../metadata/document_image_origin";import{configurationMetadataEntries as w}from"../../metadata/metadata_configuration_mappers";import{CAPTURE_IMAGE_COLOR_DEPTH as v,CAPTURE_IMAGE_PIXEL_CONFIG as S}from"../../metadata/captured_image_properties";import{numSamplesOverride as E}from"../../data/model/sdk_config";import{decodeSmileIDToken as N}from"../../data/util/use_smile_id_token_decoder";import{isTokenConsentComplete as k,bindsRequiredUserDetails as x}from"../../data/model/token_payload";import{isUserDetailsPayloadEmpty as j,userDetailsPayloadFrom as F}from"../../data/model/user_details_payload";import{DocumentSide as p,EnhancedSmartSelfieConfig as A}from"@smileid/usesmileid_bridge";import{ScanPerformanceProfile as O}from"@smileid/usesmileid_bridge";const q=Object.freeze({granted:!1,grantedAt:"",noticeLanguage:"",noticePrivacyPolicyUrl:""});export class FlowNavigationManager{_navigationPath=[];_captured={livenessPaths:[]};_documentBackSkipped=!1;_documentImageOrigins=new Map;_selfieCaptureTelemetry;_documentCaptureTelemetry=new Map;_cameraName;_devicePositions=[];_deviceMovementDetected=null;_jobSubmissionState={kind:"notAttempted"};_listeners=new Set;_steps;_configuration;_repository;_metadataProvider;_onExit;_disposed=!1;_submissionResponse;resolvedSdkConfig;_resolvedPartnerId;_resolvedTokenPayload;get partnerId(){const e=this._resolvedPartnerId;return e&&e.length>0?e:this._configuration.network?.config?.partnerConfig?.partnerId??""}_sessionId;_submissionAttemptCount=0;constructor(e){this._configuration=e.configuration,this._onExit=e.onExit,this._repository=e.repository,this._metadataProvider=e.metadataProvider??new C,this._sessionId=this._metadataProvider.sessionId;const t=FlowNavigationManager._decodeToken(e.configuration);this.resolvedSdkConfig=t?.sdkConfig,this._resolvedPartnerId=t?.partnerId,this._resolvedTokenPayload=t?.tokenPayload;const i=e.configuration.screens.steps;this._steps=k(t?.tokenPayload?.consent)?i.filter(c=>c.kind!=="consent"):i;const s=this._steps[0];s&&(this._navigationPath=[s]),this._logEvent(m.flowStarted,{[a.jobType]:this._jobTypeName()}),s&&this._logEvent(m.screenViewed,{[a.screenName]:this._screenAnalyticsName(s)})}get configuration(){return this._configuration}get enhancedLivenessEnabled(){return this._steps.some(e=>e.kind==="capture"&&e.config.selfieConfig?.enableEnhancedLiveness===!0)}get documentType(){for(const e of this._steps)if(e.kind==="capture"&&e.config.captureType===_.document)return e.config.documentConfig?.documentType}get documentFrameAspectRatio(){for(const e of this._steps)if(e.kind==="capture"&&e.config.captureType===_.document){const t=e.config.documentConfig;return t?.resolvedAspectRatio??y(t?.documentType?.orientation??"Landscape")}}get navigationPath(){return this._navigationPath}get currentScreen(){return this._navigationPath[this._navigationPath.length-1]}get currentDepth(){return this._navigationPath.length-1}get isFirstScreen(){return this._navigationPath.length<=1}get isLastScreen(){return this.getNextScreen()===void 0}getNextScreen(){const e=this.currentScreen;if(!e)return;const t=this._steps.indexOf(e);if(!(t<0)){if(e.kind==="preview"&&this._precedingStepIsDocumentCapture(t)&&this.documentCapturesBack()&&this._captured.backDocumentPath===void 0&&!this._documentBackSkipped){const i=this._steps[t-1];if(i!==void 0)return i}return e.kind==="capture"&&e.config.captureType===_.document&&this._documentBackSkipped&&this._steps[t+1]?.kind==="preview"?this._steps[t+2]:e.kind==="capture"&&e.config.captureType===_.document&&this.documentCapturesBack()&&this._captured.frontDocumentPath!==void 0&&this._captured.backDocumentPath===void 0&&!this._documentBackSkipped&&!this.documentPreviewFollowsCapture()?e:this._steps[t+1]}}navigateToNext(){if(this._disposed)return;const e=this.getNextScreen();if(!e){const t=this._jobSubmissionState;if(this._submissionResponse){this._finishFlow({kind:"completed",job:this._submissionResponse});return}if(t.kind==="failure"){this._finishFlow({kind:"failed",error:t.error});return}const i=t.kind==="success"?t.response:{userId:"",jobId:"",status:"",message:""};this._finishFlow({kind:"completed",job:i});return}this._navigationPath=[...this._navigationPath,e],this._logEvent(m.screenViewed,{[a.screenName]:this._screenAnalyticsName(e)}),e.kind==="processing"&&this._jobSubmissionState.kind==="notAttempted"&&this._repository!==void 0&&(this._jobSubmissionState={kind:"loading"}),this._notify(),e.kind==="processing"&&this._jobSubmissionState.kind==="loading"&&this._repository!==void 0&&setTimeout(()=>{this._disposed||this._submit()},0)}navigateBack(){if(!this._disposed){if(this.isFirstScreen){this._onExit({kind:"cancelled"});return}this._logEvent(m.retakeRequested),this._navigationPath=this._navigationPath.slice(0,-1),this._notify()}}navigateToStart(){if(this._disposed)return;const e=this._steps[0];this._navigationPath=e?[e]:[],this._notify()}exit(e={kind:"cancelled"}){this._disposed||this._finishFlow(e)}get captured(){return this._captured}setCapturedSelfie(e,t){this._disposed||(this._captured={...this._captured,selfiePath:e,livenessPaths:Object.freeze([...t])},this._logEvent(m.selfieCaptured,{[a.livenessImageCount]:String(t.length)}),this._notify())}setCapturedFrontDocument(e){this._disposed||(this._captured={...this._captured,frontDocumentPath:e},this._logEvent(m.documentCaptured,{[a.documentSide]:"front"}),this._notify())}setCapturedBackDocument(e){this._disposed||(this._captured={...this._captured,backDocumentPath:e},this._logEvent(m.documentCaptured,{[a.documentSide]:"both"}),this._notify())}documentCapturesBack(){for(const e of this._steps)if(e.kind==="capture"&&e.config.captureType===_.document){const t=e.config.documentConfig;return t?.documentType?.hasBackSide===!0&&(t?.captureBothSides??!1)}return!1}documentPreviewFollowsCapture(){const e=this._steps.findIndex(t=>t.kind==="capture"&&t.config.captureType===_.document);return e<0?!1:this._steps[e+1]?.kind==="preview"}currentPreviewIsDocument(){const e=this.currentScreen;return!e||e.kind!=="preview"?!1:this._precedingStepIsDocumentCapture(this._steps.indexOf(e))}currentDocumentPreviewPath(){return this._captured.backDocumentPath??this._captured.frontDocumentPath}retakeCurrentDocumentSide(){if(this._disposed)return;const e={...this._captured};e.backDocumentPath!==void 0?(delete e.backDocumentPath,this._documentImageOrigins.delete(p.Back)):(delete e.frontDocumentPath,this._documentImageOrigins.delete(p.Front),this._documentBackSkipped=!1),this._captured=e,this._notify()}skipDocumentBack(){this._disposed||(this._documentBackSkipped=!0,this._notify())}recordDocumentImageOrigin(e,t){this._disposed||this._documentImageOrigins.set(e,t)}recordSelfieCaptureTelemetry(e){this._disposed||(this._selfieCaptureTelemetry=e,this._captureCameraName(e))}recordDocumentCaptureTelemetry(e,t){this._disposed||(this._documentCaptureTelemetry.set(e,t),this._captureCameraName(t))}_captureCameraName(e){e.cameraName&&(this._cameraName=e.cameraName),e.devicePositions.length>0&&(this._devicePositions=e.devicePositions,this._deviceMovementDetected=e.deviceMovementDetected)}_documentImageOriginEntries(){const e=[],t=this._documentImageOrigins.get(p.Front);t!==void 0&&e.push({name:T,value:t});const i=this._documentImageOrigins.get(p.Back);return i!==void 0&&e.push({name:D,value:i}),e}_captureTelemetryEntries(){const e=[],t=(c,u)=>e.push({name:c,value:u}),i=this._selfieCaptureTelemetry;i&&(t("selfie_capture_duration_ms",String(i.durationMs)),t("selfie_capture_retries",String(i.retries))),this._captured.selfiePath!==void 0&&(t("selfie_image_color_depth",String(v)),t("selfie_image_pixel_config",S)),this._cameraName&&t("camera_name",this._cameraName),this._devicePositions.length>0&&(t("device_positions",JSON.stringify(this._devicePositions)),this._deviceMovementDetected!==null&&t("device_movement_detected",String(this._deviceMovementDetected)));const s=c=>c===p.Back?"back":"front";for(const c of[p.Front,p.Back]){const u=s(c),f=this._documentCaptureTelemetry.get(c);f&&(t(`document_${u}_capture_duration_ms`,String(f.durationMs)),t(`document_${u}_capture_retries`,String(f.retries)),t(`document_${u}_image_color_depth`,String(v)),t(`document_${u}_image_pixel_config`,S))}return e}_precedingStepIsDocumentCapture(e){const t=this._steps[e-1];return t?.kind==="capture"&&t.config.captureType===_.document}setConsent(e){this._disposed||(this._captured={...this._captured,consentInformation:e},this._logEvent(m.consentCaptured,{[a.decision]:"granted"}),this._notify())}get jobSubmissionState(){return this._jobSubmissionState}beginSubmissionIfNeeded(){this._disposed||this._jobSubmissionState.kind==="notAttempted"&&this._submit()}retrySubmission(){this._disposed||this._jobSubmissionState.kind!=="loading"&&(this._setSubmissionState({kind:"notAttempted"}),this.beginSubmissionIfNeeded())}_setSubmissionState(e){this._disposed||(this._jobSubmissionState=e,this._notify())}async _submit(){if(!this._repository){this._setSubmissionState({kind:"failure",error:new Error("Job submission not configured \u2014 no network/repository was supplied to <UseSmileIDBuilder>. Call `b.network((n) => n.config((c) => { c.token = ...; c.partnerConfig((p) => { p.partnerId = ...; }); }))`.")});return}let e;try{e=this._assembleJob()}catch(i){this._setSubmissionState({kind:"failure",error:i instanceof Error?i:new Error(String(i))});return}this._setSubmissionState({kind:"loading"}),this._submissionAttemptCount+=1,this._logEvent(m.jobSubmitted,{[a.jobType]:this._jobTypeName(),[a.attempt]:String(this._submissionAttemptCount)});const t=await this._repository.submit(e,this.resolvedSdkConfig);if(!this._disposed){if(t.status==="success")this._submissionResponse=t.value,this._setSubmissionState({kind:"success",response:t.value});else if(t.status==="failure"){const i=t.error instanceof Error?t.error:new Error(String(t.error));this._setSubmissionState({kind:"failure",error:i})}}}_assembleJob(){const e=this._configuration,t=e.network?.config?.jobType??n.unknown,i=k(this._resolvedTokenPayload?.consent)?void 0:this._captured.consentInformation??e.consentInformation??q,s=i!==void 0?{consent:i}:{},c=this._metadataProvider.make(this.resolvedSdkConfig),u=[...this._documentImageOriginEntries(),...this._captureTelemetryEntries(),...w(e)],f=c.withAdditionalEntries(u);switch(t){case n.smartSelfieEnrollment:{const r=this._requireSelfie(),o=this._requireUserDetails(e);return{jobType:n.smartSelfieEnrollment,selfieImage:r.selfiePath,livenessImages:r.livenessPaths,...o!==void 0?{userDetails:o}:{},...s,metadata:f,enhanced:!1,expectedLivenessImageCount:this._expectedLivenessImageCount()}}case n.smartSelfieAuthentication:{const r=this._requireSelfie(),o=this._requireUserDetails(e),d=this._requireUserId(e);return{jobType:n.smartSelfieAuthentication,selfieImage:r.selfiePath,livenessImages:r.livenessPaths,...o!==void 0?{userDetails:o}:{},userId:d,...s,metadata:f,enhanced:!1,expectedLivenessImageCount:this._expectedLivenessImageCount()}}case n.biometricKyc:{const r=this._requireSelfie(),o=e.biometricKYCParams;if(!o)throw new h({fieldName:"biometricKYCParams"});const d=this._requireUserDetails(e);return{jobType:n.biometricKyc,selfieImage:r.selfiePath,livenessImages:r.livenessPaths,params:o,...d!==void 0?{userDetails:d}:{},...s,metadata:f,expectedLivenessImageCount:this._expectedLivenessImageCount()}}case n.documentVerification:{const r=this._requireSelfie(),o=this._requireFrontDocument(),d=e.documentVerificationParams;if(!d)throw new h({fieldName:"documentVerificationParams"});const l=this._requireUserDetails(e);return{jobType:n.documentVerification,...this._documentRequestFields(r,o),country:d.country,...d.idType?{idType:d.idType}:{},...l!==void 0?{userDetails:l}:{},...s,metadata:f,expectedLivenessImageCount:this._expectedLivenessImageCount()}}case n.enhancedDocumentVerification:{const r=this._requireSelfie(),o=this._requireFrontDocument(),d=e.enhancedDocumentVerificationParams;if(!d)throw new h({fieldName:"enhancedDocumentVerificationParams"});const l=this._requireUserDetails(e);return{jobType:n.enhancedDocumentVerification,...this._documentRequestFields(r,o),country:d.country,idType:d.idType,...l!==void 0?{userDetails:l}:{},...s,metadata:f,expectedLivenessImageCount:this._expectedLivenessImageCount()}}case n.enhancedKyc:{const r=e.enhancedKYCParams;if(!r)throw new h({fieldName:"enhancedKYCParams"});const o=this._requireUserDetails(e);return{jobType:n.enhancedKyc,params:r,...o!==void 0?{userDetails:o}:{},...s,metadata:f}}case n.bvn:throw new I({fieldName:"jobType",reason:"BVN submission is not yet supported"});case n.unknown:default:throw new P}}_requireSelfie(){const{selfiePath:e,livenessPaths:t}=this._captured;if(!e)throw new h({fieldName:"selfieImage"});return{selfiePath:e,livenessPaths:t}}_requireUserDetails(e){const t=e.userDetails;if(!t){if(x(this._resolvedTokenPayload))return;throw new h({fieldName:"userDetails"})}const i=F(t,this._resolvedTokenPayload);return j(i)?void 0:i}_requireUserId(e){const t=e.userId?.trim();if(!t)throw new h({fieldName:"userId"});return t}_requireFrontDocument(){const{frontDocumentPath:e}=this._captured;if(!e)throw new h({fieldName:"frontDocument"});return e}_documentRequestFields(e,t){const{backDocumentPath:i}=this._captured;return{selfieImage:e.selfiePath,livenessImages:e.livenessPaths,frontDocument:t,...i?{backDocument:i}:{}}}_deleteCapturedFiles(){if(this._configuration.config?.allowOfflineMode)return;const{selfiePath:e,livenessPaths:t,frontDocumentPath:i,backDocumentPath:s}=this._captured;for(const c of[e,...t,i,s])if(c)try{const u=new b(c);u.exists&&u.delete()}catch{}}_finishFlow(e){if(this._deleteCapturedFiles(),e.kind==="completed"){const t={[a.result]:"success"};e.job.jobId&&(t[a.jobId]=e.job.jobId),this._logEvent(m.flowCompleted,t)}else e.kind==="failed"&&this._logEvent(m.flowCompleted,{[a.result]:"failure",[a.errorMessage]:e.error instanceof Error?e.error.message:String(e.error)});this._onExit(e)}_logEvent(e,t={}){const i=this._configuration.onAnalyticsEvent;i&&i({type:e,extras:{...t,[a.sessionId]:this._sessionId,[a.timestamp]:String(Date.now())}})}_jobTypeName(){return String(this._configuration.network?.config?.jobType??n.unknown)}_screenAnalyticsName(e){return{consent:g.consent,instructions:g.instructions,capture:g.capture,preview:g.preview,processing:g.processing}[e.kind]}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}dispose(){this._disposed=!0,this._listeners.clear()}_expectedLivenessImageCount(){if(this.enhancedLivenessEnabled)return A.EXPECTED_LIVENESS_IMAGE_COUNT;const t=E(this.resolvedSdkConfig);return t!==void 0?t-1:(this._configuration.ml?.analyzers.selfieConfig?.numSamples??O.Balanced.numSamples)-1}static _decodeToken(e){if(e.config?.allowOfflineMode)return;const t=e.network?.config?.token;if(!(!t||t.length===0))return N(t)}_notify(){for(const e of this._listeners)try{e()}catch{}}}
|