@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,1128 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import {
|
|
4
|
-
create as createRenderer,
|
|
5
|
-
act,
|
|
6
|
-
type ReactTestInstance,
|
|
7
|
-
} from "react-test-renderer";
|
|
8
|
-
import { Pressable, Text } from "react-native";
|
|
9
|
-
import * as VisionCamera from "react-native-vision-camera";
|
|
10
|
-
import * as Brightness from "expo-brightness";
|
|
11
|
-
import { StatusBar } from "react-native";
|
|
12
|
-
import { UseSmileIDCaptureScreen } from "../use_smile_id_capture_screen";
|
|
13
|
-
import { CaptureType } from "../../../core/models/ml_config";
|
|
14
|
-
import { DocumentCaptureMode } from "../../../core/models/document_capture_mode";
|
|
15
|
-
import { mockedTakePhoto } from "../../../__tests__/setup_react_native";
|
|
16
|
-
import { enStrings } from "../../../l10n/strings_en";
|
|
17
|
-
import {
|
|
18
|
-
UseSmileIDScanStateType,
|
|
19
|
-
CaptureReadyEventKind,
|
|
20
|
-
} from "@smileid/usesmileid_bridge";
|
|
21
|
-
import type {
|
|
22
|
-
UseSmileIDScanState,
|
|
23
|
-
CaptureReadyEvent,
|
|
24
|
-
FaceScanResult,
|
|
25
|
-
} from "@smileid/usesmileid_bridge";
|
|
26
|
-
import { scriptedFaceScanResults } from "../../../testing/scripted_scan_results";
|
|
27
|
-
import { parseScriptedScenario } from "../../../testing/scenario_loader";
|
|
28
|
-
import { isSessionBoundary } from "../helpers/capture_ui_state";
|
|
29
|
-
import { UseSmileIDFeedbackDebouncer } from "../helpers/feedback_debouncer";
|
|
30
|
-
import { UseSmileIDMotion } from "../../theme/use_smile_id_motion";
|
|
31
|
-
import { readFileSync } from "node:fs";
|
|
32
|
-
import { dirname, join } from "node:path";
|
|
33
|
-
|
|
34
|
-
// The shared scenario set lives at the repo root (e2e/scenarios/), outside this
|
|
35
|
-
// package's tsc rootDir (./src), so the test reads selfie-happy-path.json at run
|
|
36
|
-
// time. These minimal ambient decls keep the read typed without pulling
|
|
37
|
-
// @types/node in (which would collide with react-native's global timer types).
|
|
38
|
-
declare module "node:fs" {
|
|
39
|
-
export function readFileSync(path: string, encoding: "utf8"): string;
|
|
40
|
-
}
|
|
41
|
-
declare module "node:path" {
|
|
42
|
-
export function dirname(path: string): string;
|
|
43
|
-
export function join(...parts: string[]): string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Capture the screen's per-frame `onResult` so tests can drive synthetic
|
|
47
|
-
// sequences — the vision-camera worklet can't run in vitest, and `onResult`
|
|
48
|
-
// gets a validated result, so this bypasses only the native plugin.
|
|
49
|
-
let capturedOnResult: ((result: FaceScanResult) => void) | null = null;
|
|
50
|
-
vi.mock("../../../camera/use_smile_id_frame_stream", async () => {
|
|
51
|
-
const actual = await vi.importActual<
|
|
52
|
-
typeof import("../../../camera/use_smile_id_frame_stream")
|
|
53
|
-
>("../../../camera/use_smile_id_frame_stream");
|
|
54
|
-
return {
|
|
55
|
-
...actual,
|
|
56
|
-
useSmileIDFrameStream: (
|
|
57
|
-
_analyzer: unknown,
|
|
58
|
-
onResult: (result: FaceScanResult) => void,
|
|
59
|
-
) => {
|
|
60
|
-
capturedOnResult = onResult;
|
|
61
|
-
return { onFrameResult: () => {} };
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Component-level tests for the capture screen:
|
|
68
|
-
* - light-only theme on every leaf (forceLightMode propagation)
|
|
69
|
-
* - camera preview rendered for the correct lens
|
|
70
|
-
* - permission auto-request fires once on mount
|
|
71
|
-
* - feedback string follows the overlay state
|
|
72
|
-
* - start button only present in INSTRUCTION state, gated by readiness
|
|
73
|
-
* - back button forwards taps
|
|
74
|
-
* - brightness hook engaged on mount
|
|
75
|
-
*
|
|
76
|
-
* Mocks for `react-native-vision-camera`, `react-native-worklets-core`,
|
|
77
|
-
* `expo-brightness`, `expo-keep-awake` are installed in
|
|
78
|
-
* `setup_react_native.ts`. Tests reset the granted permission contract
|
|
79
|
-
* per-block.
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
const mockedUseCameraPermission = vi.mocked(VisionCamera.useCameraPermission);
|
|
83
|
-
const mockedUseCameraDevice = vi.mocked(VisionCamera.useCameraDevice);
|
|
84
|
-
const mockedSetBrightness = vi.mocked(Brightness.setBrightnessAsync);
|
|
85
|
-
const mockedGetBrightness = vi.mocked(Brightness.getBrightnessAsync);
|
|
86
|
-
|
|
87
|
-
function render(element: React.ReactElement) {
|
|
88
|
-
let tree!: ReturnType<typeof createRenderer>;
|
|
89
|
-
act(() => {
|
|
90
|
-
tree = createRenderer(element);
|
|
91
|
-
});
|
|
92
|
-
return tree;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function findByTestID(
|
|
96
|
-
root: ReactTestInstance,
|
|
97
|
-
testID: string,
|
|
98
|
-
): ReactTestInstance | null {
|
|
99
|
-
const matches = root.findAllByProps({ testID });
|
|
100
|
-
return matches[0] ?? null;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function findTextNode(
|
|
104
|
-
root: ReactTestInstance,
|
|
105
|
-
expected: string,
|
|
106
|
-
): ReactTestInstance | null {
|
|
107
|
-
const matches = root.findAll(
|
|
108
|
-
(node) => {
|
|
109
|
-
if (node.type !== Text) return false;
|
|
110
|
-
return collectText(node).includes(expected);
|
|
111
|
-
},
|
|
112
|
-
{ deep: true },
|
|
113
|
-
);
|
|
114
|
-
return matches[0] ?? null;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function collectText(node: ReactTestInstance): string {
|
|
118
|
-
return node.children
|
|
119
|
-
.map((child) =>
|
|
120
|
-
typeof child === "string"
|
|
121
|
-
? child
|
|
122
|
-
: collectText(child as ReactTestInstance),
|
|
123
|
-
)
|
|
124
|
-
.join("");
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// vision-camera's `CameraDevice` shape — only the fields the screen
|
|
128
|
-
// touches need to be present for tests. The mock returns the same
|
|
129
|
-
// device regardless of position; tests that care about the lens
|
|
130
|
-
// inspect what `useCameraDevice` was called with instead.
|
|
131
|
-
const fakeFrontDevice = {
|
|
132
|
-
id: "test-front",
|
|
133
|
-
position: "front" as const,
|
|
134
|
-
hasFlash: false,
|
|
135
|
-
hasTorch: false,
|
|
136
|
-
formats: [],
|
|
137
|
-
isMultiCam: false,
|
|
138
|
-
supportsRawCapture: false,
|
|
139
|
-
supportsLowLightBoost: false,
|
|
140
|
-
supportsFocus: true,
|
|
141
|
-
name: "Front Camera (test)",
|
|
142
|
-
} as unknown as ReturnType<typeof VisionCamera.useCameraDevice>;
|
|
143
|
-
|
|
144
|
-
// Minimal analyzer fixture — the screen reads `frameProcessorPluginName`
|
|
145
|
-
// at render time (to initialise the native frame processor plugin) and
|
|
146
|
-
// calls lifecycle methods from result callbacks. Tests that assert
|
|
147
|
-
// flush/complete behaviour override `flush` per-test.
|
|
148
|
-
function makeFakeAnalyzer() {
|
|
149
|
-
return {
|
|
150
|
-
kind: "face",
|
|
151
|
-
key: "mlkit-face",
|
|
152
|
-
frameProcessorPluginName: "UseSmileIDTestFrameProcessor",
|
|
153
|
-
configure: vi.fn(async () => {}),
|
|
154
|
-
reset: vi.fn(async () => {}),
|
|
155
|
-
flush: vi.fn(async () => {}),
|
|
156
|
-
close: vi.fn(async () => {}),
|
|
157
|
-
} as unknown as React.ComponentProps<
|
|
158
|
-
typeof UseSmileIDCaptureScreen
|
|
159
|
-
>["analyzer"];
|
|
160
|
-
}
|
|
161
|
-
const fakeAnalyzer = makeFakeAnalyzer();
|
|
162
|
-
|
|
163
|
-
describe("UseSmileIDCaptureScreen", () => {
|
|
164
|
-
beforeEach(() => {
|
|
165
|
-
mockedGetBrightness.mockReset();
|
|
166
|
-
mockedGetBrightness.mockResolvedValue(0.5);
|
|
167
|
-
mockedSetBrightness.mockReset();
|
|
168
|
-
mockedSetBrightness.mockResolvedValue(undefined);
|
|
169
|
-
mockedUseCameraPermission.mockReset();
|
|
170
|
-
mockedUseCameraPermission.mockReturnValue({
|
|
171
|
-
hasPermission: true,
|
|
172
|
-
requestPermission: vi.fn(async () => true),
|
|
173
|
-
});
|
|
174
|
-
mockedUseCameraDevice.mockReset();
|
|
175
|
-
mockedUseCameraDevice.mockReturnValue(fakeFrontDevice);
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
it("renders the capture screen container", () => {
|
|
179
|
-
const { root } = render(
|
|
180
|
-
<UseSmileIDCaptureScreen
|
|
181
|
-
analyzer={fakeAnalyzer}
|
|
182
|
-
captureType={CaptureType.selfie}
|
|
183
|
-
/>,
|
|
184
|
-
);
|
|
185
|
-
expect(findByTestID(root, "si_capture_screen")).not.toBeNull();
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
it("renders the camera preview when permission is granted", () => {
|
|
189
|
-
const { root } = render(
|
|
190
|
-
<UseSmileIDCaptureScreen
|
|
191
|
-
analyzer={fakeAnalyzer}
|
|
192
|
-
captureType={CaptureType.selfie}
|
|
193
|
-
/>,
|
|
194
|
-
);
|
|
195
|
-
const preview = findByTestID(root, "si_capture_camera_preview");
|
|
196
|
-
expect(preview).not.toBeNull();
|
|
197
|
-
// Selfie capture uses the front lens; document uses back. The
|
|
198
|
-
// screen reads its device from `useCameraDevice(facing)` so the
|
|
199
|
-
// lens choice surfaces as the hook's argument, not a `<Camera>`
|
|
200
|
-
// prop.
|
|
201
|
-
expect(mockedUseCameraDevice).toHaveBeenCalledWith("front");
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
it("uses the back lens for document captures", () => {
|
|
205
|
-
const { root } = render(
|
|
206
|
-
<UseSmileIDCaptureScreen
|
|
207
|
-
analyzer={fakeAnalyzer}
|
|
208
|
-
captureType={CaptureType.document}
|
|
209
|
-
/>,
|
|
210
|
-
);
|
|
211
|
-
const preview = findByTestID(root, "si_capture_camera_preview");
|
|
212
|
-
expect(preview).not.toBeNull();
|
|
213
|
-
expect(mockedUseCameraDevice).toHaveBeenCalledWith("back");
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
it("uses the back lens for an agent-mode selfie capture", () => {
|
|
217
|
-
const { root } = render(
|
|
218
|
-
<UseSmileIDCaptureScreen
|
|
219
|
-
analyzer={fakeAnalyzer}
|
|
220
|
-
captureType={CaptureType.selfie}
|
|
221
|
-
allowAgentMode
|
|
222
|
-
/>,
|
|
223
|
-
);
|
|
224
|
-
expect(findByTestID(root, "si_capture_camera_preview")).not.toBeNull();
|
|
225
|
-
expect(mockedUseCameraDevice).toHaveBeenCalledWith("back");
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
it("shows a placeholder (not the camera) when permission is undetermined", () => {
|
|
229
|
-
const requestPermission = vi.fn(async () => true);
|
|
230
|
-
mockedUseCameraPermission.mockReturnValue({
|
|
231
|
-
hasPermission: false,
|
|
232
|
-
requestPermission,
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
const { root } = render(
|
|
236
|
-
<UseSmileIDCaptureScreen
|
|
237
|
-
analyzer={fakeAnalyzer}
|
|
238
|
-
captureType={CaptureType.selfie}
|
|
239
|
-
/>,
|
|
240
|
-
);
|
|
241
|
-
expect(findByTestID(root, "si_capture_camera_placeholder")).not.toBeNull();
|
|
242
|
-
expect(findByTestID(root, "si_capture_camera_preview")).toBeNull();
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
it("auto-requests permission once when undetermined", () => {
|
|
246
|
-
const requestPermission = vi.fn(async () => true);
|
|
247
|
-
mockedUseCameraPermission.mockReturnValue({
|
|
248
|
-
hasPermission: false,
|
|
249
|
-
requestPermission,
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
render(
|
|
253
|
-
<UseSmileIDCaptureScreen
|
|
254
|
-
analyzer={fakeAnalyzer}
|
|
255
|
-
captureType={CaptureType.selfie}
|
|
256
|
-
/>,
|
|
257
|
-
);
|
|
258
|
-
|
|
259
|
-
expect(requestPermission).toHaveBeenCalledTimes(1);
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
it("does not re-prompt when permission is granted", () => {
|
|
263
|
-
const requestPermission = vi.fn(async () => true);
|
|
264
|
-
mockedUseCameraPermission.mockReturnValue({
|
|
265
|
-
hasPermission: true,
|
|
266
|
-
requestPermission,
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
render(
|
|
270
|
-
<UseSmileIDCaptureScreen
|
|
271
|
-
analyzer={fakeAnalyzer}
|
|
272
|
-
captureType={CaptureType.selfie}
|
|
273
|
-
/>,
|
|
274
|
-
);
|
|
275
|
-
expect(requestPermission).not.toHaveBeenCalled();
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
it("renders the start button enabled in INSTRUCTION state", () => {
|
|
279
|
-
const { root } = render(
|
|
280
|
-
<UseSmileIDCaptureScreen
|
|
281
|
-
analyzer={fakeAnalyzer}
|
|
282
|
-
captureType={CaptureType.selfie}
|
|
283
|
-
/>,
|
|
284
|
-
);
|
|
285
|
-
const start = findByTestID(root, "si_capture_start_button");
|
|
286
|
-
expect(start).not.toBeNull();
|
|
287
|
-
// INSTRUCTION is the *only* state where Start Capture renders, and
|
|
288
|
-
// it's the user's affirmative action to begin the analyzer
|
|
289
|
-
// pipeline — so it must be enabled. Disabled-during-INSTRUCTION
|
|
290
|
-
// would leave the user with no way to advance the flow.
|
|
291
|
-
expect(start!.props.enabled).toBe(true);
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
it("does not begin capture on mount — it waits for the Start tap", () => {
|
|
295
|
-
// Capture never auto-begins; the user must tap Start (parity across
|
|
296
|
-
// SDKs), so onStartCapture does not fire on mount.
|
|
297
|
-
const onStartCapture = vi.fn();
|
|
298
|
-
render(
|
|
299
|
-
<UseSmileIDCaptureScreen
|
|
300
|
-
analyzer={fakeAnalyzer}
|
|
301
|
-
captureType={CaptureType.selfie}
|
|
302
|
-
onStartCapture={onStartCapture}
|
|
303
|
-
/>,
|
|
304
|
-
);
|
|
305
|
-
expect(onStartCapture).not.toHaveBeenCalled();
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
// NOTE: the legacy `overlayState` / `captureProgress` prop-driven tests
|
|
309
|
-
// were removed in Phase 3 of the per-frame migration. The capture
|
|
310
|
-
// screen now owns its overlay state internally (derived from the
|
|
311
|
-
// analyzer's per-frame UseSmileIDScanState), so there's no external prop to
|
|
312
|
-
// pin against. Phase 4 follow-up re-authors these as analyzer-driven
|
|
313
|
-
// tests that feed synthetic UseSmileIDScanState transitions through a mock
|
|
314
|
-
// analyzer + frame stream.
|
|
315
|
-
|
|
316
|
-
it("forwards the back tap to onBack when the back button is supplied", () => {
|
|
317
|
-
const onBack = vi.fn();
|
|
318
|
-
const { root } = render(
|
|
319
|
-
<UseSmileIDCaptureScreen
|
|
320
|
-
analyzer={fakeAnalyzer}
|
|
321
|
-
captureType={CaptureType.selfie}
|
|
322
|
-
onBack={onBack}
|
|
323
|
-
/>,
|
|
324
|
-
);
|
|
325
|
-
const back = findByTestID(root, "si_capture_back_button");
|
|
326
|
-
expect(back).not.toBeNull();
|
|
327
|
-
act(() => {
|
|
328
|
-
(back!.props.onClick as () => void)();
|
|
329
|
-
});
|
|
330
|
-
expect(onBack).toHaveBeenCalledTimes(1);
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
it("omits the back button when onBack isn't supplied", () => {
|
|
334
|
-
const { root } = render(
|
|
335
|
-
<UseSmileIDCaptureScreen
|
|
336
|
-
analyzer={fakeAnalyzer}
|
|
337
|
-
captureType={CaptureType.selfie}
|
|
338
|
-
/>,
|
|
339
|
-
);
|
|
340
|
-
expect(findByTestID(root, "si_capture_back_button")).toBeNull();
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
it("forces light mode on the back button, start button, and attribution", () => {
|
|
344
|
-
const { root } = render(
|
|
345
|
-
<UseSmileIDCaptureScreen
|
|
346
|
-
analyzer={fakeAnalyzer}
|
|
347
|
-
captureType={CaptureType.selfie}
|
|
348
|
-
onBack={() => {}}
|
|
349
|
-
/>,
|
|
350
|
-
);
|
|
351
|
-
expect(
|
|
352
|
-
findByTestID(root, "si_capture_back_button")!.props.forceLightMode,
|
|
353
|
-
).toBe(true);
|
|
354
|
-
expect(
|
|
355
|
-
findByTestID(root, "si_capture_start_button")!.props.forceLightMode,
|
|
356
|
-
).toBe(true);
|
|
357
|
-
// Attribution renders the SVG with accessibilityLabel "Powered by Smile ID".
|
|
358
|
-
expect(
|
|
359
|
-
root.findAllByProps({ accessibilityLabel: "Powered by Smile ID" })[0],
|
|
360
|
-
).toBeTruthy();
|
|
361
|
-
});
|
|
362
|
-
|
|
363
|
-
// Removed in Phase 3 — feedback text is now driven by the analyzer's
|
|
364
|
-
// UseSmileIDScanState rather than a partner-supplied overlayState prop. Phase 4
|
|
365
|
-
// re-authors this against a mock analyzer that yields a synthetic
|
|
366
|
-
// "found + feedback=si_capture_low_light" result through the
|
|
367
|
-
// frame stream.
|
|
368
|
-
|
|
369
|
-
it("hides attribution when showAttribution is false", () => {
|
|
370
|
-
const { root } = render(
|
|
371
|
-
<UseSmileIDCaptureScreen
|
|
372
|
-
analyzer={fakeAnalyzer}
|
|
373
|
-
captureType={CaptureType.selfie}
|
|
374
|
-
showAttribution={false}
|
|
375
|
-
/>,
|
|
376
|
-
);
|
|
377
|
-
expect(
|
|
378
|
-
root.findAllByProps({ accessibilityLabel: "Powered by Smile ID" }),
|
|
379
|
-
).toHaveLength(0);
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
it("forwards onStartCapture from a slot button tapped during INSTRUCTION", () => {
|
|
383
|
-
// The Start Capture button begins the analyzer pipeline. During
|
|
384
|
-
// INSTRUCTION (the only state where the slot renders), tapping
|
|
385
|
-
// the partner-supplied control must forward through to
|
|
386
|
-
// `onStartCapture` so the orchestrator can advance the flow.
|
|
387
|
-
const onStartCapture = vi.fn();
|
|
388
|
-
const { root } = render(
|
|
389
|
-
<UseSmileIDCaptureScreen
|
|
390
|
-
analyzer={fakeAnalyzer}
|
|
391
|
-
captureType={CaptureType.selfie}
|
|
392
|
-
onStartCapture={onStartCapture}
|
|
393
|
-
startButton={({ onClick }) => (
|
|
394
|
-
<Pressable testID="si_custom_start" onPress={onClick}>
|
|
395
|
-
<Text>Go</Text>
|
|
396
|
-
</Pressable>
|
|
397
|
-
)}
|
|
398
|
-
/>,
|
|
399
|
-
);
|
|
400
|
-
|
|
401
|
-
act(() => {
|
|
402
|
-
(findByTestID(root, "si_custom_start")!.props.onPress as () => void)();
|
|
403
|
-
});
|
|
404
|
-
expect(onStartCapture).toHaveBeenCalledTimes(1);
|
|
405
|
-
});
|
|
406
|
-
|
|
407
|
-
it("renders a partner-supplied start button slot in INSTRUCTION state", () => {
|
|
408
|
-
const onStartCapture = vi.fn();
|
|
409
|
-
const { root } = render(
|
|
410
|
-
<UseSmileIDCaptureScreen
|
|
411
|
-
analyzer={fakeAnalyzer}
|
|
412
|
-
captureType={CaptureType.selfie}
|
|
413
|
-
onStartCapture={onStartCapture}
|
|
414
|
-
startButton={({ onClick, enabled }) => (
|
|
415
|
-
<Pressable
|
|
416
|
-
testID="si_custom_start"
|
|
417
|
-
onPress={onClick}
|
|
418
|
-
accessibilityState={{ disabled: !enabled }}
|
|
419
|
-
>
|
|
420
|
-
<Text>Go</Text>
|
|
421
|
-
</Pressable>
|
|
422
|
-
)}
|
|
423
|
-
/>,
|
|
424
|
-
);
|
|
425
|
-
const slot = findByTestID(root, "si_custom_start");
|
|
426
|
-
expect(slot).not.toBeNull();
|
|
427
|
-
// Slot only renders during INSTRUCTION, where the analyzer
|
|
428
|
-
// hasn't started yet — `enabled` propagates as true.
|
|
429
|
-
expect(slot!.props.accessibilityState.disabled).toBe(false);
|
|
430
|
-
// Default start button must NOT also render — concrete scenario:
|
|
431
|
-
// a future refactor that double-renders both would silently stack.
|
|
432
|
-
expect(findByTestID(root, "si_capture_start_button")).toBeNull();
|
|
433
|
-
});
|
|
434
|
-
|
|
435
|
-
it("primes the guidance with the standard instruction before the first frame", () => {
|
|
436
|
-
const { root } = render(
|
|
437
|
-
<UseSmileIDCaptureScreen
|
|
438
|
-
analyzer={fakeAnalyzer}
|
|
439
|
-
captureType={CaptureType.selfie}
|
|
440
|
-
/>,
|
|
441
|
-
);
|
|
442
|
-
const text = findByTestID(root, "si_capture_feedback_text");
|
|
443
|
-
// Pre-capture shows the press-Start instruction — the visible
|
|
444
|
-
// Start Capture button is the next action.
|
|
445
|
-
expect(collectText(text!)).toBe(enStrings.si_start_capture_instruction);
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
it("primes the guidance with the press-Start copy under Enhanced Smart Selfie too", () => {
|
|
449
|
-
// The ESS head-turn primer belongs to the scanning Initial state;
|
|
450
|
-
// pre-capture shows the press-Start instruction in both modes.
|
|
451
|
-
const { root } = render(
|
|
452
|
-
<UseSmileIDCaptureScreen
|
|
453
|
-
analyzer={fakeAnalyzer}
|
|
454
|
-
captureType={CaptureType.selfie}
|
|
455
|
-
enableEnhancedLiveness
|
|
456
|
-
/>,
|
|
457
|
-
);
|
|
458
|
-
const text = findByTestID(root, "si_capture_feedback_text");
|
|
459
|
-
expect(collectText(text!)).toBe(enStrings.si_start_capture_instruction);
|
|
460
|
-
});
|
|
461
|
-
|
|
462
|
-
it("engages the brightness hook on mount", async () => {
|
|
463
|
-
render(
|
|
464
|
-
<UseSmileIDCaptureScreen
|
|
465
|
-
analyzer={fakeAnalyzer}
|
|
466
|
-
captureType={CaptureType.selfie}
|
|
467
|
-
/>,
|
|
468
|
-
);
|
|
469
|
-
// The hook awaits getBrightness before issuing setBrightness.
|
|
470
|
-
// Two microtask flushes drain the chain.
|
|
471
|
-
await act(async () => {
|
|
472
|
-
await Promise.resolve();
|
|
473
|
-
await Promise.resolve();
|
|
474
|
-
});
|
|
475
|
-
expect(mockedGetBrightness).toHaveBeenCalledTimes(1);
|
|
476
|
-
expect(mockedSetBrightness).toHaveBeenCalledWith(1);
|
|
477
|
-
});
|
|
478
|
-
|
|
479
|
-
it("asks for dark status-bar content, matching the white capture scrim", () => {
|
|
480
|
-
const { root } = render(
|
|
481
|
-
<UseSmileIDCaptureScreen
|
|
482
|
-
analyzer={fakeAnalyzer}
|
|
483
|
-
captureType={CaptureType.selfie}
|
|
484
|
-
/>,
|
|
485
|
-
);
|
|
486
|
-
expect(root.findAllByType(StatusBar)[0]!.props.barStyle).toBe(
|
|
487
|
-
"dark-content",
|
|
488
|
-
);
|
|
489
|
-
});
|
|
490
|
-
|
|
491
|
-
it("renders a translucent status bar so the preview is edge-to-edge", () => {
|
|
492
|
-
// Translucent status bar = full-bleed window = full-screen oval reference.
|
|
493
|
-
const { root } = render(
|
|
494
|
-
<UseSmileIDCaptureScreen
|
|
495
|
-
analyzer={fakeAnalyzer}
|
|
496
|
-
captureType={CaptureType.selfie}
|
|
497
|
-
/>,
|
|
498
|
-
);
|
|
499
|
-
const statusBar = root.findAllByType(StatusBar)[0];
|
|
500
|
-
expect(statusBar).toBeTruthy();
|
|
501
|
-
expect(statusBar!.props.translucent).toBe(true);
|
|
502
|
-
});
|
|
503
|
-
|
|
504
|
-
it("drops capture events accumulated before an unsatisfied reset", async () => {
|
|
505
|
-
// Regression: events accumulated before an `unsatisfied` reset are stale
|
|
506
|
-
// and must not reach the submission set — only post-reset events should.
|
|
507
|
-
const onCaptureComplete = vi.fn();
|
|
508
|
-
let resolveFlush!: () => void;
|
|
509
|
-
const analyzer = makeFakeAnalyzer();
|
|
510
|
-
// flush() gates onCaptureComplete; resolve it manually to control timing.
|
|
511
|
-
vi.mocked(analyzer.flush).mockReturnValue(
|
|
512
|
-
new Promise<void>((resolve) => {
|
|
513
|
-
resolveFlush = resolve;
|
|
514
|
-
}),
|
|
515
|
-
);
|
|
516
|
-
|
|
517
|
-
// Reset so the assertion below proves THIS render registered the
|
|
518
|
-
// callback, not a leftover from an earlier test.
|
|
519
|
-
capturedOnResult = null;
|
|
520
|
-
render(
|
|
521
|
-
<UseSmileIDCaptureScreen
|
|
522
|
-
analyzer={analyzer}
|
|
523
|
-
captureType={CaptureType.selfie}
|
|
524
|
-
onCaptureComplete={onCaptureComplete}
|
|
525
|
-
/>,
|
|
526
|
-
);
|
|
527
|
-
expect(capturedOnResult).not.toBeNull();
|
|
528
|
-
const emit = (result: FaceScanResult) => {
|
|
529
|
-
act(() => {
|
|
530
|
-
capturedOnResult!(result);
|
|
531
|
-
});
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
const output = { faces: [], brightness: 0 };
|
|
535
|
-
const event = (
|
|
536
|
-
kind: CaptureReadyEvent["kind"],
|
|
537
|
-
captureIndex: number,
|
|
538
|
-
): CaptureReadyEvent => ({
|
|
539
|
-
kind,
|
|
540
|
-
captureIndex,
|
|
541
|
-
url: `file://${kind}-${captureIndex}`,
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
const staleSelfie = event(CaptureReadyEventKind.Selfie, 0);
|
|
545
|
-
const staleLiveness = event(CaptureReadyEventKind.Liveness, 0);
|
|
546
|
-
const freshSelfie = event(CaptureReadyEventKind.Selfie, 1);
|
|
547
|
-
const freshLiveness = event(CaptureReadyEventKind.Liveness, 1);
|
|
548
|
-
|
|
549
|
-
// Stale events → unsatisfied reset (drops them) → fresh events → finished.
|
|
550
|
-
emit({
|
|
551
|
-
output,
|
|
552
|
-
state: { type: UseSmileIDScanStateType.Found },
|
|
553
|
-
capturedEvents: [staleSelfie, staleLiveness],
|
|
554
|
-
});
|
|
555
|
-
emit({
|
|
556
|
-
output,
|
|
557
|
-
state: { type: UseSmileIDScanStateType.Unsatisfied },
|
|
558
|
-
capturedEvents: [],
|
|
559
|
-
});
|
|
560
|
-
emit({
|
|
561
|
-
output,
|
|
562
|
-
state: { type: UseSmileIDScanStateType.Found },
|
|
563
|
-
capturedEvents: [freshSelfie, freshLiveness],
|
|
564
|
-
});
|
|
565
|
-
emit({
|
|
566
|
-
output,
|
|
567
|
-
state: { type: UseSmileIDScanStateType.Finished },
|
|
568
|
-
capturedEvents: [],
|
|
569
|
-
});
|
|
570
|
-
|
|
571
|
-
await act(async () => {
|
|
572
|
-
resolveFlush();
|
|
573
|
-
await Promise.resolve();
|
|
574
|
-
await Promise.resolve();
|
|
575
|
-
});
|
|
576
|
-
|
|
577
|
-
expect(onCaptureComplete).toHaveBeenCalledTimes(1);
|
|
578
|
-
// Only the post-reset events survive — the stale ones were cleared.
|
|
579
|
-
// The capture telemetry (duration + retries) travels as a second argument;
|
|
580
|
-
// the retry count reflects the one unsatisfied reset observed above.
|
|
581
|
-
expect(onCaptureComplete).toHaveBeenCalledWith(
|
|
582
|
-
[freshSelfie, freshLiveness],
|
|
583
|
-
expect.objectContaining({ retries: 1 }),
|
|
584
|
-
);
|
|
585
|
-
});
|
|
586
|
-
|
|
587
|
-
it("replays the shared selfie scenario to a full capture completion", async () => {
|
|
588
|
-
// Drives the capture gap headlessly through the frame stream's onResult
|
|
589
|
-
// seam: the shared scenario replayed to `finished` must reach
|
|
590
|
-
// onCaptureComplete with the scripted selfie + liveness events.
|
|
591
|
-
const onCaptureComplete = vi.fn();
|
|
592
|
-
const analyzer = makeFakeAnalyzer();
|
|
593
|
-
capturedOnResult = null;
|
|
594
|
-
render(
|
|
595
|
-
<UseSmileIDCaptureScreen
|
|
596
|
-
analyzer={analyzer}
|
|
597
|
-
captureType={CaptureType.selfie}
|
|
598
|
-
onCaptureComplete={onCaptureComplete}
|
|
599
|
-
/>,
|
|
600
|
-
);
|
|
601
|
-
expect(capturedOnResult).not.toBeNull();
|
|
602
|
-
|
|
603
|
-
// Consume the real shared scenario (not a hand-written copy) so a drift in
|
|
604
|
-
// the canonical script is caught here rather than silently diverging.
|
|
605
|
-
const scenarioDir = dirname(import.meta.url.replace(/^file:\/\//, ""));
|
|
606
|
-
const scenario = parseScriptedScenario(
|
|
607
|
-
JSON.parse(
|
|
608
|
-
readFileSync(
|
|
609
|
-
join(
|
|
610
|
-
scenarioDir,
|
|
611
|
-
"../../../../../e2e/scenarios/selfie-happy-path.json",
|
|
612
|
-
),
|
|
613
|
-
"utf8",
|
|
614
|
-
),
|
|
615
|
-
),
|
|
616
|
-
);
|
|
617
|
-
for (const result of scriptedFaceScanResults(scenario, {
|
|
618
|
-
livenessCount: 2,
|
|
619
|
-
})) {
|
|
620
|
-
act(() => {
|
|
621
|
-
capturedOnResult!(result);
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
await act(async () => {
|
|
625
|
-
await Promise.resolve();
|
|
626
|
-
await Promise.resolve();
|
|
627
|
-
});
|
|
628
|
-
|
|
629
|
-
expect(onCaptureComplete).toHaveBeenCalledTimes(1);
|
|
630
|
-
const events = onCaptureComplete.mock.calls[0][0] as CaptureReadyEvent[];
|
|
631
|
-
expect(
|
|
632
|
-
events.filter((e) => e.kind === CaptureReadyEventKind.Selfie),
|
|
633
|
-
).toHaveLength(1);
|
|
634
|
-
expect(
|
|
635
|
-
events.filter((e) => e.kind === CaptureReadyEventKind.Liveness),
|
|
636
|
-
).toHaveLength(2);
|
|
637
|
-
});
|
|
638
|
-
});
|
|
639
|
-
|
|
640
|
-
/**
|
|
641
|
-
* Session-boundary debouncer regression, exercised on
|
|
642
|
-
* `UseSmileIDFeedbackDebouncer` directly because the route harness
|
|
643
|
-
* cannot drive multi-step scan-state sequences. Mirrors the capture
|
|
644
|
-
* screen's frame-result callback: `isSessionBoundary` decides when to
|
|
645
|
-
* `reset()` + `seed()`.
|
|
646
|
-
*/
|
|
647
|
-
describe("session-boundary epoch reset — debouncer regression", () => {
|
|
648
|
-
beforeEach(() => {
|
|
649
|
-
vi.useFakeTimers();
|
|
650
|
-
});
|
|
651
|
-
afterEach(() => {
|
|
652
|
-
vi.useRealTimers();
|
|
653
|
-
});
|
|
654
|
-
|
|
655
|
-
it("re-emits the smile key after an unsatisfied reset clears the debouncer", () => {
|
|
656
|
-
const emitted: string[] = [];
|
|
657
|
-
const debouncer = new UseSmileIDFeedbackDebouncer<string>({
|
|
658
|
-
emit: (value) => emitted.push(value),
|
|
659
|
-
delayMs: UseSmileIDMotion.feedbackDebounce,
|
|
660
|
-
isImmediate: () => false,
|
|
661
|
-
});
|
|
662
|
-
|
|
663
|
-
let previousScanState: UseSmileIDScanState | null = null;
|
|
664
|
-
const processTransition = (
|
|
665
|
-
nextScanState: UseSmileIDScanState,
|
|
666
|
-
nextFeedbackKey: string,
|
|
667
|
-
) => {
|
|
668
|
-
const boundary =
|
|
669
|
-
previousScanState !== null &&
|
|
670
|
-
isSessionBoundary(previousScanState, nextScanState);
|
|
671
|
-
previousScanState = nextScanState;
|
|
672
|
-
if (boundary) {
|
|
673
|
-
debouncer.reset();
|
|
674
|
-
debouncer.seed(nextFeedbackKey);
|
|
675
|
-
} else {
|
|
676
|
-
debouncer.publish(nextFeedbackKey);
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
// found — smile key settles after the debounce window.
|
|
681
|
-
processTransition(
|
|
682
|
-
{ type: UseSmileIDScanStateType.Found, feedback: "si_capture_smile" },
|
|
683
|
-
"si_capture_smile",
|
|
684
|
-
);
|
|
685
|
-
vi.advanceTimersByTime(UseSmileIDMotion.feedbackDebounce);
|
|
686
|
-
expect(emitted).toEqual(["si_capture_smile"]);
|
|
687
|
-
|
|
688
|
-
// Entering unsatisfied is not a boundary — no reset.
|
|
689
|
-
processTransition(
|
|
690
|
-
{ type: UseSmileIDScanStateType.Unsatisfied },
|
|
691
|
-
"si_selfie_capture_unsatisfied",
|
|
692
|
-
);
|
|
693
|
-
vi.advanceTimersByTime(UseSmileIDMotion.feedbackDebounce);
|
|
694
|
-
expect(emitted).toEqual([
|
|
695
|
-
"si_capture_smile",
|
|
696
|
-
"si_selfie_capture_unsatisfied",
|
|
697
|
-
]);
|
|
698
|
-
|
|
699
|
-
// Leaving unsatisfied is a boundary — without the reset the repeated
|
|
700
|
-
// smile key would be suppressed as a duplicate.
|
|
701
|
-
processTransition(
|
|
702
|
-
{ type: UseSmileIDScanStateType.Found, feedback: "si_capture_smile" },
|
|
703
|
-
"si_capture_smile",
|
|
704
|
-
);
|
|
705
|
-
// seed() emits synchronously; no timer advance needed.
|
|
706
|
-
expect(emitted).toEqual([
|
|
707
|
-
"si_capture_smile",
|
|
708
|
-
"si_selfie_capture_unsatisfied",
|
|
709
|
-
"si_capture_smile",
|
|
710
|
-
]);
|
|
711
|
-
});
|
|
712
|
-
|
|
713
|
-
// Document capture has no Start button, so a scan timeout has to leave the
|
|
714
|
-
// user a way forward — the sibling SDKs surface the manual shutter as the
|
|
715
|
-
// recovery affordance (their shared scan state sets `showCaptureButton` on
|
|
716
|
-
// the timeout state). Without these, a timed-out flow is a dead end: only
|
|
717
|
-
// Back and ✕ remain.
|
|
718
|
-
describe("document capture timeout recovery", () => {
|
|
719
|
-
function renderDocumentScreen(props: {
|
|
720
|
-
readonly captureMode: ReturnType<typeof DocumentCaptureMode.AutoCapture>;
|
|
721
|
-
readonly allowGalleryUpload?: boolean;
|
|
722
|
-
}) {
|
|
723
|
-
const tree = render(
|
|
724
|
-
<UseSmileIDCaptureScreen
|
|
725
|
-
analyzer={fakeAnalyzer}
|
|
726
|
-
captureType={CaptureType.document}
|
|
727
|
-
captureMode={props.captureMode}
|
|
728
|
-
allowGalleryUpload={props.allowGalleryUpload ?? true}
|
|
729
|
-
/>,
|
|
730
|
-
);
|
|
731
|
-
// The overlay and its controls only mount once the canvas is measured;
|
|
732
|
-
// `onLayout` never fires under the test renderer, so drive it (landscape,
|
|
733
|
-
// as a document capture screen is).
|
|
734
|
-
act(() => {
|
|
735
|
-
findByTestID(tree.root, "si_capture_screen")!.props.onLayout({
|
|
736
|
-
nativeEvent: { layout: { width: 800, height: 400 } },
|
|
737
|
-
});
|
|
738
|
-
});
|
|
739
|
-
return tree;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
function emitTimeout() {
|
|
743
|
-
expect(capturedOnResult).not.toBeNull();
|
|
744
|
-
act(() => {
|
|
745
|
-
capturedOnResult!({
|
|
746
|
-
output: { faces: [], brightness: 0 },
|
|
747
|
-
state: { type: UseSmileIDScanStateType.Timeout },
|
|
748
|
-
capturedEvents: [],
|
|
749
|
-
});
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
it("offers the manual shutter after a timeout, in every capture mode", () => {
|
|
754
|
-
const { root } = renderDocumentScreen({
|
|
755
|
-
captureMode: DocumentCaptureMode.AutoCapture,
|
|
756
|
-
});
|
|
757
|
-
|
|
758
|
-
emitTimeout();
|
|
759
|
-
|
|
760
|
-
expect(findByTestID(root, "si_document_manual_shutter")).not.toBeNull();
|
|
761
|
-
});
|
|
762
|
-
|
|
763
|
-
it("keeps the gallery button available after a timeout", () => {
|
|
764
|
-
const { root } = renderDocumentScreen({
|
|
765
|
-
captureMode: DocumentCaptureMode.AutoCaptureWithManualFallback({
|
|
766
|
-
activateManualAfterMs: 3000,
|
|
767
|
-
}),
|
|
768
|
-
});
|
|
769
|
-
|
|
770
|
-
emitTimeout();
|
|
771
|
-
|
|
772
|
-
expect(findByTestID(root, "si_document_gallery_upload")).not.toBeNull();
|
|
773
|
-
});
|
|
774
|
-
|
|
775
|
-
it("leaves the manual shutter usable after a timeout", () => {
|
|
776
|
-
const { root } = renderDocumentScreen({
|
|
777
|
-
captureMode: DocumentCaptureMode.ManualCapture,
|
|
778
|
-
});
|
|
779
|
-
|
|
780
|
-
emitTimeout();
|
|
781
|
-
|
|
782
|
-
const shutter = findByTestID(root, "si_document_manual_shutter");
|
|
783
|
-
expect(shutter).not.toBeNull();
|
|
784
|
-
// The timeout must not latch the one-shot delivery gate, or the button
|
|
785
|
-
// renders but does nothing.
|
|
786
|
-
act(() => {
|
|
787
|
-
shutter!.props.onPress();
|
|
788
|
-
});
|
|
789
|
-
expect(mockedTakePhoto).toHaveBeenCalledTimes(1);
|
|
790
|
-
});
|
|
791
|
-
});
|
|
792
|
-
|
|
793
|
-
describe("selfie capture timeout recovery", () => {
|
|
794
|
-
function renderSelfieScreen() {
|
|
795
|
-
return render(
|
|
796
|
-
<UseSmileIDCaptureScreen
|
|
797
|
-
analyzer={fakeAnalyzer}
|
|
798
|
-
captureType={CaptureType.selfie}
|
|
799
|
-
/>,
|
|
800
|
-
);
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
function startCapture(root: ReactTestInstance) {
|
|
804
|
-
act(() => {
|
|
805
|
-
findByTestID(root, "si_capture_start_button")!.props.onClick();
|
|
806
|
-
});
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
function emit(state: UseSmileIDScanState) {
|
|
810
|
-
expect(capturedOnResult).not.toBeNull();
|
|
811
|
-
act(() => {
|
|
812
|
-
capturedOnResult!({
|
|
813
|
-
output: { faces: [], brightness: 0 },
|
|
814
|
-
state,
|
|
815
|
-
capturedEvents: [],
|
|
816
|
-
});
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
it("offers Start again after a timeout", () => {
|
|
821
|
-
const { root } = renderSelfieScreen();
|
|
822
|
-
startCapture(root);
|
|
823
|
-
|
|
824
|
-
emit({ type: UseSmileIDScanStateType.Timeout });
|
|
825
|
-
|
|
826
|
-
const start = findByTestID(root, "si_capture_start_button");
|
|
827
|
-
expect(start).not.toBeNull();
|
|
828
|
-
expect(start!.props.enabled).toBe(true);
|
|
829
|
-
});
|
|
830
|
-
|
|
831
|
-
it("resets the native session when Start is tapped after a timeout", async () => {
|
|
832
|
-
const { root } = renderSelfieScreen();
|
|
833
|
-
startCapture(root);
|
|
834
|
-
emit({ type: UseSmileIDScanStateType.Timeout });
|
|
835
|
-
fakeAnalyzer.reset.mockClear();
|
|
836
|
-
|
|
837
|
-
startCapture(root);
|
|
838
|
-
await act(async () => {
|
|
839
|
-
await Promise.resolve();
|
|
840
|
-
});
|
|
841
|
-
|
|
842
|
-
// The native session is terminal after a timeout — without a reset the
|
|
843
|
-
// first retry frame re-reports Timeout and re-latches the error.
|
|
844
|
-
expect(fakeAnalyzer.reset).toHaveBeenCalledTimes(1);
|
|
845
|
-
});
|
|
846
|
-
|
|
847
|
-
it("restarts the session when Start is tapped after a timeout", () => {
|
|
848
|
-
const onStartCapture = vi.fn();
|
|
849
|
-
const { root } = render(
|
|
850
|
-
<UseSmileIDCaptureScreen
|
|
851
|
-
analyzer={fakeAnalyzer}
|
|
852
|
-
captureType={CaptureType.selfie}
|
|
853
|
-
onStartCapture={onStartCapture}
|
|
854
|
-
/>,
|
|
855
|
-
);
|
|
856
|
-
startCapture(root);
|
|
857
|
-
emit({ type: UseSmileIDScanStateType.Timeout });
|
|
858
|
-
|
|
859
|
-
startCapture(root);
|
|
860
|
-
|
|
861
|
-
expect(onStartCapture).toHaveBeenCalledTimes(2);
|
|
862
|
-
});
|
|
863
|
-
|
|
864
|
-
it("still delivers a capture that completes on the retry", async () => {
|
|
865
|
-
const onCaptureComplete = vi.fn();
|
|
866
|
-
const { root } = render(
|
|
867
|
-
<UseSmileIDCaptureScreen
|
|
868
|
-
analyzer={fakeAnalyzer}
|
|
869
|
-
captureType={CaptureType.selfie}
|
|
870
|
-
onCaptureComplete={onCaptureComplete}
|
|
871
|
-
/>,
|
|
872
|
-
);
|
|
873
|
-
startCapture(root);
|
|
874
|
-
emit({ type: UseSmileIDScanStateType.Timeout });
|
|
875
|
-
startCapture(root);
|
|
876
|
-
|
|
877
|
-
emit({ type: UseSmileIDScanStateType.Finished });
|
|
878
|
-
await act(async () => {
|
|
879
|
-
await Promise.resolve();
|
|
880
|
-
await Promise.resolve();
|
|
881
|
-
});
|
|
882
|
-
|
|
883
|
-
expect(onCaptureComplete).toHaveBeenCalledTimes(1);
|
|
884
|
-
});
|
|
885
|
-
|
|
886
|
-
it("drops a capture that lands after the timeout was already reported", async () => {
|
|
887
|
-
const onCaptureComplete = vi.fn();
|
|
888
|
-
const onCaptureTimeout = vi.fn();
|
|
889
|
-
const { root } = render(
|
|
890
|
-
<UseSmileIDCaptureScreen
|
|
891
|
-
analyzer={fakeAnalyzer}
|
|
892
|
-
captureType={CaptureType.selfie}
|
|
893
|
-
onCaptureComplete={onCaptureComplete}
|
|
894
|
-
onCaptureTimeout={onCaptureTimeout}
|
|
895
|
-
/>,
|
|
896
|
-
);
|
|
897
|
-
startCapture(root);
|
|
898
|
-
|
|
899
|
-
emit({ type: UseSmileIDScanStateType.Timeout });
|
|
900
|
-
emit({ type: UseSmileIDScanStateType.Finished });
|
|
901
|
-
await act(async () => {
|
|
902
|
-
await Promise.resolve();
|
|
903
|
-
await Promise.resolve();
|
|
904
|
-
});
|
|
905
|
-
|
|
906
|
-
expect(onCaptureTimeout).toHaveBeenCalledTimes(1);
|
|
907
|
-
expect(onCaptureComplete).not.toHaveBeenCalled();
|
|
908
|
-
});
|
|
909
|
-
|
|
910
|
-
it("does not pad the retry with frames banked before the timeout", async () => {
|
|
911
|
-
const onCaptureComplete = vi.fn();
|
|
912
|
-
const { root } = render(
|
|
913
|
-
<UseSmileIDCaptureScreen
|
|
914
|
-
analyzer={fakeAnalyzer}
|
|
915
|
-
captureType={CaptureType.selfie}
|
|
916
|
-
onCaptureComplete={onCaptureComplete}
|
|
917
|
-
/>,
|
|
918
|
-
);
|
|
919
|
-
startCapture(root);
|
|
920
|
-
act(() => {
|
|
921
|
-
capturedOnResult!({
|
|
922
|
-
output: { faces: [], brightness: 0 },
|
|
923
|
-
state: { type: UseSmileIDScanStateType.Found },
|
|
924
|
-
capturedEvents: [
|
|
925
|
-
{
|
|
926
|
-
kind: CaptureReadyEventKind.Liveness,
|
|
927
|
-
captureIndex: 0,
|
|
928
|
-
url: "file:///stale.jpg",
|
|
929
|
-
},
|
|
930
|
-
] as CaptureReadyEvent[],
|
|
931
|
-
});
|
|
932
|
-
});
|
|
933
|
-
emit({ type: UseSmileIDScanStateType.Timeout });
|
|
934
|
-
|
|
935
|
-
startCapture(root);
|
|
936
|
-
act(() => {
|
|
937
|
-
capturedOnResult!({
|
|
938
|
-
output: { faces: [], brightness: 0 },
|
|
939
|
-
state: { type: UseSmileIDScanStateType.Found },
|
|
940
|
-
capturedEvents: [
|
|
941
|
-
{
|
|
942
|
-
kind: CaptureReadyEventKind.Selfie,
|
|
943
|
-
captureIndex: 0,
|
|
944
|
-
url: "file:///fresh.jpg",
|
|
945
|
-
},
|
|
946
|
-
] as CaptureReadyEvent[],
|
|
947
|
-
});
|
|
948
|
-
});
|
|
949
|
-
emit({ type: UseSmileIDScanStateType.Finished });
|
|
950
|
-
await act(async () => {
|
|
951
|
-
await Promise.resolve();
|
|
952
|
-
await Promise.resolve();
|
|
953
|
-
});
|
|
954
|
-
|
|
955
|
-
expect(onCaptureComplete).toHaveBeenCalledTimes(1);
|
|
956
|
-
const [delivered] = onCaptureComplete.mock.calls[0] as [
|
|
957
|
-
readonly CaptureReadyEvent[],
|
|
958
|
-
];
|
|
959
|
-
expect(delivered.map((event) => event.url)).toEqual([
|
|
960
|
-
"file:///fresh.jpg",
|
|
961
|
-
]);
|
|
962
|
-
});
|
|
963
|
-
|
|
964
|
-
it("reports the timeout to the partner exactly once", () => {
|
|
965
|
-
const onCaptureTimeout = vi.fn();
|
|
966
|
-
const { root } = render(
|
|
967
|
-
<UseSmileIDCaptureScreen
|
|
968
|
-
analyzer={fakeAnalyzer}
|
|
969
|
-
captureType={CaptureType.selfie}
|
|
970
|
-
onCaptureTimeout={onCaptureTimeout}
|
|
971
|
-
/>,
|
|
972
|
-
);
|
|
973
|
-
startCapture(root);
|
|
974
|
-
|
|
975
|
-
emit({ type: UseSmileIDScanStateType.Timeout });
|
|
976
|
-
emit({ type: UseSmileIDScanStateType.Timeout });
|
|
977
|
-
|
|
978
|
-
expect(onCaptureTimeout).toHaveBeenCalledTimes(1);
|
|
979
|
-
});
|
|
980
|
-
});
|
|
981
|
-
|
|
982
|
-
describe("no camera frames at all", () => {
|
|
983
|
-
beforeEach(() => {
|
|
984
|
-
vi.useFakeTimers();
|
|
985
|
-
});
|
|
986
|
-
|
|
987
|
-
afterEach(() => {
|
|
988
|
-
vi.useRealTimers();
|
|
989
|
-
});
|
|
990
|
-
|
|
991
|
-
function renderAndStart() {
|
|
992
|
-
const tree = render(
|
|
993
|
-
<UseSmileIDCaptureScreen
|
|
994
|
-
analyzer={fakeAnalyzer}
|
|
995
|
-
captureType={CaptureType.selfie}
|
|
996
|
-
/>,
|
|
997
|
-
);
|
|
998
|
-
act(() => {
|
|
999
|
-
findByTestID(tree.root, "si_capture_start_button")!.props.onClick();
|
|
1000
|
-
});
|
|
1001
|
-
return tree;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
function elapseFirstFrameWait() {
|
|
1005
|
-
act(() => {
|
|
1006
|
-
vi.advanceTimersByTime(10_000);
|
|
1007
|
-
});
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
it("names the cause instead of sitting on the initial instruction", () => {
|
|
1011
|
-
const { root } = renderAndStart();
|
|
1012
|
-
|
|
1013
|
-
elapseFirstFrameWait();
|
|
1014
|
-
|
|
1015
|
-
expect(collectText(findByTestID(root, "si_capture_feedback_text")!)).toBe(
|
|
1016
|
-
enStrings.si_capture_camera_unavailable,
|
|
1017
|
-
);
|
|
1018
|
-
});
|
|
1019
|
-
|
|
1020
|
-
it("leaves the user a way to retry", () => {
|
|
1021
|
-
const { root } = renderAndStart();
|
|
1022
|
-
|
|
1023
|
-
elapseFirstFrameWait();
|
|
1024
|
-
|
|
1025
|
-
const start = findByTestID(root, "si_capture_start_button");
|
|
1026
|
-
expect(start).not.toBeNull();
|
|
1027
|
-
expect(start!.props.enabled).toBe(true);
|
|
1028
|
-
});
|
|
1029
|
-
|
|
1030
|
-
it("reports a terminal timeout so the flow is not left waiting", () => {
|
|
1031
|
-
const onCaptureTimeout = vi.fn();
|
|
1032
|
-
const tree = render(
|
|
1033
|
-
<UseSmileIDCaptureScreen
|
|
1034
|
-
analyzer={fakeAnalyzer}
|
|
1035
|
-
captureType={CaptureType.selfie}
|
|
1036
|
-
onCaptureTimeout={onCaptureTimeout}
|
|
1037
|
-
/>,
|
|
1038
|
-
);
|
|
1039
|
-
act(() => {
|
|
1040
|
-
findByTestID(tree.root, "si_capture_start_button")!.props.onClick();
|
|
1041
|
-
});
|
|
1042
|
-
|
|
1043
|
-
elapseFirstFrameWait();
|
|
1044
|
-
|
|
1045
|
-
expect(onCaptureTimeout).toHaveBeenCalledTimes(1);
|
|
1046
|
-
});
|
|
1047
|
-
|
|
1048
|
-
it("drops the stall copy once a frame finally arrives", () => {
|
|
1049
|
-
const { root } = renderAndStart();
|
|
1050
|
-
elapseFirstFrameWait();
|
|
1051
|
-
expect(collectText(findByTestID(root, "si_capture_feedback_text")!)).toBe(
|
|
1052
|
-
enStrings.si_capture_camera_unavailable,
|
|
1053
|
-
);
|
|
1054
|
-
|
|
1055
|
-
act(() => {
|
|
1056
|
-
capturedOnResult!({
|
|
1057
|
-
output: { faces: [], brightness: 0 },
|
|
1058
|
-
state: { type: UseSmileIDScanStateType.Initial },
|
|
1059
|
-
capturedEvents: [],
|
|
1060
|
-
});
|
|
1061
|
-
});
|
|
1062
|
-
|
|
1063
|
-
expect(
|
|
1064
|
-
collectText(findByTestID(root, "si_capture_feedback_text")!),
|
|
1065
|
-
).not.toBe(enStrings.si_capture_camera_unavailable);
|
|
1066
|
-
});
|
|
1067
|
-
|
|
1068
|
-
it("still fires when the partner passes an inline callback", () => {
|
|
1069
|
-
const onCaptureTimeout = vi.fn();
|
|
1070
|
-
const screen = (
|
|
1071
|
-
<UseSmileIDCaptureScreen
|
|
1072
|
-
analyzer={fakeAnalyzer}
|
|
1073
|
-
captureType={CaptureType.selfie}
|
|
1074
|
-
onCaptureTimeout={(state) => onCaptureTimeout(state)}
|
|
1075
|
-
/>
|
|
1076
|
-
);
|
|
1077
|
-
const tree = render(screen);
|
|
1078
|
-
act(() => {
|
|
1079
|
-
findByTestID(tree.root, "si_capture_start_button")!.props.onClick();
|
|
1080
|
-
});
|
|
1081
|
-
|
|
1082
|
-
for (let step = 0; step < 4; step += 1) {
|
|
1083
|
-
act(() => {
|
|
1084
|
-
tree.update(
|
|
1085
|
-
<UseSmileIDCaptureScreen
|
|
1086
|
-
analyzer={fakeAnalyzer}
|
|
1087
|
-
captureType={CaptureType.selfie}
|
|
1088
|
-
onCaptureTimeout={(state) => onCaptureTimeout(state)}
|
|
1089
|
-
/>,
|
|
1090
|
-
);
|
|
1091
|
-
});
|
|
1092
|
-
act(() => {
|
|
1093
|
-
vi.advanceTimersByTime(3_000);
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
expect(onCaptureTimeout).toHaveBeenCalledTimes(1);
|
|
1098
|
-
});
|
|
1099
|
-
|
|
1100
|
-
it("stays quiet once a frame has been analyzed", () => {
|
|
1101
|
-
const onCaptureTimeout = vi.fn();
|
|
1102
|
-
const tree = render(
|
|
1103
|
-
<UseSmileIDCaptureScreen
|
|
1104
|
-
analyzer={fakeAnalyzer}
|
|
1105
|
-
captureType={CaptureType.selfie}
|
|
1106
|
-
onCaptureTimeout={onCaptureTimeout}
|
|
1107
|
-
/>,
|
|
1108
|
-
);
|
|
1109
|
-
act(() => {
|
|
1110
|
-
findByTestID(tree.root, "si_capture_start_button")!.props.onClick();
|
|
1111
|
-
});
|
|
1112
|
-
act(() => {
|
|
1113
|
-
capturedOnResult!({
|
|
1114
|
-
output: { faces: [], brightness: 0 },
|
|
1115
|
-
state: { type: UseSmileIDScanStateType.Initial },
|
|
1116
|
-
capturedEvents: [],
|
|
1117
|
-
});
|
|
1118
|
-
});
|
|
1119
|
-
|
|
1120
|
-
elapseFirstFrameWait();
|
|
1121
|
-
|
|
1122
|
-
expect(onCaptureTimeout).not.toHaveBeenCalled();
|
|
1123
|
-
expect(
|
|
1124
|
-
collectText(findByTestID(tree.root, "si_capture_feedback_text")!),
|
|
1125
|
-
).not.toBe(enStrings.si_capture_camera_unavailable);
|
|
1126
|
-
});
|
|
1127
|
-
});
|
|
1128
|
-
});
|