@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,1166 +0,0 @@
|
|
|
1
|
-
import type { ScreenSpec } from "./dsl/builder/screens_builder";
|
|
2
|
-
import type { FlowConfigurationSnapshot } from "./dsl/use_smile_id_flow_builder";
|
|
3
|
-
import type { JobSubmissionState } from "./job_submission_state";
|
|
4
|
-
import type { JobRequest } from "../../data/model/job_request";
|
|
5
|
-
import type { UseSmileIDRepository } from "../../data/repository/use_smile_id_repository";
|
|
6
|
-
import type { ConsentInformation, UserDetails } from "../../core/models/params";
|
|
7
|
-
import { JobType } from "../../core/models/job_type";
|
|
8
|
-
import { CaptureType } from "../../core/models/ml_config";
|
|
9
|
-
import {
|
|
10
|
-
defaultFrameAspectRatio,
|
|
11
|
-
type DocumentType,
|
|
12
|
-
} from "../../core/models/document_type";
|
|
13
|
-
import type { JobSubmissionResponse } from "../../data/model/job_submission_response";
|
|
14
|
-
import {
|
|
15
|
-
MissingJobTypeException,
|
|
16
|
-
MissingRequiredFieldException,
|
|
17
|
-
} from "../../core/exception/job_validation_exceptions";
|
|
18
|
-
import {
|
|
19
|
-
UseSmileIDAnalyticsEventTypes,
|
|
20
|
-
UseSmileIDAnalyticsParamKeys,
|
|
21
|
-
UseSmileIDAnalyticsScreenNames,
|
|
22
|
-
type UseSmileIDAnalyticsEventType,
|
|
23
|
-
} from "./analytics/use_smile_id_analytics_event";
|
|
24
|
-
import type { MetadataEntry } from "../../metadata/use_smile_id_metadata";
|
|
25
|
-
import {
|
|
26
|
-
UseSmileIDMetadataFactory,
|
|
27
|
-
type MetadataProvider,
|
|
28
|
-
} from "../../metadata/use_smile_id_metadata_factory";
|
|
29
|
-
import {
|
|
30
|
-
DOCUMENT_BACK_IMAGE_ORIGIN_KEY,
|
|
31
|
-
DOCUMENT_FRONT_IMAGE_ORIGIN_KEY,
|
|
32
|
-
type DocumentImageOrigin,
|
|
33
|
-
} from "../../metadata/document_image_origin";
|
|
34
|
-
import { configurationMetadataEntries } from "../../metadata/metadata_configuration_mappers";
|
|
35
|
-
import {
|
|
36
|
-
CAPTURE_IMAGE_COLOR_DEPTH,
|
|
37
|
-
CAPTURE_IMAGE_PIXEL_CONFIG,
|
|
38
|
-
} from "../../metadata/captured_image_properties";
|
|
39
|
-
import type { CaptureTelemetry } from "../screen/use_smile_id_capture_screen";
|
|
40
|
-
import type { SdkConfig } from "../../data/model/sdk_config";
|
|
41
|
-
import { numSamplesOverride } from "../../data/model/sdk_config";
|
|
42
|
-
import {
|
|
43
|
-
decodeSmileIDToken,
|
|
44
|
-
type DecodedToken,
|
|
45
|
-
} from "../../data/util/use_smile_id_token_decoder";
|
|
46
|
-
import {
|
|
47
|
-
isTokenConsentComplete,
|
|
48
|
-
bindsRequiredUserDetails,
|
|
49
|
-
type TokenPayload,
|
|
50
|
-
} from "../../data/model/token_payload";
|
|
51
|
-
import {
|
|
52
|
-
isUserDetailsPayloadEmpty,
|
|
53
|
-
userDetailsPayloadFrom,
|
|
54
|
-
} from "../../data/model/user_details_payload";
|
|
55
|
-
import type { UserDetailsPayload } from "../../data/model/user_details_payload";
|
|
56
|
-
import {
|
|
57
|
-
DocumentSide,
|
|
58
|
-
EnhancedSmartSelfieConfig,
|
|
59
|
-
} from "@smileid/usesmileid_bridge";
|
|
60
|
-
import { ScanPerformanceProfile } from "@smileid/usesmileid_bridge";
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Internal flow navigation manager — owns the screen cursor, captured
|
|
64
|
-
* artifacts, navigation primitives, job submission lifecycle, and a
|
|
65
|
-
* subscribe pattern for React re-renders.
|
|
66
|
-
*
|
|
67
|
-
* Custom (not Expo Router / React Navigation) because screens are
|
|
68
|
-
* partner-configurable via the DSL, not file-based routes; forcing a
|
|
69
|
-
* routing library would conflict with the partner's own app routing.
|
|
70
|
-
*/
|
|
71
|
-
type Listener = () => void;
|
|
72
|
-
|
|
73
|
-
export type CapturedArtifacts = {
|
|
74
|
-
readonly selfiePath?: string;
|
|
75
|
-
readonly livenessPaths: readonly string[];
|
|
76
|
-
readonly frontDocumentPath?: string;
|
|
77
|
-
readonly backDocumentPath?: string;
|
|
78
|
-
readonly consentInformation?: ConsentInformation;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export type FlowExitReason =
|
|
82
|
-
| { readonly kind: "completed"; readonly job: JobSubmissionResponse }
|
|
83
|
-
| { readonly kind: "cancelled" }
|
|
84
|
-
| { readonly kind: "failed"; readonly error: unknown };
|
|
85
|
-
|
|
86
|
-
export type FlowExitHandler = (reason: FlowExitReason) => void;
|
|
87
|
-
|
|
88
|
-
export type FlowNavigationManagerOptions = {
|
|
89
|
-
readonly configuration: FlowConfigurationSnapshot;
|
|
90
|
-
readonly onExit: FlowExitHandler;
|
|
91
|
-
/**
|
|
92
|
-
* Dispatches the assembled `JobRequest`. Optional so capture-only /
|
|
93
|
-
* UI-only harnesses (no `b.network(...)`) can still mount. When
|
|
94
|
-
* absent, `beginSubmissionIfNeeded()` goes straight to a descriptive
|
|
95
|
-
* `failure` rather than spinning forever.
|
|
96
|
-
*/
|
|
97
|
-
readonly repository?: UseSmileIDRepository;
|
|
98
|
-
/**
|
|
99
|
-
* Per-flow metadata provider; each `JobRequest` carries a fresh
|
|
100
|
-
* `metadata` snapshot via `make()`. Optional — capture-only harnesses
|
|
101
|
-
* fall back to a default factory. Production passes the same provider
|
|
102
|
-
* the networking factory created so `session_id` stays stable across
|
|
103
|
-
* every submission in the flow.
|
|
104
|
-
*/
|
|
105
|
-
readonly metadataProvider?: MetadataProvider;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const DEFAULT_CONSENT: ConsentInformation = Object.freeze({
|
|
109
|
-
granted: false,
|
|
110
|
-
grantedAt: "",
|
|
111
|
-
noticeLanguage: "",
|
|
112
|
-
noticePrivacyPolicyUrl: "",
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
export class FlowNavigationManager {
|
|
116
|
-
/**
|
|
117
|
-
* Navigation stack and source of truth — top is the active screen.
|
|
118
|
-
* Active screen + first/last predicates derive from this path (no
|
|
119
|
-
* parallel index). Mutated only via the navigate* methods.
|
|
120
|
-
*/
|
|
121
|
-
private _navigationPath: ScreenSpec[] = [];
|
|
122
|
-
private _captured: CapturedArtifacts = { livenessPaths: [] };
|
|
123
|
-
/**
|
|
124
|
-
* Set once the partner skips the document back side via the flip
|
|
125
|
-
* interstitial. Routes `getNextScreen()` past the back capture's preview so
|
|
126
|
-
* submission proceeds with `backDocument` unset. Cleared when the front is
|
|
127
|
-
* retaken.
|
|
128
|
-
*/
|
|
129
|
-
private _documentBackSkipped = false;
|
|
130
|
-
/**
|
|
131
|
-
* How each captured document side was produced (auto / manual / gallery).
|
|
132
|
-
* Emitted as `DocumentFront/BackImageOrigin` submission metadata; an entry is
|
|
133
|
-
* removed when its side is retaken.
|
|
134
|
-
*/
|
|
135
|
-
private readonly _documentImageOrigins = new Map<
|
|
136
|
-
DocumentSide,
|
|
137
|
-
DocumentImageOrigin
|
|
138
|
-
>();
|
|
139
|
-
// Capture telemetry recorded at capture completion (selfie + per document side).
|
|
140
|
-
private _selfieCaptureTelemetry: CaptureTelemetry | undefined;
|
|
141
|
-
private readonly _documentCaptureTelemetry = new Map<
|
|
142
|
-
DocumentSide,
|
|
143
|
-
CaptureTelemetry
|
|
144
|
-
>();
|
|
145
|
-
// Identifier of the camera used for the most recent capture.
|
|
146
|
-
private _cameraName: string | undefined;
|
|
147
|
-
// Accelerometer telemetry from the most recent capture (device_positions / movement).
|
|
148
|
-
private _devicePositions: readonly string[] = [];
|
|
149
|
-
private _deviceMovementDetected: number | null = null;
|
|
150
|
-
private _jobSubmissionState: JobSubmissionState = { kind: "notAttempted" };
|
|
151
|
-
private readonly _listeners = new Set<Listener>();
|
|
152
|
-
private readonly _steps: readonly ScreenSpec[];
|
|
153
|
-
private readonly _configuration: FlowConfigurationSnapshot;
|
|
154
|
-
private readonly _repository: UseSmileIDRepository | undefined;
|
|
155
|
-
private readonly _metadataProvider: MetadataProvider;
|
|
156
|
-
private readonly _onExit: FlowExitHandler;
|
|
157
|
-
private _disposed = false;
|
|
158
|
-
private _submissionResponse: JobSubmissionResponse | undefined;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Decoded `sdk_config` JWT claim, resolved once at construction.
|
|
162
|
-
* `undefined` for offline mode / no token / no valid claim — SDK
|
|
163
|
-
* defaults apply throughout the flow in those cases.
|
|
164
|
-
*/
|
|
165
|
-
readonly resolvedSdkConfig: SdkConfig | undefined;
|
|
166
|
-
|
|
167
|
-
/** Canonical `partner_id` decoded from the JWT (raw); resolved via the [partnerId] getter. */
|
|
168
|
-
private readonly _resolvedPartnerId: string | undefined;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Token-bound user-detail/consent bindings decoded from the JWT
|
|
172
|
-
* `payload` claim, resolved once at construction alongside
|
|
173
|
-
* `resolvedSdkConfig`. `undefined` for offline mode / no token /
|
|
174
|
-
* legacy token — assembly then requires and sends everything exactly
|
|
175
|
-
* as before token support existed.
|
|
176
|
-
*/
|
|
177
|
-
private readonly _resolvedTokenPayload: TokenPayload | undefined;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Partner identifier the capture screen stamps into the Smile EXIF tag — the tag's HMAC/AES
|
|
181
|
-
* keys derive from it and the backend validates the tag against the request's partner_id.
|
|
182
|
-
*
|
|
183
|
-
* Sourced from the JWT `partner_id` claim (server-canonical form, e.g. `"002"`) so the stamped
|
|
184
|
-
* value matches what the backend keys on; falls back to the partner-supplied config value when
|
|
185
|
-
* the claim is absent/blank. Empty = skip tagging.
|
|
186
|
-
*/
|
|
187
|
-
get partnerId(): string {
|
|
188
|
-
const jwtPartnerId = this._resolvedPartnerId;
|
|
189
|
-
if (jwtPartnerId && jwtPartnerId.length > 0) return jwtPartnerId;
|
|
190
|
-
return this._configuration.network?.config?.partnerConfig?.partnerId ?? "";
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/** Stable per-flow session id, stamped into every analytics event's `session_id`. */
|
|
194
|
-
private readonly _sessionId: string;
|
|
195
|
-
|
|
196
|
-
/** Submission attempts so far — stamped into `job_submitted` as `attempt`. */
|
|
197
|
-
private _submissionAttemptCount = 0;
|
|
198
|
-
|
|
199
|
-
constructor(options: FlowNavigationManagerOptions) {
|
|
200
|
-
this._configuration = options.configuration;
|
|
201
|
-
this._onExit = options.onExit;
|
|
202
|
-
this._repository = options.repository;
|
|
203
|
-
// Fall back to a fresh factory so capture-only harnesses still build
|
|
204
|
-
// well-formed requests; the factory reads expo-device lazily and
|
|
205
|
-
// degrades to empty values when the peer dep is absent.
|
|
206
|
-
this._metadataProvider =
|
|
207
|
-
options.metadataProvider ?? new UseSmileIDMetadataFactory();
|
|
208
|
-
this._sessionId = this._metadataProvider.sessionId;
|
|
209
|
-
const decodedToken = FlowNavigationManager._decodeToken(
|
|
210
|
-
options.configuration,
|
|
211
|
-
);
|
|
212
|
-
this.resolvedSdkConfig = decodedToken?.sdkConfig;
|
|
213
|
-
this._resolvedPartnerId = decodedToken?.partnerId;
|
|
214
|
-
this._resolvedTokenPayload = decodedToken?.tokenPayload;
|
|
215
|
-
// Token consent always wins: a complete binding drops the consent
|
|
216
|
-
// screen from the flow — the server injects the token's record, so
|
|
217
|
-
// nothing is collected here.
|
|
218
|
-
const steps = options.configuration.screens.steps;
|
|
219
|
-
this._steps = isTokenConsentComplete(decodedToken?.tokenPayload?.consent)
|
|
220
|
-
? steps.filter((s) => s.kind !== "consent")
|
|
221
|
-
: steps;
|
|
222
|
-
// Seed the path with the first screen so currentScreen/renderer have a
|
|
223
|
-
// deterministic start. Empty path → host renders the "no screens"
|
|
224
|
-
// sentinel (validation rejects empty screens at build time anyway).
|
|
225
|
-
const firstScreen = this._steps[0];
|
|
226
|
-
if (firstScreen) {
|
|
227
|
-
this._navigationPath = [firstScreen];
|
|
228
|
-
}
|
|
229
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.flowStarted, {
|
|
230
|
-
[UseSmileIDAnalyticsParamKeys.jobType]: this._jobTypeName(),
|
|
231
|
-
});
|
|
232
|
-
if (firstScreen) {
|
|
233
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.screenViewed, {
|
|
234
|
-
[UseSmileIDAnalyticsParamKeys.screenName]:
|
|
235
|
-
this._screenAnalyticsName(firstScreen),
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
get configuration(): FlowConfigurationSnapshot {
|
|
241
|
-
return this._configuration;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/** Whether any selfie step enabled Enhanced Smart Selfie (drives the instructions hero swap and oval-progress suppression). */
|
|
245
|
-
get enhancedLivenessEnabled(): boolean {
|
|
246
|
-
return this._steps.some(
|
|
247
|
-
(step) =>
|
|
248
|
-
step.kind === "capture" &&
|
|
249
|
-
step.config.selfieConfig?.enableEnhancedLiveness === true,
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/** Document type from the flow's document capture step, if any (drives the instructions document variant). */
|
|
254
|
-
get documentType(): DocumentType | undefined {
|
|
255
|
-
for (const step of this._steps) {
|
|
256
|
-
if (
|
|
257
|
-
step.kind === "capture" &&
|
|
258
|
-
step.config.captureType === CaptureType.document
|
|
259
|
-
) {
|
|
260
|
-
return step.config.documentConfig?.documentType;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
return undefined;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Resolved document capture-frame aspect ratio (width / height), shared by
|
|
268
|
-
* capture, preview, and processing. Precedence: type `knownAspectRatio` →
|
|
269
|
-
* partner `knownIdAspectRatio` → orientation default.
|
|
270
|
-
*/
|
|
271
|
-
get documentFrameAspectRatio(): number | undefined {
|
|
272
|
-
for (const step of this._steps) {
|
|
273
|
-
if (
|
|
274
|
-
step.kind === "capture" &&
|
|
275
|
-
step.config.captureType === CaptureType.document
|
|
276
|
-
) {
|
|
277
|
-
const documentConfig = step.config.documentConfig;
|
|
278
|
-
return (
|
|
279
|
-
documentConfig?.resolvedAspectRatio ??
|
|
280
|
-
defaultFrameAspectRatio(
|
|
281
|
-
documentConfig?.documentType?.orientation ?? "Landscape",
|
|
282
|
-
)
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return undefined;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// --- navigation path --------------------------------------------------
|
|
290
|
-
|
|
291
|
-
/** Read-only navigation stack; top is the active screen. */
|
|
292
|
-
get navigationPath(): readonly ScreenSpec[] {
|
|
293
|
-
return this._navigationPath;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/** Active screen (top of the path); `undefined` only when no screens are configured. */
|
|
297
|
-
get currentScreen(): ScreenSpec | undefined {
|
|
298
|
-
return this._navigationPath[this._navigationPath.length - 1];
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Depth of the active screen — stable id for React view identity so
|
|
303
|
-
* stack frames at the same configured-screen position stay distinct.
|
|
304
|
-
*/
|
|
305
|
-
get currentDepth(): number {
|
|
306
|
-
return this._navigationPath.length - 1;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
get isFirstScreen(): boolean {
|
|
310
|
-
return this._navigationPath.length <= 1;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
get isLastScreen(): boolean {
|
|
314
|
-
return this.getNextScreen() === undefined;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/** Next screen `navigateToNext()` would land on; `undefined` at the terminal screen. */
|
|
318
|
-
getNextScreen(): ScreenSpec | undefined {
|
|
319
|
-
const current = this.currentScreen;
|
|
320
|
-
if (!current) return undefined;
|
|
321
|
-
const currentIdx = this._steps.indexOf(current);
|
|
322
|
-
if (currentIdx < 0) return undefined;
|
|
323
|
-
|
|
324
|
-
// Per-side document loop: after previewing the FRONT, route back to the
|
|
325
|
-
// document capture step to capture the BACK. Gated so it fires only on a
|
|
326
|
-
// document preview with the back still pending and not skipped — the back
|
|
327
|
-
// preview (back already captured) falls through to the linear next step.
|
|
328
|
-
if (
|
|
329
|
-
current.kind === "preview" &&
|
|
330
|
-
this._precedingStepIsDocumentCapture(currentIdx) &&
|
|
331
|
-
this.documentCapturesBack() &&
|
|
332
|
-
this._captured.backDocumentPath === undefined &&
|
|
333
|
-
!this._documentBackSkipped
|
|
334
|
-
) {
|
|
335
|
-
const documentCapture = this._steps[currentIdx - 1];
|
|
336
|
-
if (documentCapture !== undefined) return documentCapture;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Back skipped at the interstitial: skip the document preview that would
|
|
340
|
-
// otherwise follow the capture and advance past it (no back to preview).
|
|
341
|
-
if (
|
|
342
|
-
current.kind === "capture" &&
|
|
343
|
-
current.config.captureType === CaptureType.document &&
|
|
344
|
-
this._documentBackSkipped
|
|
345
|
-
) {
|
|
346
|
-
const next = this._steps[currentIdx + 1];
|
|
347
|
-
if (next?.kind === "preview") return this._steps[currentIdx + 2];
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// At the document capture step with the front captured, the back still
|
|
351
|
-
// pending, and no document preview to drive the per-side loop, re-enter the
|
|
352
|
-
// capture step for the back side so captureBothSides is honoured even when
|
|
353
|
-
// the flow omits the document preview { } step. When a preview does follow,
|
|
354
|
-
// the per-side loop above handles the back instead.
|
|
355
|
-
if (
|
|
356
|
-
current.kind === "capture" &&
|
|
357
|
-
current.config.captureType === CaptureType.document &&
|
|
358
|
-
this.documentCapturesBack() &&
|
|
359
|
-
this._captured.frontDocumentPath !== undefined &&
|
|
360
|
-
this._captured.backDocumentPath === undefined &&
|
|
361
|
-
!this._documentBackSkipped &&
|
|
362
|
-
!this.documentPreviewFollowsCapture()
|
|
363
|
-
) {
|
|
364
|
-
return current;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
return this._steps[currentIdx + 1];
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Advance to the next screen. Past the last screen, exits via `onExit`
|
|
372
|
-
* `{ kind: 'completed', job }` (job is the successful response, or an
|
|
373
|
-
* empty-fields stand-in for flows with no processing screen).
|
|
374
|
-
*
|
|
375
|
-
* Advancing into a `processing` screen sets `loading` synchronously
|
|
376
|
-
* before the async submit, closing the race with the screen's
|
|
377
|
-
* mount-time `beginSubmissionIfNeeded()` so it never flashes
|
|
378
|
-
* `notAttempted`.
|
|
379
|
-
*/
|
|
380
|
-
navigateToNext(): void {
|
|
381
|
-
if (this._disposed) return;
|
|
382
|
-
const nextScreen = this.getNextScreen();
|
|
383
|
-
if (!nextScreen) {
|
|
384
|
-
// Past the last screen: deliver the stored success response,
|
|
385
|
-
// surface a failure, else the empty-fields completed carrier
|
|
386
|
-
// (flows with no processing screen still get `completed`).
|
|
387
|
-
const state = this._jobSubmissionState;
|
|
388
|
-
if (this._submissionResponse) {
|
|
389
|
-
this._finishFlow({ kind: "completed", job: this._submissionResponse });
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
if (state.kind === "failure") {
|
|
393
|
-
this._finishFlow({ kind: "failed", error: state.error });
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
396
|
-
const job: JobSubmissionResponse =
|
|
397
|
-
state.kind === "success"
|
|
398
|
-
? state.response
|
|
399
|
-
: { userId: "", jobId: "", status: "", message: "" };
|
|
400
|
-
this._finishFlow({ kind: "completed", job });
|
|
401
|
-
return;
|
|
402
|
-
}
|
|
403
|
-
this._navigationPath = [...this._navigationPath, nextScreen];
|
|
404
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.screenViewed, {
|
|
405
|
-
[UseSmileIDAnalyticsParamKeys.screenName]:
|
|
406
|
-
this._screenAnalyticsName(nextScreen),
|
|
407
|
-
});
|
|
408
|
-
// Mark loading synchronously so the processing screen's mount-time
|
|
409
|
-
// beginSubmissionIfNeeded() sees the transition has started — guards
|
|
410
|
-
// the brief notAttempted flash before the async submit is scheduled.
|
|
411
|
-
if (
|
|
412
|
-
nextScreen.kind === "processing" &&
|
|
413
|
-
this._jobSubmissionState.kind === "notAttempted" &&
|
|
414
|
-
this._repository !== undefined
|
|
415
|
-
) {
|
|
416
|
-
this._jobSubmissionState = { kind: "loading" };
|
|
417
|
-
}
|
|
418
|
-
this._notify();
|
|
419
|
-
if (
|
|
420
|
-
nextScreen.kind === "processing" &&
|
|
421
|
-
this._jobSubmissionState.kind === "loading" &&
|
|
422
|
-
this._repository !== undefined
|
|
423
|
-
) {
|
|
424
|
-
// Macrotask defer so React paints the loading processing screen
|
|
425
|
-
// before _submit blocks the JS thread with request assembly +
|
|
426
|
-
// signing. The pre-set loading keeps beginSubmissionIfNeeded() a
|
|
427
|
-
// no-op, so it still submits exactly once.
|
|
428
|
-
setTimeout(() => {
|
|
429
|
-
if (this._disposed) return;
|
|
430
|
-
void this._submit();
|
|
431
|
-
}, 0);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/** Pop the active screen; from the first screen, exits via `onExit` `{ kind: 'cancelled' }`. */
|
|
436
|
-
navigateBack(): void {
|
|
437
|
-
if (this._disposed) return;
|
|
438
|
-
if (this.isFirstScreen) {
|
|
439
|
-
this._onExit({ kind: "cancelled" });
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
// Going back from a non-first screen is a retake of the prior step.
|
|
443
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.retakeRequested);
|
|
444
|
-
this._navigationPath = this._navigationPath.slice(0, -1);
|
|
445
|
-
this._notify();
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
/** Reset the path to the first screen (flow restart after terminal failure, manager kept alive). */
|
|
449
|
-
navigateToStart(): void {
|
|
450
|
-
if (this._disposed) return;
|
|
451
|
-
const firstScreen = this._steps[0];
|
|
452
|
-
this._navigationPath = firstScreen ? [firstScreen] : [];
|
|
453
|
-
this._notify();
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/** Exit the flow with a partner-supplied reason (processing onExit, consent denied, etc.). */
|
|
457
|
-
exit(reason: FlowExitReason = { kind: "cancelled" }): void {
|
|
458
|
-
if (this._disposed) return;
|
|
459
|
-
this._finishFlow(reason);
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
// --- captured artifacts -----------------------------------------------
|
|
463
|
-
|
|
464
|
-
get captured(): CapturedArtifacts {
|
|
465
|
-
return this._captured;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
setCapturedSelfie(
|
|
469
|
-
selfiePath: string,
|
|
470
|
-
livenessPaths: readonly string[],
|
|
471
|
-
): void {
|
|
472
|
-
if (this._disposed) return;
|
|
473
|
-
this._captured = {
|
|
474
|
-
...this._captured,
|
|
475
|
-
selfiePath,
|
|
476
|
-
livenessPaths: Object.freeze([...livenessPaths]),
|
|
477
|
-
};
|
|
478
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.selfieCaptured, {
|
|
479
|
-
[UseSmileIDAnalyticsParamKeys.livenessImageCount]: String(
|
|
480
|
-
livenessPaths.length,
|
|
481
|
-
),
|
|
482
|
-
});
|
|
483
|
-
this._notify();
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
setCapturedFrontDocument(path: string): void {
|
|
487
|
-
if (this._disposed) return;
|
|
488
|
-
this._captured = { ...this._captured, frontDocumentPath: path };
|
|
489
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.documentCaptured, {
|
|
490
|
-
[UseSmileIDAnalyticsParamKeys.documentSide]: "front",
|
|
491
|
-
});
|
|
492
|
-
this._notify();
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
setCapturedBackDocument(path: string): void {
|
|
496
|
-
if (this._disposed) return;
|
|
497
|
-
this._captured = { ...this._captured, backDocumentPath: path };
|
|
498
|
-
// `both` is the single completion-event value for a two-sided capture.
|
|
499
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.documentCaptured, {
|
|
500
|
-
[UseSmileIDAnalyticsParamKeys.documentSide]: "both",
|
|
501
|
-
});
|
|
502
|
-
this._notify();
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
// --- document per-side preview loop -----------------------------------
|
|
506
|
-
|
|
507
|
-
/** Whether the configured document capture asks for a back side. */
|
|
508
|
-
documentCapturesBack(): boolean {
|
|
509
|
-
for (const step of this._steps) {
|
|
510
|
-
if (
|
|
511
|
-
step.kind === "capture" &&
|
|
512
|
-
step.config.captureType === CaptureType.document
|
|
513
|
-
) {
|
|
514
|
-
const documentConfig = step.config.documentConfig;
|
|
515
|
-
return (
|
|
516
|
-
documentConfig?.documentType?.hasBackSide === true &&
|
|
517
|
-
(documentConfig?.captureBothSides ?? false)
|
|
518
|
-
);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
return false;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
/** Whether a `preview {}` immediately follows the document capture step. */
|
|
525
|
-
documentPreviewFollowsCapture(): boolean {
|
|
526
|
-
const index = this._steps.findIndex(
|
|
527
|
-
(step) =>
|
|
528
|
-
step.kind === "capture" &&
|
|
529
|
-
step.config.captureType === CaptureType.document,
|
|
530
|
-
);
|
|
531
|
-
if (index < 0) return false;
|
|
532
|
-
return this._steps[index + 1]?.kind === "preview";
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
/** Whether the active preview previews a document side (vs the selfie). */
|
|
536
|
-
currentPreviewIsDocument(): boolean {
|
|
537
|
-
const current = this.currentScreen;
|
|
538
|
-
if (!current || current.kind !== "preview") return false;
|
|
539
|
-
return this._precedingStepIsDocumentCapture(this._steps.indexOf(current));
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
/** Path of the document side under review: the back if captured, else the front. */
|
|
543
|
-
currentDocumentPreviewPath(): string | undefined {
|
|
544
|
-
return this._captured.backDocumentPath ?? this._captured.frontDocumentPath;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* Discard the side under review for re-capture: the back if captured,
|
|
549
|
-
* else the front (which also un-skips the back). Does not navigate.
|
|
550
|
-
*/
|
|
551
|
-
retakeCurrentDocumentSide(): void {
|
|
552
|
-
if (this._disposed) return;
|
|
553
|
-
const next: {
|
|
554
|
-
-readonly [K in keyof CapturedArtifacts]: CapturedArtifacts[K];
|
|
555
|
-
} = { ...this._captured };
|
|
556
|
-
if (next.backDocumentPath !== undefined) {
|
|
557
|
-
delete next.backDocumentPath;
|
|
558
|
-
this._documentImageOrigins.delete(DocumentSide.Back);
|
|
559
|
-
} else {
|
|
560
|
-
delete next.frontDocumentPath;
|
|
561
|
-
this._documentImageOrigins.delete(DocumentSide.Front);
|
|
562
|
-
this._documentBackSkipped = false;
|
|
563
|
-
}
|
|
564
|
-
this._captured = next;
|
|
565
|
-
this._notify();
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/** Skip the document back side from the flip interstitial ("Skip"). */
|
|
569
|
-
skipDocumentBack(): void {
|
|
570
|
-
if (this._disposed) return;
|
|
571
|
-
this._documentBackSkipped = true;
|
|
572
|
-
this._notify();
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
* Record how a side was produced (→ `DocumentFront/BackImageOrigin`
|
|
577
|
-
* metadata). Metadata-only, so it intentionally does not `_notify()`.
|
|
578
|
-
*/
|
|
579
|
-
recordDocumentImageOrigin(
|
|
580
|
-
side: DocumentSide,
|
|
581
|
-
origin: DocumentImageOrigin,
|
|
582
|
-
): void {
|
|
583
|
-
if (this._disposed) return;
|
|
584
|
-
this._documentImageOrigins.set(side, origin);
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
/** Records selfie capture telemetry (duration + retries) at capture completion. */
|
|
588
|
-
recordSelfieCaptureTelemetry(telemetry: CaptureTelemetry): void {
|
|
589
|
-
if (this._disposed) return;
|
|
590
|
-
this._selfieCaptureTelemetry = telemetry;
|
|
591
|
-
this._captureCameraName(telemetry);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
/** Records per-side document capture telemetry at each side's completion. */
|
|
595
|
-
recordDocumentCaptureTelemetry(
|
|
596
|
-
side: DocumentSide,
|
|
597
|
-
telemetry: CaptureTelemetry,
|
|
598
|
-
): void {
|
|
599
|
-
if (this._disposed) return;
|
|
600
|
-
this._documentCaptureTelemetry.set(side, telemetry);
|
|
601
|
-
this._captureCameraName(telemetry);
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
private _captureCameraName(telemetry: CaptureTelemetry): void {
|
|
605
|
-
if (telemetry.cameraName) this._cameraName = telemetry.cameraName;
|
|
606
|
-
if (telemetry.devicePositions.length > 0) {
|
|
607
|
-
this._devicePositions = telemetry.devicePositions;
|
|
608
|
-
this._deviceMovementDetected = telemetry.deviceMovementDetected;
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
/** Per-side document origin wire entries (front then back; omitted when unset). */
|
|
613
|
-
private _documentImageOriginEntries(): MetadataEntry[] {
|
|
614
|
-
const entries: MetadataEntry[] = [];
|
|
615
|
-
const front = this._documentImageOrigins.get(DocumentSide.Front);
|
|
616
|
-
if (front !== undefined) {
|
|
617
|
-
entries.push({ name: DOCUMENT_FRONT_IMAGE_ORIGIN_KEY, value: front });
|
|
618
|
-
}
|
|
619
|
-
const back = this._documentImageOrigins.get(DocumentSide.Back);
|
|
620
|
-
if (back !== undefined) {
|
|
621
|
-
entries.push({ name: DOCUMENT_BACK_IMAGE_ORIGIN_KEY, value: back });
|
|
622
|
-
}
|
|
623
|
-
return entries;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
* Capture telemetry + image-property wire entries. Durations and retries keep
|
|
628
|
-
* a meaningful 0 (capture ran) and are omitted only when that capture type
|
|
629
|
-
* never ran. Color depth / pixel config are emitted for each present capture;
|
|
630
|
-
* document sizes when measured.
|
|
631
|
-
*/
|
|
632
|
-
private _captureTelemetryEntries(): MetadataEntry[] {
|
|
633
|
-
const entries: MetadataEntry[] = [];
|
|
634
|
-
const push = (name: string, value: string) => entries.push({ name, value });
|
|
635
|
-
|
|
636
|
-
const selfie = this._selfieCaptureTelemetry;
|
|
637
|
-
if (selfie) {
|
|
638
|
-
// Duration + retries keep a meaningful 0 (capture ran); telemetry is absent only when the
|
|
639
|
-
// capture type never ran.
|
|
640
|
-
push("selfie_capture_duration_ms", String(selfie.durationMs));
|
|
641
|
-
push("selfie_capture_retries", String(selfie.retries));
|
|
642
|
-
}
|
|
643
|
-
if (this._captured.selfiePath !== undefined) {
|
|
644
|
-
push("selfie_image_color_depth", String(CAPTURE_IMAGE_COLOR_DEPTH));
|
|
645
|
-
push("selfie_image_pixel_config", CAPTURE_IMAGE_PIXEL_CONFIG);
|
|
646
|
-
}
|
|
647
|
-
if (this._cameraName) {
|
|
648
|
-
push("camera_name", this._cameraName);
|
|
649
|
-
}
|
|
650
|
-
if (this._devicePositions.length > 0) {
|
|
651
|
-
push("device_positions", JSON.stringify(this._devicePositions));
|
|
652
|
-
if (this._deviceMovementDetected !== null) {
|
|
653
|
-
push("device_movement_detected", String(this._deviceMovementDetected));
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
const sideKey = (side: DocumentSide) =>
|
|
658
|
-
side === DocumentSide.Back ? "back" : "front";
|
|
659
|
-
for (const side of [DocumentSide.Front, DocumentSide.Back]) {
|
|
660
|
-
const key = sideKey(side);
|
|
661
|
-
const telemetry = this._documentCaptureTelemetry.get(side);
|
|
662
|
-
if (telemetry) {
|
|
663
|
-
push(
|
|
664
|
-
`document_${key}_capture_duration_ms`,
|
|
665
|
-
String(telemetry.durationMs),
|
|
666
|
-
);
|
|
667
|
-
push(`document_${key}_capture_retries`, String(telemetry.retries));
|
|
668
|
-
push(
|
|
669
|
-
`document_${key}_image_color_depth`,
|
|
670
|
-
String(CAPTURE_IMAGE_COLOR_DEPTH),
|
|
671
|
-
);
|
|
672
|
-
push(`document_${key}_image_pixel_config`, CAPTURE_IMAGE_PIXEL_CONFIG);
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
// Per-image original + final compressed sizes are stamped in the repository around the
|
|
676
|
-
// compression pass (it owns both the before and after byte counts), not here.
|
|
677
|
-
return entries;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
private _precedingStepIsDocumentCapture(index: number): boolean {
|
|
681
|
-
const preceding = this._steps[index - 1];
|
|
682
|
-
return (
|
|
683
|
-
preceding?.kind === "capture" &&
|
|
684
|
-
preceding.config.captureType === CaptureType.document
|
|
685
|
-
);
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
setConsent(info: ConsentInformation): void {
|
|
689
|
-
if (this._disposed) return;
|
|
690
|
-
this._captured = { ...this._captured, consentInformation: info };
|
|
691
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.consentCaptured, {
|
|
692
|
-
[UseSmileIDAnalyticsParamKeys.decision]: "granted",
|
|
693
|
-
});
|
|
694
|
-
this._notify();
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
// --- job submission ---------------------------------------------------
|
|
698
|
-
|
|
699
|
-
get jobSubmissionState(): JobSubmissionState {
|
|
700
|
-
return this._jobSubmissionState;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
/**
|
|
704
|
-
* Idempotent submission entry point (called on processing-screen
|
|
705
|
-
* mount). The `notAttempted` guard prevents re-mounts re-firing.
|
|
706
|
-
*/
|
|
707
|
-
beginSubmissionIfNeeded(): void {
|
|
708
|
-
if (this._disposed) return;
|
|
709
|
-
if (this._jobSubmissionState.kind !== "notAttempted") return;
|
|
710
|
-
void this._submit();
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* Reset to `notAttempted` and re-fire submission (processing screen's
|
|
715
|
-
* onRetry). Ignored while a submission is in flight — resetting then would
|
|
716
|
-
* defeat `beginSubmissionIfNeeded()`'s single-flight guard.
|
|
717
|
-
*/
|
|
718
|
-
retrySubmission(): void {
|
|
719
|
-
if (this._disposed) return;
|
|
720
|
-
if (this._jobSubmissionState.kind === "loading") return;
|
|
721
|
-
this._setSubmissionState({ kind: "notAttempted" });
|
|
722
|
-
this.beginSubmissionIfNeeded();
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
private _setSubmissionState(state: JobSubmissionState): void {
|
|
726
|
-
if (this._disposed) return;
|
|
727
|
-
this._jobSubmissionState = state;
|
|
728
|
-
this._notify();
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* Build the request, dispatch via repository, update state. Errors
|
|
733
|
-
* from `_assembleJob` (missing captures / bad job type) map to the
|
|
734
|
-
* `failure` state rather than propagating as unhandled rejections.
|
|
735
|
-
*/
|
|
736
|
-
private async _submit(): Promise<void> {
|
|
737
|
-
if (!this._repository) {
|
|
738
|
-
this._setSubmissionState({
|
|
739
|
-
kind: "failure",
|
|
740
|
-
error: new Error(
|
|
741
|
-
"Job submission not configured — no network/repository was " +
|
|
742
|
-
"supplied to <UseSmileIDBuilder>. Call `b.network((n) => n.config((c) => " +
|
|
743
|
-
"{ c.token = ...; c.partnerConfig((p) => { p.partnerId = ...; }); }))`.",
|
|
744
|
-
),
|
|
745
|
-
});
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
let request: JobRequest;
|
|
750
|
-
try {
|
|
751
|
-
request = this._assembleJob();
|
|
752
|
-
} catch (error) {
|
|
753
|
-
this._setSubmissionState({
|
|
754
|
-
kind: "failure",
|
|
755
|
-
error: error instanceof Error ? error : new Error(String(error)),
|
|
756
|
-
});
|
|
757
|
-
return;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
this._setSubmissionState({ kind: "loading" });
|
|
761
|
-
this._submissionAttemptCount += 1;
|
|
762
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.jobSubmitted, {
|
|
763
|
-
[UseSmileIDAnalyticsParamKeys.jobType]: this._jobTypeName(),
|
|
764
|
-
[UseSmileIDAnalyticsParamKeys.attempt]: String(
|
|
765
|
-
this._submissionAttemptCount,
|
|
766
|
-
),
|
|
767
|
-
});
|
|
768
|
-
const result = await this._repository.submit(request);
|
|
769
|
-
if (this._disposed) return;
|
|
770
|
-
if (result.status === "success") {
|
|
771
|
-
// Cache so a later navigateToNext() past the last screen can
|
|
772
|
-
// deliver the result without rebuilding the request (capture
|
|
773
|
-
// artifacts may have been released by then).
|
|
774
|
-
this._submissionResponse = result.value;
|
|
775
|
-
this._setSubmissionState({ kind: "success", response: result.value });
|
|
776
|
-
} else if (result.status === "failure") {
|
|
777
|
-
// `result.error` is `unknown`; coerce defensively in case a
|
|
778
|
-
// mock/partner repository hands back a non-Error.
|
|
779
|
-
const error =
|
|
780
|
-
result.error instanceof Error
|
|
781
|
-
? result.error
|
|
782
|
-
: new Error(String(result.error));
|
|
783
|
-
this._setSubmissionState({ kind: "failure", error });
|
|
784
|
-
}
|
|
785
|
-
// No `cancelled` branch: that outcome comes only from a user-initiated exit.
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
* Build a typed `JobRequest` from `jobType` + captured artifacts.
|
|
790
|
-
* Throws a descriptive message when a required capture is missing.
|
|
791
|
-
*/
|
|
792
|
-
private _assembleJob(): JobRequest {
|
|
793
|
-
const config = this._configuration;
|
|
794
|
-
const jobType = config.network?.config?.jobType ?? JobType.unknown;
|
|
795
|
-
// Token consent always wins: the `consent` part is omitted — the
|
|
796
|
-
// server injects the token's record — and any local preset or
|
|
797
|
-
// capture is ignored. Without a token binding, a local source
|
|
798
|
-
// (captured on the consent screen, else the builder preset) is
|
|
799
|
-
// sent in full, and the legacy DEFAULT_CONSENT placeholder covers
|
|
800
|
-
// the no-source case.
|
|
801
|
-
const consent = isTokenConsentComplete(this._resolvedTokenPayload?.consent)
|
|
802
|
-
? undefined
|
|
803
|
-
: (this._captured.consentInformation ??
|
|
804
|
-
config.consentInformation ??
|
|
805
|
-
DEFAULT_CONSENT);
|
|
806
|
-
const consentField = consent !== undefined ? { consent } : {};
|
|
807
|
-
// Build the per-submission metadata snapshot so it travels on the
|
|
808
|
-
// request (API layer serializes `request.metadata` directly).
|
|
809
|
-
// Dynamic fields (orientation, locale, timezone) re-resolve per
|
|
810
|
-
// make() so a mid-flow rotation is captured. resolvedSdkConfig drives
|
|
811
|
-
// sdk_config_source + image_width/height provenance.
|
|
812
|
-
const baseMetadata = this._metadataProvider.make(this.resolvedSdkConfig);
|
|
813
|
-
// Append the per-side document origins plus the partner's builder setup and
|
|
814
|
-
// the active detection models, all as flat wire entries.
|
|
815
|
-
// configurationMetadataEntries always contributes the builder + model config objects, so
|
|
816
|
-
// there is always at least one extra entry to append.
|
|
817
|
-
const extraEntries = [
|
|
818
|
-
...this._documentImageOriginEntries(),
|
|
819
|
-
...this._captureTelemetryEntries(),
|
|
820
|
-
...configurationMetadataEntries(config),
|
|
821
|
-
];
|
|
822
|
-
const metadata = baseMetadata.withAdditionalEntries(extraEntries);
|
|
823
|
-
|
|
824
|
-
switch (jobType) {
|
|
825
|
-
// enableEnhancedLiveness is a screen-level capture flag, not a
|
|
826
|
-
// distinct job type — enrollment still hits /v3/registration.
|
|
827
|
-
case JobType.smartSelfieEnrollment: {
|
|
828
|
-
const selfie = this._requireSelfie();
|
|
829
|
-
const userDetails = this._requireUserDetails(config);
|
|
830
|
-
return {
|
|
831
|
-
jobType: JobType.smartSelfieEnrollment,
|
|
832
|
-
selfieImage: selfie.selfiePath,
|
|
833
|
-
livenessImages: selfie.livenessPaths,
|
|
834
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
835
|
-
...consentField,
|
|
836
|
-
metadata,
|
|
837
|
-
enhanced: false,
|
|
838
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
839
|
-
};
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
case JobType.smartSelfieAuthentication: {
|
|
843
|
-
const selfie = this._requireSelfie();
|
|
844
|
-
const userDetails = this._requireUserDetails(config);
|
|
845
|
-
const userId = this._requireUserId(config);
|
|
846
|
-
return {
|
|
847
|
-
jobType: JobType.smartSelfieAuthentication,
|
|
848
|
-
selfieImage: selfie.selfiePath,
|
|
849
|
-
livenessImages: selfie.livenessPaths,
|
|
850
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
851
|
-
userId,
|
|
852
|
-
...consentField,
|
|
853
|
-
metadata,
|
|
854
|
-
enhanced: false,
|
|
855
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
case JobType.biometricKyc: {
|
|
860
|
-
const selfie = this._requireSelfie();
|
|
861
|
-
const params = config.biometricKYCParams;
|
|
862
|
-
if (!params) {
|
|
863
|
-
throw new MissingRequiredFieldException({
|
|
864
|
-
fieldName: "biometricKYCParams",
|
|
865
|
-
});
|
|
866
|
-
}
|
|
867
|
-
const userDetails = this._requireUserDetails(config);
|
|
868
|
-
return {
|
|
869
|
-
jobType: JobType.biometricKyc,
|
|
870
|
-
selfieImage: selfie.selfiePath,
|
|
871
|
-
livenessImages: selfie.livenessPaths,
|
|
872
|
-
params,
|
|
873
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
874
|
-
...consentField,
|
|
875
|
-
metadata,
|
|
876
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
877
|
-
};
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
case JobType.documentVerification: {
|
|
881
|
-
const selfie = this._requireSelfie();
|
|
882
|
-
const front = this._requireFrontDocument();
|
|
883
|
-
const params = config.documentVerificationParams;
|
|
884
|
-
if (!params) {
|
|
885
|
-
throw new MissingRequiredFieldException({
|
|
886
|
-
fieldName: "documentVerificationParams",
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
const userDetails = this._requireUserDetails(config);
|
|
890
|
-
return {
|
|
891
|
-
jobType: JobType.documentVerification,
|
|
892
|
-
...this._documentRequestFields(selfie, front),
|
|
893
|
-
country: params.country,
|
|
894
|
-
// Optional — omit when unset so the server classifies the document.
|
|
895
|
-
...(params.idType ? { idType: params.idType } : {}),
|
|
896
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
897
|
-
...consentField,
|
|
898
|
-
metadata,
|
|
899
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
900
|
-
};
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
case JobType.enhancedDocumentVerification: {
|
|
904
|
-
const selfie = this._requireSelfie();
|
|
905
|
-
const front = this._requireFrontDocument();
|
|
906
|
-
const params = config.enhancedDocumentVerificationParams;
|
|
907
|
-
if (!params) {
|
|
908
|
-
throw new MissingRequiredFieldException({
|
|
909
|
-
fieldName: "enhancedDocumentVerificationParams",
|
|
910
|
-
});
|
|
911
|
-
}
|
|
912
|
-
const userDetails = this._requireUserDetails(config);
|
|
913
|
-
return {
|
|
914
|
-
jobType: JobType.enhancedDocumentVerification,
|
|
915
|
-
...this._documentRequestFields(selfie, front),
|
|
916
|
-
country: params.country,
|
|
917
|
-
idType: params.idType,
|
|
918
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
919
|
-
...consentField,
|
|
920
|
-
metadata,
|
|
921
|
-
expectedLivenessImageCount: this._expectedLivenessImageCount(),
|
|
922
|
-
};
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
case JobType.enhancedKyc: {
|
|
926
|
-
const params = config.enhancedKYCParams;
|
|
927
|
-
if (!params) {
|
|
928
|
-
throw new MissingRequiredFieldException({
|
|
929
|
-
fieldName: "enhancedKYCParams",
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
const userDetails = this._requireUserDetails(config);
|
|
933
|
-
return {
|
|
934
|
-
jobType: JobType.enhancedKyc,
|
|
935
|
-
params,
|
|
936
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
937
|
-
...consentField,
|
|
938
|
-
metadata,
|
|
939
|
-
};
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
case JobType.bvn: {
|
|
943
|
-
// Dedicated `bvn` request kind; the repository rejects it with
|
|
944
|
-
// "BVN submission is not yet supported" until the endpoint lands.
|
|
945
|
-
// Deliberately not silently mapped onto /v3/enhanced_kyc so
|
|
946
|
-
// partners see the unsupported state explicitly.
|
|
947
|
-
const params = config.enhancedKYCParams;
|
|
948
|
-
if (!params) {
|
|
949
|
-
throw new MissingRequiredFieldException({
|
|
950
|
-
fieldName: "enhancedKYCParams",
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
const userDetails = this._requireUserDetails(config);
|
|
954
|
-
return {
|
|
955
|
-
jobType: JobType.bvn,
|
|
956
|
-
params,
|
|
957
|
-
...(userDetails !== undefined ? { userDetails } : {}),
|
|
958
|
-
...consentField,
|
|
959
|
-
metadata,
|
|
960
|
-
};
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
case JobType.unknown:
|
|
964
|
-
default:
|
|
965
|
-
throw new MissingJobTypeException();
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
private _requireSelfie(): {
|
|
970
|
-
readonly selfiePath: string;
|
|
971
|
-
readonly livenessPaths: readonly string[];
|
|
972
|
-
} {
|
|
973
|
-
const { selfiePath, livenessPaths } = this._captured;
|
|
974
|
-
if (!selfiePath) {
|
|
975
|
-
throw new MissingRequiredFieldException({ fieldName: "selfieImage" });
|
|
976
|
-
}
|
|
977
|
-
return { selfiePath, livenessPaths };
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
/**
|
|
981
|
-
* Resolve `b.userDetails` for the wire. May legitimately return
|
|
982
|
-
* `undefined` when the token binds every required field
|
|
983
|
-
* (`given_names`, `last_name`, and a contact field) — the
|
|
984
|
-
* `user_details` part is then omitted and the server injects the
|
|
985
|
-
* token's values. Otherwise throws exactly as before token support.
|
|
986
|
-
*/
|
|
987
|
-
private _requireUserDetails(
|
|
988
|
-
config: FlowConfigurationSnapshot,
|
|
989
|
-
): UserDetailsPayload | undefined {
|
|
990
|
-
const userDetails = config.userDetails;
|
|
991
|
-
if (!userDetails) {
|
|
992
|
-
if (bindsRequiredUserDetails(this._resolvedTokenPayload)) {
|
|
993
|
-
return undefined;
|
|
994
|
-
}
|
|
995
|
-
throw new MissingRequiredFieldException({ fieldName: "userDetails" });
|
|
996
|
-
}
|
|
997
|
-
const payload = userDetailsPayloadFrom(
|
|
998
|
-
userDetails,
|
|
999
|
-
this._resolvedTokenPayload,
|
|
1000
|
-
);
|
|
1001
|
-
return isUserDetailsPayloadEmpty(payload) ? undefined : payload;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
/**
|
|
1005
|
-
* Resolve `b.userId` for smartSelfieAuthentication —
|
|
1006
|
-
* `/v3/authentication` requires the prior-enrollment `user_id` to
|
|
1007
|
-
* match the attempt. Throws `MissingRequiredFieldException` if blank.
|
|
1008
|
-
*/
|
|
1009
|
-
private _requireUserId(config: FlowConfigurationSnapshot): string {
|
|
1010
|
-
const userId = config.userId?.trim();
|
|
1011
|
-
if (!userId) {
|
|
1012
|
-
throw new MissingRequiredFieldException({ fieldName: "userId" });
|
|
1013
|
-
}
|
|
1014
|
-
return userId;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
private _requireFrontDocument(): string {
|
|
1018
|
-
const { frontDocumentPath } = this._captured;
|
|
1019
|
-
if (!frontDocumentPath) {
|
|
1020
|
-
throw new MissingRequiredFieldException({ fieldName: "frontDocument" });
|
|
1021
|
-
}
|
|
1022
|
-
return frontDocumentPath;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
/** Capture-artifact fields shared by both document request variants. */
|
|
1026
|
-
private _documentRequestFields(
|
|
1027
|
-
selfie: {
|
|
1028
|
-
readonly selfiePath: string;
|
|
1029
|
-
readonly livenessPaths: readonly string[];
|
|
1030
|
-
},
|
|
1031
|
-
frontDocument: string,
|
|
1032
|
-
): {
|
|
1033
|
-
readonly selfieImage: string;
|
|
1034
|
-
readonly livenessImages: readonly string[];
|
|
1035
|
-
readonly frontDocument: string;
|
|
1036
|
-
readonly backDocument?: string;
|
|
1037
|
-
} {
|
|
1038
|
-
const { backDocumentPath } = this._captured;
|
|
1039
|
-
return {
|
|
1040
|
-
selfieImage: selfie.selfiePath,
|
|
1041
|
-
livenessImages: selfie.livenessPaths,
|
|
1042
|
-
frontDocument,
|
|
1043
|
-
...(backDocumentPath ? { backDocument: backDocumentPath } : {}),
|
|
1044
|
-
};
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
// --- analytics --------------------------------------------------------
|
|
1048
|
-
|
|
1049
|
-
/** Emit terminal `flow_completed` (completed/failed only; not cancelled), then exit via `onExit`. */
|
|
1050
|
-
private _finishFlow(reason: FlowExitReason): void {
|
|
1051
|
-
if (reason.kind === "completed") {
|
|
1052
|
-
const extras: Record<string, string> = {
|
|
1053
|
-
[UseSmileIDAnalyticsParamKeys.result]: "success",
|
|
1054
|
-
};
|
|
1055
|
-
if (reason.job.jobId) {
|
|
1056
|
-
extras[UseSmileIDAnalyticsParamKeys.jobId] = reason.job.jobId;
|
|
1057
|
-
}
|
|
1058
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.flowCompleted, extras);
|
|
1059
|
-
} else if (reason.kind === "failed") {
|
|
1060
|
-
this._logEvent(UseSmileIDAnalyticsEventTypes.flowCompleted, {
|
|
1061
|
-
[UseSmileIDAnalyticsParamKeys.result]: "failure",
|
|
1062
|
-
[UseSmileIDAnalyticsParamKeys.errorMessage]:
|
|
1063
|
-
reason.error instanceof Error
|
|
1064
|
-
? reason.error.message
|
|
1065
|
-
: String(reason.error),
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
this._onExit(reason);
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
/** Forward a lifecycle event to `onAnalyticsEvent`, adding `session_id` + `timestamp`. No-op without a callback. */
|
|
1072
|
-
private _logEvent(
|
|
1073
|
-
type: UseSmileIDAnalyticsEventType,
|
|
1074
|
-
extras: Readonly<Record<string, string>> = {},
|
|
1075
|
-
): void {
|
|
1076
|
-
const onAnalyticsEvent = this._configuration.onAnalyticsEvent;
|
|
1077
|
-
if (!onAnalyticsEvent) return;
|
|
1078
|
-
onAnalyticsEvent({
|
|
1079
|
-
type,
|
|
1080
|
-
extras: {
|
|
1081
|
-
...extras,
|
|
1082
|
-
[UseSmileIDAnalyticsParamKeys.sessionId]: this._sessionId,
|
|
1083
|
-
[UseSmileIDAnalyticsParamKeys.timestamp]: String(Date.now()),
|
|
1084
|
-
},
|
|
1085
|
-
});
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
private _jobTypeName(): string {
|
|
1089
|
-
return String(
|
|
1090
|
-
this._configuration.network?.config?.jobType ?? JobType.unknown,
|
|
1091
|
-
);
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
private _screenAnalyticsName(screen: ScreenSpec): string {
|
|
1095
|
-
const names: Record<ScreenSpec["kind"], string> = {
|
|
1096
|
-
consent: UseSmileIDAnalyticsScreenNames.consent,
|
|
1097
|
-
instructions: UseSmileIDAnalyticsScreenNames.instructions,
|
|
1098
|
-
capture: UseSmileIDAnalyticsScreenNames.capture,
|
|
1099
|
-
preview: UseSmileIDAnalyticsScreenNames.preview,
|
|
1100
|
-
processing: UseSmileIDAnalyticsScreenNames.processing,
|
|
1101
|
-
};
|
|
1102
|
-
return names[screen.kind];
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
// --- subscription -----------------------------------------------------
|
|
1106
|
-
|
|
1107
|
-
/** Subscribe to state changes; returns an unsubscribe (safe after `dispose()`). */
|
|
1108
|
-
subscribe(listener: Listener): () => void {
|
|
1109
|
-
this._listeners.add(listener);
|
|
1110
|
-
return () => {
|
|
1111
|
-
this._listeners.delete(listener);
|
|
1112
|
-
};
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
/** Tear down — drop listeners, make methods no-ops (orchestrator's useEffect cleanup). */
|
|
1116
|
-
dispose(): void {
|
|
1117
|
-
this._disposed = true;
|
|
1118
|
-
this._listeners.clear();
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
/**
|
|
1122
|
-
* Expected liveness image count: ESS uses its fixed count (head-turn
|
|
1123
|
-
* flow self-manages); else the token's livenessImageCount override;
|
|
1124
|
-
* else the ScanPerformanceProfile default (`numSamples - 1`).
|
|
1125
|
-
*/
|
|
1126
|
-
private _expectedLivenessImageCount(): number {
|
|
1127
|
-
const isEnhancedLiveness = this.enhancedLivenessEnabled;
|
|
1128
|
-
if (isEnhancedLiveness) {
|
|
1129
|
-
return EnhancedSmartSelfieConfig.EXPECTED_LIVENESS_IMAGE_COUNT;
|
|
1130
|
-
}
|
|
1131
|
-
const override = numSamplesOverride(this.resolvedSdkConfig);
|
|
1132
|
-
if (override !== undefined) {
|
|
1133
|
-
// numSamplesOverride = livenessImageCount + 1; subtract the selfie.
|
|
1134
|
-
return override - 1;
|
|
1135
|
-
}
|
|
1136
|
-
// Profile numSamples (default Balanced = 8) minus the reference selfie.
|
|
1137
|
-
const profileNumSamples =
|
|
1138
|
-
this._configuration.ml?.analyzers.selfieConfig?.numSamples ??
|
|
1139
|
-
ScanPerformanceProfile.Balanced.numSamples;
|
|
1140
|
-
return profileNumSamples - 1;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
* Decode the partner JWT into its claims (`sdk_config`, `partner_id`). `undefined` for offline
|
|
1145
|
-
* mode, no token, or an unparseable token — SDK defaults apply in those cases.
|
|
1146
|
-
*/
|
|
1147
|
-
private static _decodeToken(
|
|
1148
|
-
configuration: FlowConfigurationSnapshot,
|
|
1149
|
-
): DecodedToken | undefined {
|
|
1150
|
-
if (configuration.config?.allowOfflineMode) return undefined;
|
|
1151
|
-
const token = configuration.network?.config?.token;
|
|
1152
|
-
if (!token || token.length === 0) return undefined;
|
|
1153
|
-
return decodeSmileIDToken(token);
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
private _notify(): void {
|
|
1157
|
-
for (const listener of this._listeners) {
|
|
1158
|
-
try {
|
|
1159
|
-
listener();
|
|
1160
|
-
} catch {
|
|
1161
|
-
// Swallow so one bad listener can't poison the dispatch chain;
|
|
1162
|
-
// the orchestrator-level boundary handles crash reporting.
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
}
|