@smileid/usesmileid 12.0.2 → 12.1.0
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 +7 -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,1471 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* `SmileIDAPI` tests for the v3 `biometric_kyc` and `enhanced_kyc`
|
|
5
|
-
* multipart wire format.
|
|
6
|
-
*
|
|
7
|
-
* The class only ever calls `client.post(url, body, config)` on the
|
|
8
|
-
* injected `AxiosInstance`. We construct a fake instance whose `post`
|
|
9
|
-
* is a `vi.fn()` and inspect each multipart part by reading back the
|
|
10
|
-
* `FormData` it was handed — this mirrors what axios would serialize
|
|
11
|
-
* onto the wire without depending on the real axios module (the
|
|
12
|
-
* pnpm workspace does not install transitive dependencies for the
|
|
13
|
-
* library workspace).
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
vi.mock("axios", () => ({
|
|
17
|
-
__esModule: true,
|
|
18
|
-
default: {
|
|
19
|
-
create: vi.fn(),
|
|
20
|
-
isAxiosError: () => false,
|
|
21
|
-
},
|
|
22
|
-
isAxiosError: () => false,
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
import { SmileIDAPI } from "../smile_id_api";
|
|
26
|
-
import { REQUEST_MAC_OPT_IN_KEY } from "../interceptors/smile_request_mac_interceptor";
|
|
27
|
-
import { ATTESTATION_OPT_IN_KEY } from "../interceptors/smile_integrity_interceptor";
|
|
28
|
-
import { NetworkResponseParseException } from "../../../core/exception/use_smile_id_network_exception";
|
|
29
|
-
import type {
|
|
30
|
-
BiometricKycRequest,
|
|
31
|
-
DocumentVerificationRequest,
|
|
32
|
-
EnhancedDocumentVerificationRequest,
|
|
33
|
-
EnhancedKycRequest,
|
|
34
|
-
SmartSelfieAuthenticationRequest,
|
|
35
|
-
SmartSelfieEnrollmentRequest,
|
|
36
|
-
} from "../../model/job_request";
|
|
37
|
-
import { JobType } from "../../../core/models/job_type";
|
|
38
|
-
import type {
|
|
39
|
-
ConsentInformation,
|
|
40
|
-
UserDetails,
|
|
41
|
-
} from "../../../core/models/params";
|
|
42
|
-
import type { TokenPayload } from "../../model/token_payload";
|
|
43
|
-
import { UseSmileIDMetadata } from "../../../metadata/use_smile_id_metadata";
|
|
44
|
-
|
|
45
|
-
type RecordedCall = {
|
|
46
|
-
url: string;
|
|
47
|
-
body: FormData;
|
|
48
|
-
config?: { headers?: Record<string, string> } & Record<string, unknown>;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
function makeApi(
|
|
52
|
-
partnerOverrides: {
|
|
53
|
-
callbackUrl?: string;
|
|
54
|
-
partnerParams?: Record<string, string>;
|
|
55
|
-
} = {},
|
|
56
|
-
): {
|
|
57
|
-
api: SmileIDAPI;
|
|
58
|
-
calls: RecordedCall[];
|
|
59
|
-
setNextResponse: (data: unknown) => void;
|
|
60
|
-
} {
|
|
61
|
-
const calls: RecordedCall[] = [];
|
|
62
|
-
let nextResponse: unknown = {
|
|
63
|
-
job_id: "job-1",
|
|
64
|
-
user_id: "user-1",
|
|
65
|
-
status: "accepted",
|
|
66
|
-
message: "ok",
|
|
67
|
-
};
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
|
-
const fakeClient: any = {
|
|
70
|
-
post: vi.fn(
|
|
71
|
-
async (
|
|
72
|
-
url: string,
|
|
73
|
-
body: FormData,
|
|
74
|
-
config?: { headers?: Record<string, string> } & Record<string, unknown>,
|
|
75
|
-
) => {
|
|
76
|
-
const call: RecordedCall = { url, body };
|
|
77
|
-
if (config !== undefined) {
|
|
78
|
-
call.config = config;
|
|
79
|
-
}
|
|
80
|
-
calls.push(call);
|
|
81
|
-
return { data: nextResponse };
|
|
82
|
-
},
|
|
83
|
-
),
|
|
84
|
-
};
|
|
85
|
-
const api = new SmileIDAPI(fakeClient, {
|
|
86
|
-
partnerId: "p",
|
|
87
|
-
callbackUrl: partnerOverrides.callbackUrl ?? "",
|
|
88
|
-
useSandbox: true,
|
|
89
|
-
...(partnerOverrides.partnerParams !== undefined
|
|
90
|
-
? { partnerParams: partnerOverrides.partnerParams }
|
|
91
|
-
: {}),
|
|
92
|
-
});
|
|
93
|
-
return {
|
|
94
|
-
api,
|
|
95
|
-
calls,
|
|
96
|
-
setNextResponse: (d) => {
|
|
97
|
-
nextResponse = d;
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const consent: ConsentInformation = Object.freeze({
|
|
103
|
-
granted: true,
|
|
104
|
-
grantedAt: "2026-04-30T00:00:00.000Z",
|
|
105
|
-
noticeLanguage: "EN",
|
|
106
|
-
noticePrivacyPolicyUrl: "https://example.test/p",
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// Per-submission metadata snapshot. The request-construction site
|
|
110
|
-
// builds this and it travels on every `JobRequest`; the API
|
|
111
|
-
// serializes `request.metadata` as the `metadata` multipart part.
|
|
112
|
-
const metadata = new UseSmileIDMetadata({
|
|
113
|
-
sdkVersion: "12.0.2",
|
|
114
|
-
sdk: "react-native-expo",
|
|
115
|
-
deviceOs: "",
|
|
116
|
-
deviceModel: "",
|
|
117
|
-
appName: "",
|
|
118
|
-
sessionId: "test-session-id",
|
|
119
|
-
clientIp: "",
|
|
120
|
-
networkConnection: "",
|
|
121
|
-
carrierInfo: "",
|
|
122
|
-
proxy: false,
|
|
123
|
-
timezone: "",
|
|
124
|
-
locale: "",
|
|
125
|
-
screenResolution: "",
|
|
126
|
-
memoryInfoMb: 0,
|
|
127
|
-
deviceOrientation: "",
|
|
128
|
-
systemArchitecture: "",
|
|
129
|
-
numberOfCameras: 0,
|
|
130
|
-
hostApplication: "",
|
|
131
|
-
proximitySensor: false,
|
|
132
|
-
securityPolicyVersion: "12.0.0",
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Read every multipart part out of a `FormData` instance. The native
|
|
137
|
-
* spec exposes `entries()`; the RN runtime FormData polyfill in
|
|
138
|
-
* tests does too. Returns an array of `[name, value]` tuples
|
|
139
|
-
* preserving insertion order so tests can assert ordering when
|
|
140
|
-
* needed.
|
|
141
|
-
*/
|
|
142
|
-
function dumpFormData(form: FormData): Array<[string, unknown]> {
|
|
143
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
144
|
-
const entries: Array<[string, unknown]> = [];
|
|
145
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
146
|
-
for (const [k, v] of (form as any).entries()) {
|
|
147
|
-
entries.push([k, v]);
|
|
148
|
-
}
|
|
149
|
-
return entries;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function partsByName(form: FormData): Record<string, unknown[]> {
|
|
153
|
-
const out: Record<string, unknown[]> = {};
|
|
154
|
-
for (const [name, value] of dumpFormData(form)) {
|
|
155
|
-
(out[name] ??= []).push(value);
|
|
156
|
-
}
|
|
157
|
-
return out;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Read a JSON-content multipart part as a string. The SDK appends
|
|
162
|
-
* JSON parts as plain text form fields carrying the JSON-serialized
|
|
163
|
-
* value as the part body (no per-part `Content-Type` header — the
|
|
164
|
-
* live server's multipart parser rejects parts tagged
|
|
165
|
-
* `application/json` as "missing or invalid"). Node's native
|
|
166
|
-
* `FormData` stores text form-field values as plain strings; this
|
|
167
|
-
* helper coerces defensively in case a future runtime wraps them.
|
|
168
|
-
*/
|
|
169
|
-
/**
|
|
170
|
-
* A value carrying an async `text()` reader. The runtime `Blob` (Node /
|
|
171
|
-
* vitest) exposes `text(): Promise<string>`, but the ambient `Blob` type
|
|
172
|
-
* pulled in via `react-native` types does not declare it, so the helper
|
|
173
|
-
* narrows structurally on the method it actually calls.
|
|
174
|
-
*/
|
|
175
|
-
type TextReadable = { text(): Promise<string> };
|
|
176
|
-
|
|
177
|
-
function hasTextReader(value: unknown): value is TextReadable {
|
|
178
|
-
return (
|
|
179
|
-
typeof Blob !== "undefined" &&
|
|
180
|
-
value instanceof Blob &&
|
|
181
|
-
typeof (value as { text?: unknown }).text === "function"
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
async function readJsonPart(part: unknown): Promise<string> {
|
|
186
|
-
if (hasTextReader(part)) {
|
|
187
|
-
return await part.text();
|
|
188
|
-
}
|
|
189
|
-
return String(part);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Assert that a JSON multipart part is NOT tagged with a per-part
|
|
194
|
-
* `Content-Type: application/json` header. Concrete scenario: the
|
|
195
|
-
* live server's multipart parser expects `user_details`, `consent`,
|
|
196
|
-
* `metadata`, and `partner_params` as plain text form fields and
|
|
197
|
-
* rejects parts tagged `application/json` as "missing or invalid".
|
|
198
|
-
* This assertion pins the wire shape so a regression that wraps the
|
|
199
|
-
* value in a `Blob({ type: "application/json" })` would fail here.
|
|
200
|
-
*/
|
|
201
|
-
function expectNoJsonContentType(part: unknown): void {
|
|
202
|
-
// A plain-string form-field value has no `.type` to inspect. If the
|
|
203
|
-
// runtime did wrap the value in a `Blob`, its `type` MUST NOT be
|
|
204
|
-
// `application/json` (or any other MIME type that would tag the
|
|
205
|
-
// multipart part on the wire).
|
|
206
|
-
if (typeof Blob !== "undefined" && part instanceof Blob) {
|
|
207
|
-
expect((part as Blob).type).not.toBe("application/json");
|
|
208
|
-
} else {
|
|
209
|
-
expect(typeof part).toBe("string");
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
describe("SmileIDAPI.biometricKyc", () => {
|
|
214
|
-
function makeRequest(
|
|
215
|
-
overrides: Partial<BiometricKycRequest["params"]> & {
|
|
216
|
-
userDetails?: UserDetails;
|
|
217
|
-
} = {},
|
|
218
|
-
): BiometricKycRequest {
|
|
219
|
-
const { userDetails: userDetailsOverride, ...paramOverrides } = overrides;
|
|
220
|
-
return {
|
|
221
|
-
jobType: JobType.biometricKyc,
|
|
222
|
-
selfieImage: "file:///selfie.jpg",
|
|
223
|
-
livenessImages: [
|
|
224
|
-
"file:///l1.jpg",
|
|
225
|
-
"file:///l2.jpg",
|
|
226
|
-
"file:///l3.jpg",
|
|
227
|
-
"file:///l4.jpg",
|
|
228
|
-
"file:///l5.jpg",
|
|
229
|
-
"file:///l6.jpg",
|
|
230
|
-
"file:///l7.jpg",
|
|
231
|
-
],
|
|
232
|
-
consent,
|
|
233
|
-
metadata,
|
|
234
|
-
expectedLivenessImageCount: 7,
|
|
235
|
-
userDetails: userDetailsOverride ?? {
|
|
236
|
-
givenNames: "John",
|
|
237
|
-
lastName: "Doe",
|
|
238
|
-
email: "john@example.test",
|
|
239
|
-
phoneNumber: "+254700000000",
|
|
240
|
-
},
|
|
241
|
-
params: {
|
|
242
|
-
idType: "NATIONAL_ID",
|
|
243
|
-
idNumber: "32232403",
|
|
244
|
-
country: "KE",
|
|
245
|
-
// `useEnrolledImage` is non-nullable on the public type;
|
|
246
|
-
// tests default to `false` and individual cases opt into
|
|
247
|
-
// `true` via `overrides`.
|
|
248
|
-
useEnrolledImage: false,
|
|
249
|
-
...paramOverrides,
|
|
250
|
-
},
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
it("sends a `user_details` JSON multipart part with snake_case keys", async () => {
|
|
255
|
-
const { api, calls } = makeApi();
|
|
256
|
-
await api.biometricKyc(makeRequest());
|
|
257
|
-
expect(calls).toHaveLength(1);
|
|
258
|
-
const parts = partsByName(calls[0]!.body);
|
|
259
|
-
expect(parts["user_details"]).toBeDefined();
|
|
260
|
-
const userDetailsRaw = await readJsonPart(parts["user_details"]![0]);
|
|
261
|
-
const parsed = JSON.parse(userDetailsRaw);
|
|
262
|
-
expect(parsed).toEqual({
|
|
263
|
-
given_names: "John",
|
|
264
|
-
last_name: "Doe",
|
|
265
|
-
email: "john@example.test",
|
|
266
|
-
phone_number: "+254700000000",
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
it("sends the `user_details` part as a plain text form field (no application/json tag)", async () => {
|
|
271
|
-
// Concrete scenario: the live server's multipart parser rejects
|
|
272
|
-
// parts tagged `Content-Type: application/json` with "missing or
|
|
273
|
-
// invalid" — it expects `user_details`, `consent`, `metadata`,
|
|
274
|
-
// and `partner_params` as plain text form fields (Postman
|
|
275
|
-
// `"type": "text"`) carrying a JSON-serialized string value.
|
|
276
|
-
// This test pins the wire shape so a future refactor that wraps
|
|
277
|
-
// the value in a `Blob({ type: "application/json" })` would
|
|
278
|
-
// surface as a regression here.
|
|
279
|
-
const { api, calls } = makeApi();
|
|
280
|
-
await api.biometricKyc(makeRequest());
|
|
281
|
-
const parts = partsByName(calls[0]!.body);
|
|
282
|
-
expectNoJsonContentType(parts["user_details"]![0]);
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
it("sends the `consent` part as a plain text form field (no application/json tag)", async () => {
|
|
286
|
-
const { api, calls } = makeApi();
|
|
287
|
-
await api.biometricKyc(makeRequest());
|
|
288
|
-
const parts = partsByName(calls[0]!.body);
|
|
289
|
-
expectNoJsonContentType(parts["consent"]![0]);
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
it("serializes the `metadata` part from `request.metadata` (built at the request-construction site)", async () => {
|
|
293
|
-
// Concrete scenario: the metadata snapshot is built by the flow
|
|
294
|
-
// navigation manager and travels on the request. The API no longer
|
|
295
|
-
// holds a metadata provider — it serializes `request.metadata`
|
|
296
|
-
// directly. This pins that the `session_id` entry (and the array
|
|
297
|
-
// wire shape) come from the request's own snapshot.
|
|
298
|
-
const { api, calls } = makeApi();
|
|
299
|
-
await api.biometricKyc(makeRequest());
|
|
300
|
-
const parts = partsByName(calls[0]!.body);
|
|
301
|
-
expect(parts["metadata"]).toBeDefined();
|
|
302
|
-
expectNoJsonContentType(parts["metadata"]![0]);
|
|
303
|
-
const parsed = JSON.parse(await readJsonPart(parts["metadata"]![0]));
|
|
304
|
-
expect(parsed).toEqual(metadata.toEntries());
|
|
305
|
-
const sessionEntry = (
|
|
306
|
-
parsed as Array<{ name: string; value: string }>
|
|
307
|
-
).find((entry) => entry.name === "session_id");
|
|
308
|
-
expect(sessionEntry?.value).toBe("test-session-id");
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
it("sends the `partner_params` part as a plain text form field (no application/json tag)", async () => {
|
|
312
|
-
const { api, calls } = makeApi({ partnerParams: { jobRef: "ref-1" } });
|
|
313
|
-
await api.biometricKyc(makeRequest());
|
|
314
|
-
const parts = partsByName(calls[0]!.body);
|
|
315
|
-
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
316
|
-
});
|
|
317
|
-
|
|
318
|
-
it("does NOT send the legacy flat PII parts (server strips them anyway)", async () => {
|
|
319
|
-
const { api, calls } = makeApi();
|
|
320
|
-
await api.biometricKyc(makeRequest());
|
|
321
|
-
const parts = partsByName(calls[0]!.body);
|
|
322
|
-
expect(parts["given_names"]).toBeUndefined();
|
|
323
|
-
expect(parts["last_name"]).toBeUndefined();
|
|
324
|
-
expect(parts["email"]).toBeUndefined();
|
|
325
|
-
expect(parts["phone_number"]).toBeUndefined();
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
it("omits `email` and `phone_number` from user_details when empty", async () => {
|
|
329
|
-
const { api, calls } = makeApi();
|
|
330
|
-
await api.biometricKyc(
|
|
331
|
-
makeRequest({
|
|
332
|
-
userDetails: {
|
|
333
|
-
givenNames: "John",
|
|
334
|
-
lastName: "Doe",
|
|
335
|
-
phoneNumber: "+254700000000",
|
|
336
|
-
},
|
|
337
|
-
}),
|
|
338
|
-
);
|
|
339
|
-
const parts = partsByName(calls[0]!.body);
|
|
340
|
-
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
341
|
-
expect(parsed).toEqual({
|
|
342
|
-
given_names: "John",
|
|
343
|
-
last_name: "Doe",
|
|
344
|
-
phone_number: "+254700000000",
|
|
345
|
-
});
|
|
346
|
-
expect(parsed.email).toBeUndefined();
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
it("trims whitespace and omits whitespace only optional user_details fields", async () => {
|
|
350
|
-
const { api, calls } = makeApi();
|
|
351
|
-
await api.biometricKyc(
|
|
352
|
-
makeRequest({
|
|
353
|
-
userDetails: {
|
|
354
|
-
givenNames: "John",
|
|
355
|
-
lastName: "Doe",
|
|
356
|
-
email: " john@example.test ",
|
|
357
|
-
phoneNumber: " ",
|
|
358
|
-
},
|
|
359
|
-
}),
|
|
360
|
-
);
|
|
361
|
-
const parts = partsByName(calls[0]!.body);
|
|
362
|
-
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
363
|
-
expect(parsed.email).toBe("john@example.test");
|
|
364
|
-
expect(parsed.phone_number).toBeUndefined();
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
it("appends `use_enrolled_image=true` and still sends selfie + liveness when set", async () => {
|
|
368
|
-
const { api, calls } = makeApi();
|
|
369
|
-
await api.biometricKyc(makeRequest({ useEnrolledImage: true }));
|
|
370
|
-
const parts = partsByName(calls[0]!.body);
|
|
371
|
-
expect(parts["use_enrolled_image"]).toEqual(["true"]);
|
|
372
|
-
expect(parts["selfie_image"]).toHaveLength(1);
|
|
373
|
-
expect(parts["liveness_images"]).toHaveLength(7);
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
it("omits `use_enrolled_image` part by default and sends selfie + liveness", async () => {
|
|
377
|
-
const { api, calls } = makeApi();
|
|
378
|
-
await api.biometricKyc(makeRequest());
|
|
379
|
-
const parts = partsByName(calls[0]!.body);
|
|
380
|
-
expect(parts["use_enrolled_image"]).toBeUndefined();
|
|
381
|
-
expect(parts["selfie_image"]).toHaveLength(1);
|
|
382
|
-
expect(parts["liveness_images"]).toHaveLength(7);
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
it("never serializes user_id as a multipart part", async () => {
|
|
386
|
-
const { api, calls } = makeApi();
|
|
387
|
-
await api.biometricKyc(makeRequest());
|
|
388
|
-
const parts = partsByName(calls[0]!.body);
|
|
389
|
-
expect(parts["user_id"]).toBeUndefined();
|
|
390
|
-
});
|
|
391
|
-
|
|
392
|
-
it("emits `callback_url` part from PartnerConfig.callbackUrl when set", async () => {
|
|
393
|
-
// Concrete scenario: partner configures `p.callbackUrl =
|
|
394
|
-
// 'https://partner.test/cb'` at the SDK level. `PartnerConfig` is
|
|
395
|
-
// the sole source for `callback_url` on Biometric KYC submissions
|
|
396
|
-
// — symmetric with Enhanced KYC and the canonical SDKs.
|
|
397
|
-
const { api, calls } = makeApi({
|
|
398
|
-
callbackUrl: "https://partner.test/cb",
|
|
399
|
-
});
|
|
400
|
-
await api.biometricKyc(makeRequest());
|
|
401
|
-
const parts = partsByName(calls[0]!.body);
|
|
402
|
-
expect(parts["callback_url"]).toEqual(["https://partner.test/cb"]);
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
it("omits `callback_url` part when PartnerConfig.callbackUrl is empty", async () => {
|
|
406
|
-
const { api, calls } = makeApi();
|
|
407
|
-
await api.biometricKyc(makeRequest());
|
|
408
|
-
const parts = partsByName(calls[0]!.body);
|
|
409
|
-
expect(parts["callback_url"]).toBeUndefined();
|
|
410
|
-
});
|
|
411
|
-
|
|
412
|
-
it("emits `partner_params` JSON part from PartnerConfig.partnerParams when set", async () => {
|
|
413
|
-
const { api, calls } = makeApi({
|
|
414
|
-
partnerParams: { jobRef: "ref-1", sessionId: "s-1" },
|
|
415
|
-
});
|
|
416
|
-
await api.biometricKyc(makeRequest());
|
|
417
|
-
const parts = partsByName(calls[0]!.body);
|
|
418
|
-
expect(parts["partner_params"]).toBeDefined();
|
|
419
|
-
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
420
|
-
const parsed = JSON.parse(await readJsonPart(parts["partner_params"]![0]));
|
|
421
|
-
expect(parsed).toEqual({ jobRef: "ref-1", sessionId: "s-1" });
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
it("omits `partner_params` part when PartnerConfig.partnerParams is unset", async () => {
|
|
425
|
-
const { api, calls } = makeApi();
|
|
426
|
-
await api.biometricKyc(makeRequest());
|
|
427
|
-
const parts = partsByName(calls[0]!.body);
|
|
428
|
-
expect(parts["partner_params"]).toBeUndefined();
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
it("posts to `/v3/biometric_kyc`", async () => {
|
|
432
|
-
const { api, calls } = makeApi();
|
|
433
|
-
await api.biometricKyc(makeRequest());
|
|
434
|
-
expect(calls[0]!.url).toBe("/v3/biometric_kyc");
|
|
435
|
-
});
|
|
436
|
-
});
|
|
437
|
-
|
|
438
|
-
describe("SmileIDAPI.enhancedKyc", () => {
|
|
439
|
-
function makeRequest(
|
|
440
|
-
overrides: Partial<EnhancedKycRequest["params"]> & {
|
|
441
|
-
userDetails?: UserDetails;
|
|
442
|
-
} = {},
|
|
443
|
-
): EnhancedKycRequest {
|
|
444
|
-
const { userDetails: userDetailsOverride, ...paramOverrides } = overrides;
|
|
445
|
-
return {
|
|
446
|
-
jobType: JobType.enhancedKyc,
|
|
447
|
-
consent,
|
|
448
|
-
metadata,
|
|
449
|
-
userDetails: userDetailsOverride ?? {
|
|
450
|
-
givenNames: "John",
|
|
451
|
-
lastName: "Doe",
|
|
452
|
-
email: "john@example.test",
|
|
453
|
-
phoneNumber: "+254700000000",
|
|
454
|
-
},
|
|
455
|
-
params: {
|
|
456
|
-
idType: "NATIONAL_ID",
|
|
457
|
-
idNumber: "32232403",
|
|
458
|
-
country: "KE",
|
|
459
|
-
...paramOverrides,
|
|
460
|
-
},
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
it("sends user_details and the three id fields, no flat PII", async () => {
|
|
465
|
-
const { api, calls } = makeApi();
|
|
466
|
-
await api.enhancedKyc(makeRequest());
|
|
467
|
-
const parts = partsByName(calls[0]!.body);
|
|
468
|
-
expect(parts["id_type"]).toEqual(["NATIONAL_ID"]);
|
|
469
|
-
expect(parts["id_number"]).toEqual(["32232403"]);
|
|
470
|
-
expect(parts["country"]).toEqual(["KE"]);
|
|
471
|
-
expect(parts["user_details"]).toBeDefined();
|
|
472
|
-
expect(parts["given_names"]).toBeUndefined();
|
|
473
|
-
expect(parts["last_name"]).toBeUndefined();
|
|
474
|
-
});
|
|
475
|
-
|
|
476
|
-
it("sends `bank_code` part when set", async () => {
|
|
477
|
-
const { api, calls } = makeApi();
|
|
478
|
-
await api.enhancedKyc(makeRequest({ bankCode: "044" }));
|
|
479
|
-
const parts = partsByName(calls[0]!.body);
|
|
480
|
-
expect(parts["bank_code"]).toEqual(["044"]);
|
|
481
|
-
});
|
|
482
|
-
|
|
483
|
-
it("sends `operator` part when mobileOperator is set (TS name maps to wire key)", async () => {
|
|
484
|
-
const { api, calls } = makeApi();
|
|
485
|
-
await api.enhancedKyc(makeRequest({ mobileOperator: "MTN" }));
|
|
486
|
-
const parts = partsByName(calls[0]!.body);
|
|
487
|
-
// TS public field is `mobileOperator`; wire key stays `operator`.
|
|
488
|
-
expect(parts["operator"]).toEqual(["MTN"]);
|
|
489
|
-
expect(parts["mobile_operator"]).toBeUndefined();
|
|
490
|
-
expect(parts["mobileOperator"]).toBeUndefined();
|
|
491
|
-
});
|
|
492
|
-
|
|
493
|
-
it("omits `bank_code` and `operator` parts when unset", async () => {
|
|
494
|
-
const { api, calls } = makeApi();
|
|
495
|
-
await api.enhancedKyc(makeRequest());
|
|
496
|
-
const parts = partsByName(calls[0]!.body);
|
|
497
|
-
expect(parts["bank_code"]).toBeUndefined();
|
|
498
|
-
expect(parts["operator"]).toBeUndefined();
|
|
499
|
-
});
|
|
500
|
-
|
|
501
|
-
it("sends the `user_details` part as a plain text form field (no application/json tag)", async () => {
|
|
502
|
-
const { api, calls } = makeApi();
|
|
503
|
-
await api.enhancedKyc(makeRequest());
|
|
504
|
-
const parts = partsByName(calls[0]!.body);
|
|
505
|
-
expectNoJsonContentType(parts["user_details"]![0]);
|
|
506
|
-
});
|
|
507
|
-
|
|
508
|
-
it("posts to `/v3/enhanced_kyc`", async () => {
|
|
509
|
-
const { api, calls } = makeApi();
|
|
510
|
-
await api.enhancedKyc(makeRequest());
|
|
511
|
-
expect(calls[0]!.url).toBe("/v3/enhanced_kyc");
|
|
512
|
-
});
|
|
513
|
-
|
|
514
|
-
it("emits `callback_url` part from PartnerConfig.callbackUrl when set", async () => {
|
|
515
|
-
// Concrete scenario: partner configures `p.callbackUrl =
|
|
516
|
-
// 'https://partner.test/cb'` at the SDK level (not per-job). The
|
|
517
|
-
// server expects the callback URL as the `callback_url` multipart
|
|
518
|
-
// part, in addition to the `callback-url` HTTP header that the
|
|
519
|
-
// auth interceptor adds on every request.
|
|
520
|
-
const { api, calls } = makeApi({
|
|
521
|
-
callbackUrl: "https://partner.test/cb",
|
|
522
|
-
});
|
|
523
|
-
await api.enhancedKyc(makeRequest());
|
|
524
|
-
const parts = partsByName(calls[0]!.body);
|
|
525
|
-
expect(parts["callback_url"]).toEqual(["https://partner.test/cb"]);
|
|
526
|
-
});
|
|
527
|
-
|
|
528
|
-
it("omits `callback_url` part when PartnerConfig.callbackUrl is empty", async () => {
|
|
529
|
-
const { api, calls } = makeApi();
|
|
530
|
-
await api.enhancedKyc(makeRequest());
|
|
531
|
-
const parts = partsByName(calls[0]!.body);
|
|
532
|
-
expect(parts["callback_url"]).toBeUndefined();
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
it("emits `partner_params` JSON part from PartnerConfig.partnerParams when set", async () => {
|
|
536
|
-
const { api, calls } = makeApi({
|
|
537
|
-
partnerParams: { jobRef: "ref-1", sessionId: "s-1" },
|
|
538
|
-
});
|
|
539
|
-
await api.enhancedKyc(makeRequest());
|
|
540
|
-
const parts = partsByName(calls[0]!.body);
|
|
541
|
-
expect(parts["partner_params"]).toBeDefined();
|
|
542
|
-
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
543
|
-
const parsed = JSON.parse(await readJsonPart(parts["partner_params"]![0]));
|
|
544
|
-
expect(parsed).toEqual({ jobRef: "ref-1", sessionId: "s-1" });
|
|
545
|
-
});
|
|
546
|
-
|
|
547
|
-
it("omits `partner_params` part when PartnerConfig.partnerParams is unset", async () => {
|
|
548
|
-
const { api, calls } = makeApi();
|
|
549
|
-
await api.enhancedKyc(makeRequest());
|
|
550
|
-
const parts = partsByName(calls[0]!.body);
|
|
551
|
-
expect(parts["partner_params"]).toBeUndefined();
|
|
552
|
-
});
|
|
553
|
-
});
|
|
554
|
-
|
|
555
|
-
describe("SmileIDAPI.documentVerification / enhancedDocumentVerification", () => {
|
|
556
|
-
const livenessImages: readonly string[] = [
|
|
557
|
-
"file:///l1.jpg",
|
|
558
|
-
"file:///l2.jpg",
|
|
559
|
-
"file:///l3.jpg",
|
|
560
|
-
"file:///l4.jpg",
|
|
561
|
-
"file:///l5.jpg",
|
|
562
|
-
"file:///l6.jpg",
|
|
563
|
-
"file:///l7.jpg",
|
|
564
|
-
];
|
|
565
|
-
|
|
566
|
-
const baseUserDetails: UserDetails = {
|
|
567
|
-
givenNames: "John",
|
|
568
|
-
lastName: "Doe",
|
|
569
|
-
email: "john@example.test",
|
|
570
|
-
phoneNumber: "+254700000000",
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
function documentRequest(
|
|
574
|
-
overrides: Partial<DocumentVerificationRequest> = {},
|
|
575
|
-
): DocumentVerificationRequest {
|
|
576
|
-
return {
|
|
577
|
-
jobType: JobType.documentVerification,
|
|
578
|
-
selfieImage: "file:///selfie.jpg",
|
|
579
|
-
livenessImages,
|
|
580
|
-
frontDocument: "file:///front.jpg",
|
|
581
|
-
country: "KE",
|
|
582
|
-
userDetails: baseUserDetails,
|
|
583
|
-
consent,
|
|
584
|
-
metadata,
|
|
585
|
-
expectedLivenessImageCount: 7,
|
|
586
|
-
...overrides,
|
|
587
|
-
};
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
function enhancedRequest(
|
|
591
|
-
overrides: Partial<EnhancedDocumentVerificationRequest> = {},
|
|
592
|
-
): EnhancedDocumentVerificationRequest {
|
|
593
|
-
return {
|
|
594
|
-
jobType: JobType.enhancedDocumentVerification,
|
|
595
|
-
selfieImage: "file:///selfie.jpg",
|
|
596
|
-
livenessImages,
|
|
597
|
-
frontDocument: "file:///front.jpg",
|
|
598
|
-
country: "KE",
|
|
599
|
-
idType: "NATIONAL_ID",
|
|
600
|
-
userDetails: baseUserDetails,
|
|
601
|
-
consent,
|
|
602
|
-
metadata,
|
|
603
|
-
expectedLivenessImageCount: 7,
|
|
604
|
-
...overrides,
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
it("names the front document part `document` — NOT `front_document`", async () => {
|
|
609
|
-
const { api, calls } = makeApi();
|
|
610
|
-
await api.documentVerification(documentRequest());
|
|
611
|
-
const parts = partsByName(calls[0]!.body);
|
|
612
|
-
expect(parts["document"]).toHaveLength(1);
|
|
613
|
-
expect(parts["front_document"]).toBeUndefined();
|
|
614
|
-
});
|
|
615
|
-
|
|
616
|
-
it("names the back document part `document_back` — NOT `back_document` — when present", async () => {
|
|
617
|
-
const { api, calls } = makeApi();
|
|
618
|
-
await api.documentVerification(
|
|
619
|
-
documentRequest({ backDocument: "file:///back.jpg" }),
|
|
620
|
-
);
|
|
621
|
-
const parts = partsByName(calls[0]!.body);
|
|
622
|
-
expect(parts["document_back"]).toHaveLength(1);
|
|
623
|
-
expect(parts["back_document"]).toBeUndefined();
|
|
624
|
-
});
|
|
625
|
-
|
|
626
|
-
it("omits the `document_back` part when no back image was captured", async () => {
|
|
627
|
-
const { api, calls } = makeApi();
|
|
628
|
-
await api.documentVerification(documentRequest());
|
|
629
|
-
const parts = partsByName(calls[0]!.body);
|
|
630
|
-
expect(parts["document_back"]).toBeUndefined();
|
|
631
|
-
});
|
|
632
|
-
|
|
633
|
-
it("sends selfie + liveness + country + user_details parts", async () => {
|
|
634
|
-
const { api, calls } = makeApi();
|
|
635
|
-
await api.documentVerification(documentRequest());
|
|
636
|
-
const parts = partsByName(calls[0]!.body);
|
|
637
|
-
expect(parts["selfie_image"]).toHaveLength(1);
|
|
638
|
-
expect(parts["liveness_images"]).toHaveLength(7);
|
|
639
|
-
expect(parts["country"]).toEqual(["KE"]);
|
|
640
|
-
expect(parts["user_details"]).toBeDefined();
|
|
641
|
-
expectNoJsonContentType(parts["user_details"]![0]);
|
|
642
|
-
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
643
|
-
expect(parsed).toEqual({
|
|
644
|
-
given_names: "John",
|
|
645
|
-
last_name: "Doe",
|
|
646
|
-
email: "john@example.test",
|
|
647
|
-
phone_number: "+254700000000",
|
|
648
|
-
});
|
|
649
|
-
});
|
|
650
|
-
|
|
651
|
-
it("omits `id_type` on document_verification when the request leaves it unset", async () => {
|
|
652
|
-
const { api, calls } = makeApi();
|
|
653
|
-
await api.documentVerification(documentRequest());
|
|
654
|
-
const parts = partsByName(calls[0]!.body);
|
|
655
|
-
expect(parts["id_type"]).toBeUndefined();
|
|
656
|
-
});
|
|
657
|
-
|
|
658
|
-
it("sends `id_type` on document_verification when supplied", async () => {
|
|
659
|
-
const { api, calls } = makeApi();
|
|
660
|
-
await api.documentVerification(documentRequest({ idType: "PASSPORT" }));
|
|
661
|
-
const parts = partsByName(calls[0]!.body);
|
|
662
|
-
expect(parts["id_type"]).toEqual(["PASSPORT"]);
|
|
663
|
-
});
|
|
664
|
-
|
|
665
|
-
it("always sends `id_type` (required) on enhanced_document_verification", async () => {
|
|
666
|
-
const { api, calls } = makeApi();
|
|
667
|
-
await api.enhancedDocumentVerification(enhancedRequest());
|
|
668
|
-
const parts = partsByName(calls[0]!.body);
|
|
669
|
-
expect(parts["id_type"]).toEqual(["NATIONAL_ID"]);
|
|
670
|
-
expect(parts["country"]).toEqual(["KE"]);
|
|
671
|
-
expect(parts["document"]).toHaveLength(1);
|
|
672
|
-
});
|
|
673
|
-
|
|
674
|
-
it("forwards PartnerConfig.callbackUrl and partnerParams as multipart parts", async () => {
|
|
675
|
-
const { api, calls } = makeApi({
|
|
676
|
-
callbackUrl: "https://partner.test/cb",
|
|
677
|
-
partnerParams: { jobRef: "ref-1" },
|
|
678
|
-
});
|
|
679
|
-
await api.documentVerification(documentRequest());
|
|
680
|
-
const parts = partsByName(calls[0]!.body);
|
|
681
|
-
expect(parts["callback_url"]).toEqual(["https://partner.test/cb"]);
|
|
682
|
-
expect(parts["partner_params"]).toBeDefined();
|
|
683
|
-
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
684
|
-
});
|
|
685
|
-
|
|
686
|
-
it("posts to the canonical document endpoints", async () => {
|
|
687
|
-
const { api, calls } = makeApi();
|
|
688
|
-
await api.documentVerification(documentRequest());
|
|
689
|
-
await api.enhancedDocumentVerification(enhancedRequest());
|
|
690
|
-
expect(calls[0]!.url).toBe("/v3/document_verification");
|
|
691
|
-
expect(calls[1]!.url).toBe("/v3/enhanced_document_verification");
|
|
692
|
-
});
|
|
693
|
-
});
|
|
694
|
-
|
|
695
|
-
describe("SmileIDAPI response mapping (job_id, user_id, created_at)", () => {
|
|
696
|
-
it("parses snake_case wire keys into camelCase fields including createdAt", async () => {
|
|
697
|
-
const { api, calls, setNextResponse } = makeApi();
|
|
698
|
-
setNextResponse({
|
|
699
|
-
job_id: "job-XYZ",
|
|
700
|
-
user_id: "user-XYZ",
|
|
701
|
-
status: "accepted",
|
|
702
|
-
message: "Request accepted and queued for processing.",
|
|
703
|
-
created_at: "2026-05-05T15:00:00.000Z",
|
|
704
|
-
});
|
|
705
|
-
const response = await api.enhancedKyc({
|
|
706
|
-
jobType: JobType.enhancedKyc,
|
|
707
|
-
consent,
|
|
708
|
-
metadata,
|
|
709
|
-
userDetails: {
|
|
710
|
-
givenNames: "John",
|
|
711
|
-
lastName: "Doe",
|
|
712
|
-
email: "john@example.test",
|
|
713
|
-
},
|
|
714
|
-
params: {
|
|
715
|
-
idType: "NATIONAL_ID",
|
|
716
|
-
idNumber: "1",
|
|
717
|
-
country: "KE",
|
|
718
|
-
},
|
|
719
|
-
});
|
|
720
|
-
expect(calls).toHaveLength(1);
|
|
721
|
-
expect(response.jobId).toBe("job-XYZ");
|
|
722
|
-
expect(response.userId).toBe("user-XYZ");
|
|
723
|
-
expect(response.status).toBe("accepted");
|
|
724
|
-
expect(response.createdAt).toBe("2026-05-05T15:00:00.000Z");
|
|
725
|
-
});
|
|
726
|
-
|
|
727
|
-
it("leaves createdAt undefined when the server omits it", async () => {
|
|
728
|
-
const { api, setNextResponse } = makeApi();
|
|
729
|
-
setNextResponse({
|
|
730
|
-
job_id: "job-1",
|
|
731
|
-
user_id: "user-1",
|
|
732
|
-
status: "accepted",
|
|
733
|
-
message: "ok",
|
|
734
|
-
});
|
|
735
|
-
const response = await api.enhancedKyc({
|
|
736
|
-
jobType: JobType.enhancedKyc,
|
|
737
|
-
consent,
|
|
738
|
-
metadata,
|
|
739
|
-
userDetails: {
|
|
740
|
-
givenNames: "John",
|
|
741
|
-
lastName: "Doe",
|
|
742
|
-
email: "john@example.test",
|
|
743
|
-
},
|
|
744
|
-
params: {
|
|
745
|
-
idType: "NATIONAL_ID",
|
|
746
|
-
idNumber: "1",
|
|
747
|
-
country: "KE",
|
|
748
|
-
},
|
|
749
|
-
});
|
|
750
|
-
expect(response.createdAt).toBeUndefined();
|
|
751
|
-
});
|
|
752
|
-
|
|
753
|
-
it("throws when the server returns a null body", async () => {
|
|
754
|
-
const { api, setNextResponse } = makeApi();
|
|
755
|
-
setNextResponse(null);
|
|
756
|
-
await expect(
|
|
757
|
-
api.enhancedKyc({
|
|
758
|
-
jobType: JobType.enhancedKyc,
|
|
759
|
-
consent,
|
|
760
|
-
metadata,
|
|
761
|
-
userDetails: {
|
|
762
|
-
givenNames: "John",
|
|
763
|
-
lastName: "Doe",
|
|
764
|
-
email: "john@example.test",
|
|
765
|
-
},
|
|
766
|
-
params: {
|
|
767
|
-
idType: "NATIONAL_ID",
|
|
768
|
-
idNumber: "1",
|
|
769
|
-
country: "KE",
|
|
770
|
-
},
|
|
771
|
-
}),
|
|
772
|
-
).rejects.toThrow(/empty or non.object/i);
|
|
773
|
-
});
|
|
774
|
-
|
|
775
|
-
it("throws when the server returns an array body", async () => {
|
|
776
|
-
const { api, setNextResponse } = makeApi();
|
|
777
|
-
setNextResponse([]);
|
|
778
|
-
await expect(
|
|
779
|
-
api.enhancedKyc({
|
|
780
|
-
jobType: JobType.enhancedKyc,
|
|
781
|
-
consent,
|
|
782
|
-
metadata,
|
|
783
|
-
userDetails: {
|
|
784
|
-
givenNames: "John",
|
|
785
|
-
lastName: "Doe",
|
|
786
|
-
email: "john@example.test",
|
|
787
|
-
},
|
|
788
|
-
params: {
|
|
789
|
-
idType: "NATIONAL_ID",
|
|
790
|
-
idNumber: "1",
|
|
791
|
-
country: "KE",
|
|
792
|
-
},
|
|
793
|
-
}),
|
|
794
|
-
).rejects.toThrow(/empty or non.object/i);
|
|
795
|
-
});
|
|
796
|
-
});
|
|
797
|
-
|
|
798
|
-
describe("SmileIDAPI.smartSelfieEnrollment", () => {
|
|
799
|
-
function makeRequest(
|
|
800
|
-
userDetailsOverride?: UserDetails,
|
|
801
|
-
): SmartSelfieEnrollmentRequest {
|
|
802
|
-
return {
|
|
803
|
-
jobType: JobType.smartSelfieEnrollment,
|
|
804
|
-
selfieImage: "file:///selfie.jpg",
|
|
805
|
-
// 7-frame canonical liveness count — matches the
|
|
806
|
-
// `REQUIRED_LIVENESS_FRAME_COUNT` enforced by `SmileIDAPI`.
|
|
807
|
-
livenessImages: [
|
|
808
|
-
"file:///l1.jpg",
|
|
809
|
-
"file:///l2.jpg",
|
|
810
|
-
"file:///l3.jpg",
|
|
811
|
-
"file:///l4.jpg",
|
|
812
|
-
"file:///l5.jpg",
|
|
813
|
-
"file:///l6.jpg",
|
|
814
|
-
"file:///l7.jpg",
|
|
815
|
-
],
|
|
816
|
-
consent,
|
|
817
|
-
metadata,
|
|
818
|
-
expectedLivenessImageCount: 7,
|
|
819
|
-
userDetails: userDetailsOverride ?? {
|
|
820
|
-
givenNames: "John",
|
|
821
|
-
lastName: "Doe",
|
|
822
|
-
email: "john@example.test",
|
|
823
|
-
phoneNumber: "+254700000000",
|
|
824
|
-
},
|
|
825
|
-
enhanced: false,
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
it("posts to the canonical `/v3/registration` path", async () => {
|
|
830
|
-
// Concrete scenario: the previous behavior selected a different
|
|
831
|
-
// URL when `enhanced: true`. The lambda only routes on
|
|
832
|
-
// `/v3/registration` for smart-selfie enrollment, so both paths
|
|
833
|
-
// collapse onto the canonical URL.
|
|
834
|
-
const { api, calls } = makeApi();
|
|
835
|
-
await api.smartSelfieEnrollment(makeRequest());
|
|
836
|
-
expect(calls[0]!.url).toBe("/v3/registration");
|
|
837
|
-
});
|
|
838
|
-
|
|
839
|
-
it("posts to `/v3/registration` even when the request is marked enhanced", async () => {
|
|
840
|
-
const { api, calls } = makeApi();
|
|
841
|
-
await api.smartSelfieEnrollment({ ...makeRequest(), enhanced: true });
|
|
842
|
-
expect(calls[0]!.url).toBe("/v3/registration");
|
|
843
|
-
});
|
|
844
|
-
|
|
845
|
-
it("sends a `user_details` JSON multipart part with snake_case keys", async () => {
|
|
846
|
-
const { api, calls } = makeApi();
|
|
847
|
-
await api.smartSelfieEnrollment(makeRequest());
|
|
848
|
-
const parts = partsByName(calls[0]!.body);
|
|
849
|
-
expect(parts["user_details"]).toBeDefined();
|
|
850
|
-
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
851
|
-
expect(parsed).toEqual({
|
|
852
|
-
given_names: "John",
|
|
853
|
-
last_name: "Doe",
|
|
854
|
-
email: "john@example.test",
|
|
855
|
-
phone_number: "+254700000000",
|
|
856
|
-
});
|
|
857
|
-
});
|
|
858
|
-
|
|
859
|
-
it("sends the `user_details` part as a plain text form field (no application/json tag)", async () => {
|
|
860
|
-
// Concrete scenario: the live server's multipart parser rejects
|
|
861
|
-
// parts tagged `Content-Type: application/json` with "missing or
|
|
862
|
-
// invalid". `user_details` rides as a plain text form field
|
|
863
|
-
// carrying a JSON-serialized string value (Postman `"type":
|
|
864
|
-
// "text"` shape).
|
|
865
|
-
const { api, calls } = makeApi();
|
|
866
|
-
await api.smartSelfieEnrollment(makeRequest());
|
|
867
|
-
const parts = partsByName(calls[0]!.body);
|
|
868
|
-
expectNoJsonContentType(parts["user_details"]![0]);
|
|
869
|
-
});
|
|
870
|
-
|
|
871
|
-
it("omits `email` from user_details when blank", async () => {
|
|
872
|
-
const { api, calls } = makeApi();
|
|
873
|
-
await api.smartSelfieEnrollment(
|
|
874
|
-
makeRequest({
|
|
875
|
-
givenNames: "John",
|
|
876
|
-
lastName: "Doe",
|
|
877
|
-
phoneNumber: "+254700000000",
|
|
878
|
-
}),
|
|
879
|
-
);
|
|
880
|
-
const parts = partsByName(calls[0]!.body);
|
|
881
|
-
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
882
|
-
expect(parsed.email).toBeUndefined();
|
|
883
|
-
});
|
|
884
|
-
|
|
885
|
-
it("sends selfie + liveness file parts", async () => {
|
|
886
|
-
const { api, calls } = makeApi();
|
|
887
|
-
await api.smartSelfieEnrollment(makeRequest());
|
|
888
|
-
const parts = partsByName(calls[0]!.body);
|
|
889
|
-
expect(parts["selfie_image"]).toHaveLength(1);
|
|
890
|
-
expect(parts["liveness_images"]).toHaveLength(7);
|
|
891
|
-
});
|
|
892
|
-
|
|
893
|
-
it("forwards PartnerConfig.callbackUrl and partnerParams as multipart parts", async () => {
|
|
894
|
-
const { api, calls } = makeApi({
|
|
895
|
-
callbackUrl: "https://partner.test/cb",
|
|
896
|
-
partnerParams: { jobRef: "ref-1" },
|
|
897
|
-
});
|
|
898
|
-
await api.smartSelfieEnrollment(makeRequest());
|
|
899
|
-
const parts = partsByName(calls[0]!.body);
|
|
900
|
-
expect(parts["callback_url"]).toEqual(["https://partner.test/cb"]);
|
|
901
|
-
expect(parts["partner_params"]).toBeDefined();
|
|
902
|
-
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
903
|
-
});
|
|
904
|
-
});
|
|
905
|
-
|
|
906
|
-
describe("SmileIDAPI.smartSelfieAuthentication", () => {
|
|
907
|
-
function makeRequest(
|
|
908
|
-
userDetailsOverride?: UserDetails,
|
|
909
|
-
): SmartSelfieAuthenticationRequest {
|
|
910
|
-
return {
|
|
911
|
-
jobType: JobType.smartSelfieAuthentication,
|
|
912
|
-
selfieImage: "file:///selfie.jpg",
|
|
913
|
-
// 7-frame canonical liveness count — matches the
|
|
914
|
-
// `REQUIRED_LIVENESS_FRAME_COUNT` enforced by `SmileIDAPI`.
|
|
915
|
-
livenessImages: [
|
|
916
|
-
"file:///l1.jpg",
|
|
917
|
-
"file:///l2.jpg",
|
|
918
|
-
"file:///l3.jpg",
|
|
919
|
-
"file:///l4.jpg",
|
|
920
|
-
"file:///l5.jpg",
|
|
921
|
-
"file:///l6.jpg",
|
|
922
|
-
"file:///l7.jpg",
|
|
923
|
-
],
|
|
924
|
-
consent,
|
|
925
|
-
metadata,
|
|
926
|
-
expectedLivenessImageCount: 7,
|
|
927
|
-
userDetails: userDetailsOverride ?? {
|
|
928
|
-
givenNames: "Jane",
|
|
929
|
-
lastName: "Doe",
|
|
930
|
-
email: "jane@example.test",
|
|
931
|
-
phoneNumber: "+254700000000",
|
|
932
|
-
},
|
|
933
|
-
userId: "prior-enrollment-user-id",
|
|
934
|
-
enhanced: false,
|
|
935
|
-
};
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
it("posts to the canonical `/v3/authentication` path", async () => {
|
|
939
|
-
const { api, calls } = makeApi();
|
|
940
|
-
await api.smartSelfieAuthentication(makeRequest());
|
|
941
|
-
expect(calls[0]!.url).toBe("/v3/authentication");
|
|
942
|
-
});
|
|
943
|
-
|
|
944
|
-
it("posts to `/v3/authentication` even when the request is marked enhanced", async () => {
|
|
945
|
-
const { api, calls } = makeApi();
|
|
946
|
-
await api.smartSelfieAuthentication({ ...makeRequest(), enhanced: true });
|
|
947
|
-
expect(calls[0]!.url).toBe("/v3/authentication");
|
|
948
|
-
});
|
|
949
|
-
|
|
950
|
-
it("sends a `user_details` JSON multipart part with snake_case keys", async () => {
|
|
951
|
-
const { api, calls } = makeApi();
|
|
952
|
-
await api.smartSelfieAuthentication(makeRequest());
|
|
953
|
-
const parts = partsByName(calls[0]!.body);
|
|
954
|
-
expect(parts["user_details"]).toBeDefined();
|
|
955
|
-
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
956
|
-
expect(parsed).toEqual({
|
|
957
|
-
given_names: "Jane",
|
|
958
|
-
last_name: "Doe",
|
|
959
|
-
email: "jane@example.test",
|
|
960
|
-
phone_number: "+254700000000",
|
|
961
|
-
});
|
|
962
|
-
});
|
|
963
|
-
|
|
964
|
-
it("sends the `user_details` part as a plain text form field (no application/json tag)", async () => {
|
|
965
|
-
const { api, calls } = makeApi();
|
|
966
|
-
await api.smartSelfieAuthentication(makeRequest());
|
|
967
|
-
const parts = partsByName(calls[0]!.body);
|
|
968
|
-
expectNoJsonContentType(parts["user_details"]![0]);
|
|
969
|
-
});
|
|
970
|
-
|
|
971
|
-
it("sends selfie + liveness file parts", async () => {
|
|
972
|
-
const { api, calls } = makeApi();
|
|
973
|
-
await api.smartSelfieAuthentication(makeRequest());
|
|
974
|
-
const parts = partsByName(calls[0]!.body);
|
|
975
|
-
expect(parts["selfie_image"]).toHaveLength(1);
|
|
976
|
-
expect(parts["liveness_images"]).toHaveLength(7);
|
|
977
|
-
});
|
|
978
|
-
|
|
979
|
-
it("sends a `user_id` plain text multipart part carrying the request's userId", async () => {
|
|
980
|
-
const { api, calls } = makeApi();
|
|
981
|
-
await api.smartSelfieAuthentication(makeRequest());
|
|
982
|
-
const parts = partsByName(calls[0]!.body);
|
|
983
|
-
expect(parts["user_id"]).toEqual(["prior-enrollment-user-id"]);
|
|
984
|
-
});
|
|
985
|
-
|
|
986
|
-
it("sends the `user_id` part as a plain text form field (no application/json tag)", async () => {
|
|
987
|
-
const { api, calls } = makeApi();
|
|
988
|
-
await api.smartSelfieAuthentication(makeRequest());
|
|
989
|
-
const parts = partsByName(calls[0]!.body);
|
|
990
|
-
expectNoJsonContentType(parts["user_id"]![0]);
|
|
991
|
-
});
|
|
992
|
-
});
|
|
993
|
-
|
|
994
|
-
describe("SmileIDAPI response-body parse failures", () => {
|
|
995
|
-
/**
|
|
996
|
-
* Lock down the parse-error path: when the server returns a 2xx
|
|
997
|
-
* response with a malformed body (e.g. wire-format change, broken
|
|
998
|
-
* proxy that strips JSON, …), the SDK must throw
|
|
999
|
-
* `NetworkResponseParseException` so partner code branching on
|
|
1000
|
-
* `e instanceof NetworkResponseParseException` sees the right
|
|
1001
|
-
* type. The repository's `_mapError` recognises this typed
|
|
1002
|
-
* exception via the idempotent pass-through in `mapAxiosError`
|
|
1003
|
-
* and surfaces it through `failure(...)` without re-wrapping.
|
|
1004
|
-
*/
|
|
1005
|
-
|
|
1006
|
-
function makeSelfieRequest(): SmartSelfieEnrollmentRequest {
|
|
1007
|
-
return {
|
|
1008
|
-
jobType: JobType.smartSelfieEnrollment,
|
|
1009
|
-
selfieImage: "file:///selfie.jpg",
|
|
1010
|
-
livenessImages: [
|
|
1011
|
-
"file:///l1.jpg",
|
|
1012
|
-
"file:///l2.jpg",
|
|
1013
|
-
"file:///l3.jpg",
|
|
1014
|
-
"file:///l4.jpg",
|
|
1015
|
-
"file:///l5.jpg",
|
|
1016
|
-
"file:///l6.jpg",
|
|
1017
|
-
"file:///l7.jpg",
|
|
1018
|
-
],
|
|
1019
|
-
consent,
|
|
1020
|
-
metadata,
|
|
1021
|
-
expectedLivenessImageCount: 7,
|
|
1022
|
-
userDetails: {
|
|
1023
|
-
givenNames: "John",
|
|
1024
|
-
lastName: "Doe",
|
|
1025
|
-
email: "john@example.test",
|
|
1026
|
-
phoneNumber: "+254700000000",
|
|
1027
|
-
},
|
|
1028
|
-
enhanced: false,
|
|
1029
|
-
};
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
it("throws NetworkResponseParseException when the body is null", async () => {
|
|
1033
|
-
const { api, setNextResponse } = makeApi();
|
|
1034
|
-
setNextResponse(null);
|
|
1035
|
-
await expect(
|
|
1036
|
-
api.smartSelfieEnrollment(makeSelfieRequest()),
|
|
1037
|
-
).rejects.toBeInstanceOf(NetworkResponseParseException);
|
|
1038
|
-
});
|
|
1039
|
-
|
|
1040
|
-
it("throws NetworkResponseParseException when the body is an array", async () => {
|
|
1041
|
-
// A server / proxy returning a JSON array instead of a job-result
|
|
1042
|
-
// object would otherwise slip through as `NetworkUnknownException`
|
|
1043
|
-
// and bury the wire-format mismatch. The typed exception keeps
|
|
1044
|
-
// partner triage tight.
|
|
1045
|
-
const { api, setNextResponse } = makeApi();
|
|
1046
|
-
setNextResponse([]);
|
|
1047
|
-
await expect(
|
|
1048
|
-
api.smartSelfieEnrollment(makeSelfieRequest()),
|
|
1049
|
-
).rejects.toBeInstanceOf(NetworkResponseParseException);
|
|
1050
|
-
});
|
|
1051
|
-
|
|
1052
|
-
it("throws NetworkResponseParseException when the body is a string", async () => {
|
|
1053
|
-
const { api, setNextResponse } = makeApi();
|
|
1054
|
-
setNextResponse("not-an-object");
|
|
1055
|
-
await expect(
|
|
1056
|
-
api.smartSelfieEnrollment(makeSelfieRequest()),
|
|
1057
|
-
).rejects.toBeInstanceOf(NetworkResponseParseException);
|
|
1058
|
-
});
|
|
1059
|
-
|
|
1060
|
-
it("the thrown exception carries the canonical error code", async () => {
|
|
1061
|
-
const { api, setNextResponse } = makeApi();
|
|
1062
|
-
setNextResponse(null);
|
|
1063
|
-
try {
|
|
1064
|
-
await api.smartSelfieEnrollment(makeSelfieRequest());
|
|
1065
|
-
throw new Error("expected smartSelfieEnrollment to throw");
|
|
1066
|
-
} catch (error) {
|
|
1067
|
-
expect(error).toBeInstanceOf(NetworkResponseParseException);
|
|
1068
|
-
expect((error as NetworkResponseParseException).errorCode).toBe(
|
|
1069
|
-
"NETWORK_PARSE_ERROR",
|
|
1070
|
-
);
|
|
1071
|
-
}
|
|
1072
|
-
});
|
|
1073
|
-
});
|
|
1074
|
-
|
|
1075
|
-
describe("SmileIDAPI — token-provided user details & consent (wire)", () => {
|
|
1076
|
-
const livenessImages: readonly string[] = [
|
|
1077
|
-
"file:///l1.jpg",
|
|
1078
|
-
"file:///l2.jpg",
|
|
1079
|
-
"file:///l3.jpg",
|
|
1080
|
-
"file:///l4.jpg",
|
|
1081
|
-
"file:///l5.jpg",
|
|
1082
|
-
"file:///l6.jpg",
|
|
1083
|
-
"file:///l7.jpg",
|
|
1084
|
-
];
|
|
1085
|
-
|
|
1086
|
-
const fullUserDetails: UserDetails = {
|
|
1087
|
-
givenNames: "John",
|
|
1088
|
-
lastName: "Doe",
|
|
1089
|
-
email: "john@example.test",
|
|
1090
|
-
phoneNumber: "+254700000000",
|
|
1091
|
-
};
|
|
1092
|
-
|
|
1093
|
-
function tokenPayload(overrides: Partial<TokenPayload> = {}): TokenPayload {
|
|
1094
|
-
return {
|
|
1095
|
-
hasGivenNames: false,
|
|
1096
|
-
hasLastName: false,
|
|
1097
|
-
hasEmail: false,
|
|
1098
|
-
hasPhoneNumber: false,
|
|
1099
|
-
...overrides,
|
|
1100
|
-
};
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
const fullBinding = tokenPayload({
|
|
1104
|
-
hasGivenNames: true,
|
|
1105
|
-
hasLastName: true,
|
|
1106
|
-
hasEmail: true,
|
|
1107
|
-
hasPhoneNumber: true,
|
|
1108
|
-
});
|
|
1109
|
-
|
|
1110
|
-
const completeTokenConsent = {
|
|
1111
|
-
granted: true,
|
|
1112
|
-
grantedAt: "2026-01-01T09:00:00.000Z",
|
|
1113
|
-
noticeLanguage: "EN",
|
|
1114
|
-
noticePrivacyPolicyUrl: "https://partner.test/privacy",
|
|
1115
|
-
} as const;
|
|
1116
|
-
|
|
1117
|
-
function enrollmentRequest(
|
|
1118
|
-
overrides: Partial<SmartSelfieEnrollmentRequest> = {},
|
|
1119
|
-
): SmartSelfieEnrollmentRequest {
|
|
1120
|
-
return {
|
|
1121
|
-
jobType: JobType.smartSelfieEnrollment,
|
|
1122
|
-
selfieImage: "file:///selfie.jpg",
|
|
1123
|
-
livenessImages,
|
|
1124
|
-
consent,
|
|
1125
|
-
metadata,
|
|
1126
|
-
expectedLivenessImageCount: 7,
|
|
1127
|
-
userDetails: fullUserDetails,
|
|
1128
|
-
enhanced: false,
|
|
1129
|
-
...overrides,
|
|
1130
|
-
};
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
it("a partial user_details payload sends only its remaining fields", async () => {
|
|
1134
|
-
// Assembly already dropped the token-bound names (token always wins);
|
|
1135
|
-
// only email/phone ride the wire.
|
|
1136
|
-
const { api, calls } = makeApi();
|
|
1137
|
-
await api.smartSelfieEnrollment(
|
|
1138
|
-
enrollmentRequest({
|
|
1139
|
-
userDetails: {
|
|
1140
|
-
email: "john@example.test",
|
|
1141
|
-
phoneNumber: "+254700000000",
|
|
1142
|
-
},
|
|
1143
|
-
}),
|
|
1144
|
-
);
|
|
1145
|
-
const parts = partsByName(calls[0]!.body);
|
|
1146
|
-
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
1147
|
-
expect(parsed).toEqual({
|
|
1148
|
-
email: "john@example.test",
|
|
1149
|
-
phone_number: "+254700000000",
|
|
1150
|
-
});
|
|
1151
|
-
});
|
|
1152
|
-
|
|
1153
|
-
it("omits the user_details part when the request carries no userDetails", async () => {
|
|
1154
|
-
const { api, calls } = makeApi();
|
|
1155
|
-
const { userDetails: _details, ...withoutUserDetails } =
|
|
1156
|
-
enrollmentRequest();
|
|
1157
|
-
await api.smartSelfieEnrollment({
|
|
1158
|
-
...withoutUserDetails,
|
|
1159
|
-
tokenPayload: fullBinding,
|
|
1160
|
-
});
|
|
1161
|
-
const parts = partsByName(calls[0]!.body);
|
|
1162
|
-
expect(parts["user_details"]).toBeUndefined();
|
|
1163
|
-
});
|
|
1164
|
-
|
|
1165
|
-
it("an empty user_details payload omits the part entirely", async () => {
|
|
1166
|
-
const { api, calls } = makeApi();
|
|
1167
|
-
await api.smartSelfieEnrollment(enrollmentRequest({ userDetails: {} }));
|
|
1168
|
-
const parts = partsByName(calls[0]!.body);
|
|
1169
|
-
expect(parts["user_details"]).toBeUndefined();
|
|
1170
|
-
});
|
|
1171
|
-
|
|
1172
|
-
it("omits the consent part when the request carries no consent (token-complete path)", async () => {
|
|
1173
|
-
const { api, calls } = makeApi();
|
|
1174
|
-
const { consent: _consent, ...withoutConsent } = enrollmentRequest();
|
|
1175
|
-
await api.smartSelfieEnrollment({
|
|
1176
|
-
...withoutConsent,
|
|
1177
|
-
tokenPayload: {
|
|
1178
|
-
...tokenPayload(),
|
|
1179
|
-
consent: completeTokenConsent,
|
|
1180
|
-
},
|
|
1181
|
-
});
|
|
1182
|
-
const parts = partsByName(calls[0]!.body);
|
|
1183
|
-
expect(parts["consent"]).toBeUndefined();
|
|
1184
|
-
// The metadata part is unconditional — it must survive the omission.
|
|
1185
|
-
expect(parts["metadata"]).toBeDefined();
|
|
1186
|
-
});
|
|
1187
|
-
|
|
1188
|
-
it("sends a local consent in full even when the token also binds consent", async () => {
|
|
1189
|
-
// Server merges per-subfield with the token winning; the SDK never
|
|
1190
|
-
// trims a locally captured / preset consent.
|
|
1191
|
-
const { api, calls } = makeApi();
|
|
1192
|
-
await api.smartSelfieEnrollment(
|
|
1193
|
-
enrollmentRequest({
|
|
1194
|
-
tokenPayload: {
|
|
1195
|
-
...tokenPayload(),
|
|
1196
|
-
consent: completeTokenConsent,
|
|
1197
|
-
},
|
|
1198
|
-
}),
|
|
1199
|
-
);
|
|
1200
|
-
const parts = partsByName(calls[0]!.body);
|
|
1201
|
-
const parsed = JSON.parse(await readJsonPart(parts["consent"]![0]));
|
|
1202
|
-
expect(parsed).toEqual({
|
|
1203
|
-
granted: true,
|
|
1204
|
-
granted_at: "2026-04-30T00:00:00.000Z",
|
|
1205
|
-
notice_language: "EN",
|
|
1206
|
-
notice_privacy_policy_url: "https://example.test/p",
|
|
1207
|
-
});
|
|
1208
|
-
});
|
|
1209
|
-
|
|
1210
|
-
it("regression: without a tokenPayload the parts are identical to today", async () => {
|
|
1211
|
-
const { api, calls } = makeApi();
|
|
1212
|
-
await api.smartSelfieEnrollment(enrollmentRequest());
|
|
1213
|
-
const parts = partsByName(calls[0]!.body);
|
|
1214
|
-
const userDetailsParsed = JSON.parse(
|
|
1215
|
-
await readJsonPart(parts["user_details"]![0]),
|
|
1216
|
-
);
|
|
1217
|
-
expect(userDetailsParsed).toEqual({
|
|
1218
|
-
given_names: "John",
|
|
1219
|
-
last_name: "Doe",
|
|
1220
|
-
email: "john@example.test",
|
|
1221
|
-
phone_number: "+254700000000",
|
|
1222
|
-
});
|
|
1223
|
-
const consentParsed = JSON.parse(await readJsonPart(parts["consent"]![0]));
|
|
1224
|
-
expect(consentParsed).toEqual({
|
|
1225
|
-
granted: true,
|
|
1226
|
-
granted_at: "2026-04-30T00:00:00.000Z",
|
|
1227
|
-
notice_language: "EN",
|
|
1228
|
-
notice_privacy_policy_url: "https://example.test/p",
|
|
1229
|
-
});
|
|
1230
|
-
});
|
|
1231
|
-
|
|
1232
|
-
it("keeps the stripped user_details part an untagged text form field", async () => {
|
|
1233
|
-
const { api, calls } = makeApi();
|
|
1234
|
-
await api.smartSelfieEnrollment(
|
|
1235
|
-
enrollmentRequest({
|
|
1236
|
-
tokenPayload: tokenPayload({ hasGivenNames: true }),
|
|
1237
|
-
}),
|
|
1238
|
-
);
|
|
1239
|
-
const parts = partsByName(calls[0]!.body);
|
|
1240
|
-
expectNoJsonContentType(parts["user_details"]![0]);
|
|
1241
|
-
});
|
|
1242
|
-
|
|
1243
|
-
// Every endpoint routes user_details / consent through the same
|
|
1244
|
-
// helpers — pin the omission behavior across all six.
|
|
1245
|
-
const omissionSubmissions: ReadonlyArray<{
|
|
1246
|
-
readonly endpoint: string;
|
|
1247
|
-
readonly submit: (api: SmileIDAPI) => Promise<unknown>;
|
|
1248
|
-
}> = [
|
|
1249
|
-
{
|
|
1250
|
-
endpoint: "/v3/registration",
|
|
1251
|
-
submit: (api) =>
|
|
1252
|
-
api.smartSelfieEnrollment({
|
|
1253
|
-
jobType: JobType.smartSelfieEnrollment,
|
|
1254
|
-
selfieImage: "file:///selfie.jpg",
|
|
1255
|
-
livenessImages,
|
|
1256
|
-
enhanced: false,
|
|
1257
|
-
metadata,
|
|
1258
|
-
expectedLivenessImageCount: 7,
|
|
1259
|
-
tokenPayload: { ...fullBinding, consent: completeTokenConsent },
|
|
1260
|
-
}),
|
|
1261
|
-
},
|
|
1262
|
-
{
|
|
1263
|
-
endpoint: "/v3/authentication",
|
|
1264
|
-
submit: (api) =>
|
|
1265
|
-
api.smartSelfieAuthentication({
|
|
1266
|
-
jobType: JobType.smartSelfieAuthentication,
|
|
1267
|
-
selfieImage: "file:///selfie.jpg",
|
|
1268
|
-
livenessImages,
|
|
1269
|
-
userId: "user-1",
|
|
1270
|
-
enhanced: false,
|
|
1271
|
-
metadata,
|
|
1272
|
-
expectedLivenessImageCount: 7,
|
|
1273
|
-
tokenPayload: { ...fullBinding, consent: completeTokenConsent },
|
|
1274
|
-
}),
|
|
1275
|
-
},
|
|
1276
|
-
{
|
|
1277
|
-
endpoint: "/v3/enhanced_kyc",
|
|
1278
|
-
submit: (api) =>
|
|
1279
|
-
api.enhancedKyc({
|
|
1280
|
-
jobType: JobType.enhancedKyc,
|
|
1281
|
-
params: { idType: "NATIONAL_ID", idNumber: "1", country: "KE" },
|
|
1282
|
-
metadata,
|
|
1283
|
-
tokenPayload: { ...fullBinding, consent: completeTokenConsent },
|
|
1284
|
-
}),
|
|
1285
|
-
},
|
|
1286
|
-
{
|
|
1287
|
-
endpoint: "/v3/biometric_kyc",
|
|
1288
|
-
submit: (api) =>
|
|
1289
|
-
api.biometricKyc({
|
|
1290
|
-
jobType: JobType.biometricKyc,
|
|
1291
|
-
selfieImage: "file:///selfie.jpg",
|
|
1292
|
-
livenessImages,
|
|
1293
|
-
params: {
|
|
1294
|
-
idType: "NATIONAL_ID",
|
|
1295
|
-
idNumber: "1",
|
|
1296
|
-
country: "KE",
|
|
1297
|
-
useEnrolledImage: false,
|
|
1298
|
-
},
|
|
1299
|
-
metadata,
|
|
1300
|
-
expectedLivenessImageCount: 7,
|
|
1301
|
-
tokenPayload: { ...fullBinding, consent: completeTokenConsent },
|
|
1302
|
-
}),
|
|
1303
|
-
},
|
|
1304
|
-
{
|
|
1305
|
-
endpoint: "/v3/document_verification",
|
|
1306
|
-
submit: (api) =>
|
|
1307
|
-
api.documentVerification({
|
|
1308
|
-
jobType: JobType.documentVerification,
|
|
1309
|
-
selfieImage: "file:///selfie.jpg",
|
|
1310
|
-
livenessImages,
|
|
1311
|
-
frontDocument: "file:///front.jpg",
|
|
1312
|
-
country: "KE",
|
|
1313
|
-
metadata,
|
|
1314
|
-
expectedLivenessImageCount: 7,
|
|
1315
|
-
tokenPayload: { ...fullBinding, consent: completeTokenConsent },
|
|
1316
|
-
}),
|
|
1317
|
-
},
|
|
1318
|
-
{
|
|
1319
|
-
endpoint: "/v3/enhanced_document_verification",
|
|
1320
|
-
submit: (api) =>
|
|
1321
|
-
api.enhancedDocumentVerification({
|
|
1322
|
-
jobType: JobType.enhancedDocumentVerification,
|
|
1323
|
-
selfieImage: "file:///selfie.jpg",
|
|
1324
|
-
livenessImages,
|
|
1325
|
-
frontDocument: "file:///front.jpg",
|
|
1326
|
-
country: "KE",
|
|
1327
|
-
idType: "NATIONAL_ID",
|
|
1328
|
-
metadata,
|
|
1329
|
-
expectedLivenessImageCount: 7,
|
|
1330
|
-
tokenPayload: { ...fullBinding, consent: completeTokenConsent },
|
|
1331
|
-
}),
|
|
1332
|
-
},
|
|
1333
|
-
];
|
|
1334
|
-
|
|
1335
|
-
for (const { endpoint, submit } of omissionSubmissions) {
|
|
1336
|
-
it(`${endpoint} omits user_details and consent on the token-complete path`, async () => {
|
|
1337
|
-
const { api, calls } = makeApi();
|
|
1338
|
-
await submit(api);
|
|
1339
|
-
expect(calls[0]!.url).toBe(endpoint);
|
|
1340
|
-
const parts = partsByName(calls[0]!.body);
|
|
1341
|
-
expect(parts["user_details"]).toBeUndefined();
|
|
1342
|
-
expect(parts["consent"]).toBeUndefined();
|
|
1343
|
-
expect(parts["metadata"]).toBeDefined();
|
|
1344
|
-
});
|
|
1345
|
-
}
|
|
1346
|
-
});
|
|
1347
|
-
|
|
1348
|
-
describe("SmileIDAPI signed job opt-in (request MAC + attestation)", () => {
|
|
1349
|
-
// An endpoint missing the opt-in flags ships an unsigned job the
|
|
1350
|
-
// server rejects — while the interceptors' own tests stay green.
|
|
1351
|
-
const livenessImages: readonly string[] = [
|
|
1352
|
-
"file:///l1.jpg",
|
|
1353
|
-
"file:///l2.jpg",
|
|
1354
|
-
"file:///l3.jpg",
|
|
1355
|
-
"file:///l4.jpg",
|
|
1356
|
-
"file:///l5.jpg",
|
|
1357
|
-
"file:///l6.jpg",
|
|
1358
|
-
"file:///l7.jpg",
|
|
1359
|
-
];
|
|
1360
|
-
const userDetails: UserDetails = {
|
|
1361
|
-
givenNames: "John",
|
|
1362
|
-
lastName: "Doe",
|
|
1363
|
-
};
|
|
1364
|
-
const kycParams = {
|
|
1365
|
-
idType: "NATIONAL_ID",
|
|
1366
|
-
idNumber: "32232403",
|
|
1367
|
-
country: "KE",
|
|
1368
|
-
};
|
|
1369
|
-
|
|
1370
|
-
const submissions: ReadonlyArray<{
|
|
1371
|
-
readonly endpoint: string;
|
|
1372
|
-
readonly submit: (api: SmileIDAPI) => Promise<unknown>;
|
|
1373
|
-
}> = [
|
|
1374
|
-
{
|
|
1375
|
-
endpoint: "/v3/registration",
|
|
1376
|
-
submit: (api) =>
|
|
1377
|
-
api.smartSelfieEnrollment({
|
|
1378
|
-
jobType: JobType.smartSelfieEnrollment,
|
|
1379
|
-
selfieImage: "file:///selfie.jpg",
|
|
1380
|
-
livenessImages,
|
|
1381
|
-
userDetails,
|
|
1382
|
-
enhanced: false,
|
|
1383
|
-
consent,
|
|
1384
|
-
metadata,
|
|
1385
|
-
expectedLivenessImageCount: 7,
|
|
1386
|
-
}),
|
|
1387
|
-
},
|
|
1388
|
-
{
|
|
1389
|
-
endpoint: "/v3/authentication",
|
|
1390
|
-
submit: (api) =>
|
|
1391
|
-
api.smartSelfieAuthentication({
|
|
1392
|
-
jobType: JobType.smartSelfieAuthentication,
|
|
1393
|
-
selfieImage: "file:///selfie.jpg",
|
|
1394
|
-
livenessImages,
|
|
1395
|
-
userDetails,
|
|
1396
|
-
userId: "user-1",
|
|
1397
|
-
enhanced: false,
|
|
1398
|
-
consent,
|
|
1399
|
-
metadata,
|
|
1400
|
-
expectedLivenessImageCount: 7,
|
|
1401
|
-
}),
|
|
1402
|
-
},
|
|
1403
|
-
{
|
|
1404
|
-
endpoint: "/v3/enhanced_kyc",
|
|
1405
|
-
submit: (api) =>
|
|
1406
|
-
api.enhancedKyc({
|
|
1407
|
-
jobType: JobType.enhancedKyc,
|
|
1408
|
-
params: kycParams,
|
|
1409
|
-
userDetails,
|
|
1410
|
-
consent,
|
|
1411
|
-
metadata,
|
|
1412
|
-
}),
|
|
1413
|
-
},
|
|
1414
|
-
{
|
|
1415
|
-
endpoint: "/v3/biometric_kyc",
|
|
1416
|
-
submit: (api) =>
|
|
1417
|
-
api.biometricKyc({
|
|
1418
|
-
jobType: JobType.biometricKyc,
|
|
1419
|
-
selfieImage: "file:///selfie.jpg",
|
|
1420
|
-
livenessImages,
|
|
1421
|
-
params: { ...kycParams, useEnrolledImage: false },
|
|
1422
|
-
userDetails,
|
|
1423
|
-
consent,
|
|
1424
|
-
metadata,
|
|
1425
|
-
expectedLivenessImageCount: 7,
|
|
1426
|
-
}),
|
|
1427
|
-
},
|
|
1428
|
-
{
|
|
1429
|
-
endpoint: "/v3/document_verification",
|
|
1430
|
-
submit: (api) =>
|
|
1431
|
-
api.documentVerification({
|
|
1432
|
-
jobType: JobType.documentVerification,
|
|
1433
|
-
selfieImage: "file:///selfie.jpg",
|
|
1434
|
-
livenessImages,
|
|
1435
|
-
frontDocument: "file:///front.jpg",
|
|
1436
|
-
country: "KE",
|
|
1437
|
-
userDetails,
|
|
1438
|
-
consent,
|
|
1439
|
-
metadata,
|
|
1440
|
-
expectedLivenessImageCount: 7,
|
|
1441
|
-
}),
|
|
1442
|
-
},
|
|
1443
|
-
{
|
|
1444
|
-
endpoint: "/v3/enhanced_document_verification",
|
|
1445
|
-
submit: (api) =>
|
|
1446
|
-
api.enhancedDocumentVerification({
|
|
1447
|
-
jobType: JobType.enhancedDocumentVerification,
|
|
1448
|
-
selfieImage: "file:///selfie.jpg",
|
|
1449
|
-
livenessImages,
|
|
1450
|
-
frontDocument: "file:///front.jpg",
|
|
1451
|
-
country: "KE",
|
|
1452
|
-
idType: "NATIONAL_ID",
|
|
1453
|
-
userDetails,
|
|
1454
|
-
consent,
|
|
1455
|
-
metadata,
|
|
1456
|
-
expectedLivenessImageCount: 7,
|
|
1457
|
-
}),
|
|
1458
|
-
},
|
|
1459
|
-
];
|
|
1460
|
-
|
|
1461
|
-
for (const { endpoint, submit } of submissions) {
|
|
1462
|
-
it(`opts the ${endpoint} submission into MAC signing and attestation`, async () => {
|
|
1463
|
-
const { api, calls } = makeApi();
|
|
1464
|
-
await submit(api);
|
|
1465
|
-
expect(calls).toHaveLength(1);
|
|
1466
|
-
expect(calls[0]!.url).toBe(endpoint);
|
|
1467
|
-
expect(calls[0]!.config?.[REQUEST_MAC_OPT_IN_KEY]).toBe(true);
|
|
1468
|
-
expect(calls[0]!.config?.[ATTESTATION_OPT_IN_KEY]).toBe(true);
|
|
1469
|
-
});
|
|
1470
|
-
}
|
|
1471
|
-
});
|