@smileid/usesmileid 12.0.0-beta01
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 +10 -0
- package/LICENSE +21 -0
- package/README.md +130 -0
- package/dist/camera/camera_configuration.d.ts +31 -0
- package/dist/camera/camera_configuration.d.ts.map +1 -0
- package/dist/camera/camera_configuration.js +2 -0
- package/dist/camera/camera_configuration.js.map +1 -0
- package/dist/camera/camera_defaults.d.ts +25 -0
- package/dist/camera/camera_defaults.d.ts.map +1 -0
- package/dist/camera/camera_defaults.js +22 -0
- package/dist/camera/camera_defaults.js.map +1 -0
- package/dist/camera/camera_lens.d.ts +13 -0
- package/dist/camera/camera_lens.d.ts.map +1 -0
- package/dist/camera/camera_lens.js +12 -0
- package/dist/camera/camera_lens.js.map +1 -0
- package/dist/camera/camera_permissions.d.ts +18 -0
- package/dist/camera/camera_permissions.d.ts.map +1 -0
- package/dist/camera/camera_permissions.js +23 -0
- package/dist/camera/camera_permissions.js.map +1 -0
- package/dist/camera/camera_preview_image.d.ts +18 -0
- package/dist/camera/camera_preview_image.d.ts.map +1 -0
- package/dist/camera/camera_preview_image.js +8 -0
- package/dist/camera/camera_preview_image.js.map +1 -0
- package/dist/camera/document_image_pipeline.d.ts +24 -0
- package/dist/camera/document_image_pipeline.d.ts.map +1 -0
- package/dist/camera/document_image_pipeline.js +70 -0
- package/dist/camera/document_image_pipeline.js.map +1 -0
- package/dist/camera/document_resize_target.d.ts +13 -0
- package/dist/camera/document_resize_target.d.ts.map +1 -0
- package/dist/camera/document_resize_target.js +17 -0
- package/dist/camera/document_resize_target.js.map +1 -0
- package/dist/camera/focus_state.d.ts +31 -0
- package/dist/camera/focus_state.d.ts.map +1 -0
- package/dist/camera/focus_state.js +13 -0
- package/dist/camera/focus_state.js.map +1 -0
- package/dist/camera/frame_processor_plugin.d.ts +28 -0
- package/dist/camera/frame_processor_plugin.d.ts.map +1 -0
- package/dist/camera/frame_processor_plugin.js +21 -0
- package/dist/camera/frame_processor_plugin.js.map +1 -0
- package/dist/camera/orientation_degrees.d.ts +11 -0
- package/dist/camera/orientation_degrees.d.ts.map +1 -0
- package/dist/camera/orientation_degrees.js +21 -0
- package/dist/camera/orientation_degrees.js.map +1 -0
- package/dist/camera/use_smile_id_camera_preview.d.ts +64 -0
- package/dist/camera/use_smile_id_camera_preview.d.ts.map +1 -0
- package/dist/camera/use_smile_id_camera_preview.js +141 -0
- package/dist/camera/use_smile_id_camera_preview.js.map +1 -0
- package/dist/camera/use_smile_id_camera_system.d.ts +97 -0
- package/dist/camera/use_smile_id_camera_system.d.ts.map +1 -0
- package/dist/camera/use_smile_id_camera_system.js +185 -0
- package/dist/camera/use_smile_id_camera_system.js.map +1 -0
- package/dist/camera/use_smile_id_frame_processor.d.ts +38 -0
- package/dist/camera/use_smile_id_frame_processor.d.ts.map +1 -0
- package/dist/camera/use_smile_id_frame_processor.js +2 -0
- package/dist/camera/use_smile_id_frame_processor.js.map +1 -0
- package/dist/camera/use_smile_id_frame_stream.d.ts +70 -0
- package/dist/camera/use_smile_id_frame_stream.d.ts.map +1 -0
- package/dist/camera/use_smile_id_frame_stream.js +93 -0
- package/dist/camera/use_smile_id_frame_stream.js.map +1 -0
- package/dist/core/exception/builder_validation_exception.d.ts +29 -0
- package/dist/core/exception/builder_validation_exception.d.ts.map +1 -0
- package/dist/core/exception/builder_validation_exception.js +37 -0
- package/dist/core/exception/builder_validation_exception.js.map +1 -0
- package/dist/core/exception/capture_validation_exceptions.d.ts +9 -0
- package/dist/core/exception/capture_validation_exceptions.d.ts.map +1 -0
- package/dist/core/exception/capture_validation_exceptions.js +9 -0
- package/dist/core/exception/capture_validation_exceptions.js.map +1 -0
- package/dist/core/exception/consent_validation_exceptions.d.ts +8 -0
- package/dist/core/exception/consent_validation_exceptions.d.ts.map +1 -0
- package/dist/core/exception/consent_validation_exceptions.js +8 -0
- package/dist/core/exception/consent_validation_exceptions.js.map +1 -0
- package/dist/core/exception/duplicate_screen_type_exception.d.ts +13 -0
- package/dist/core/exception/duplicate_screen_type_exception.d.ts.map +1 -0
- package/dist/core/exception/duplicate_screen_type_exception.js +20 -0
- package/dist/core/exception/duplicate_screen_type_exception.js.map +1 -0
- package/dist/core/exception/empty_screens_block_exception.d.ts +11 -0
- package/dist/core/exception/empty_screens_block_exception.d.ts.map +1 -0
- package/dist/core/exception/empty_screens_block_exception.js +17 -0
- package/dist/core/exception/empty_screens_block_exception.js.map +1 -0
- package/dist/core/exception/flow_exceptions.d.ts +27 -0
- package/dist/core/exception/flow_exceptions.d.ts.map +1 -0
- package/dist/core/exception/flow_exceptions.js +37 -0
- package/dist/core/exception/flow_exceptions.js.map +1 -0
- package/dist/core/exception/index.d.ts +41 -0
- package/dist/core/exception/index.d.ts.map +1 -0
- package/dist/core/exception/index.js +53 -0
- package/dist/core/exception/index.js.map +1 -0
- package/dist/core/exception/invalid_consent_config_exception.d.ts +13 -0
- package/dist/core/exception/invalid_consent_config_exception.d.ts.map +1 -0
- package/dist/core/exception/invalid_consent_config_exception.js +18 -0
- package/dist/core/exception/invalid_consent_config_exception.js.map +1 -0
- package/dist/core/exception/invalid_consent_information_exception.d.ts +14 -0
- package/dist/core/exception/invalid_consent_information_exception.d.ts.map +1 -0
- package/dist/core/exception/invalid_consent_information_exception.js +19 -0
- package/dist/core/exception/invalid_consent_information_exception.js.map +1 -0
- package/dist/core/exception/invalid_document_capture_config_exception.d.ts +14 -0
- package/dist/core/exception/invalid_document_capture_config_exception.d.ts.map +1 -0
- package/dist/core/exception/invalid_document_capture_config_exception.js +20 -0
- package/dist/core/exception/invalid_document_capture_config_exception.js.map +1 -0
- package/dist/core/exception/invalid_field_value_exception.d.ts +16 -0
- package/dist/core/exception/invalid_field_value_exception.d.ts.map +1 -0
- package/dist/core/exception/invalid_field_value_exception.js +20 -0
- package/dist/core/exception/invalid_field_value_exception.js.map +1 -0
- package/dist/core/exception/invalid_job_type_screen_config_exception.d.ts +36 -0
- package/dist/core/exception/invalid_job_type_screen_config_exception.d.ts.map +1 -0
- package/dist/core/exception/invalid_job_type_screen_config_exception.js +61 -0
- package/dist/core/exception/invalid_job_type_screen_config_exception.js.map +1 -0
- package/dist/core/exception/invalid_missing_capture_type_exception.d.ts +11 -0
- package/dist/core/exception/invalid_missing_capture_type_exception.d.ts.map +1 -0
- package/dist/core/exception/invalid_missing_capture_type_exception.js +17 -0
- package/dist/core/exception/invalid_missing_capture_type_exception.js.map +1 -0
- package/dist/core/exception/invalid_screen_order_exception.d.ts +17 -0
- package/dist/core/exception/invalid_screen_order_exception.d.ts.map +1 -0
- package/dist/core/exception/invalid_screen_order_exception.js +22 -0
- package/dist/core/exception/invalid_screen_order_exception.js.map +1 -0
- package/dist/core/exception/invalid_selfie_capture_config_exception.d.ts +14 -0
- package/dist/core/exception/invalid_selfie_capture_config_exception.d.ts.map +1 -0
- package/dist/core/exception/invalid_selfie_capture_config_exception.js +20 -0
- package/dist/core/exception/invalid_selfie_capture_config_exception.js.map +1 -0
- package/dist/core/exception/issue_severity.d.ts +14 -0
- package/dist/core/exception/issue_severity.d.ts.map +1 -0
- package/dist/core/exception/issue_severity.js +13 -0
- package/dist/core/exception/issue_severity.js.map +1 -0
- package/dist/core/exception/job_validation_exceptions.d.ts +12 -0
- package/dist/core/exception/job_validation_exceptions.d.ts.map +1 -0
- package/dist/core/exception/job_validation_exceptions.js +12 -0
- package/dist/core/exception/job_validation_exceptions.js.map +1 -0
- package/dist/core/exception/liveness_frame_count_exception.d.ts +15 -0
- package/dist/core/exception/liveness_frame_count_exception.d.ts.map +1 -0
- package/dist/core/exception/liveness_frame_count_exception.js +19 -0
- package/dist/core/exception/liveness_frame_count_exception.js.map +1 -0
- package/dist/core/exception/missing_capture_for_preview_exception.d.ts +14 -0
- package/dist/core/exception/missing_capture_for_preview_exception.d.ts.map +1 -0
- package/dist/core/exception/missing_capture_for_preview_exception.js +22 -0
- package/dist/core/exception/missing_capture_for_preview_exception.js.map +1 -0
- package/dist/core/exception/missing_job_type_exception.d.ts +11 -0
- package/dist/core/exception/missing_job_type_exception.d.ts.map +1 -0
- package/dist/core/exception/missing_job_type_exception.js +17 -0
- package/dist/core/exception/missing_job_type_exception.js.map +1 -0
- package/dist/core/exception/missing_ml_configuration_block_exception.d.ts +11 -0
- package/dist/core/exception/missing_ml_configuration_block_exception.d.ts.map +1 -0
- package/dist/core/exception/missing_ml_configuration_block_exception.js +19 -0
- package/dist/core/exception/missing_ml_configuration_block_exception.js.map +1 -0
- package/dist/core/exception/missing_network_configuration_block_exception.d.ts +11 -0
- package/dist/core/exception/missing_network_configuration_block_exception.d.ts.map +1 -0
- package/dist/core/exception/missing_network_configuration_block_exception.js +19 -0
- package/dist/core/exception/missing_network_configuration_block_exception.js.map +1 -0
- package/dist/core/exception/missing_partner_config_exception.d.ts +18 -0
- package/dist/core/exception/missing_partner_config_exception.d.ts.map +1 -0
- package/dist/core/exception/missing_partner_config_exception.js +35 -0
- package/dist/core/exception/missing_partner_config_exception.js.map +1 -0
- package/dist/core/exception/missing_required_field_exception.d.ts +13 -0
- package/dist/core/exception/missing_required_field_exception.d.ts.map +1 -0
- package/dist/core/exception/missing_required_field_exception.js +18 -0
- package/dist/core/exception/missing_required_field_exception.js.map +1 -0
- package/dist/core/exception/screen_config_validation_exceptions.d.ts +11 -0
- package/dist/core/exception/screen_config_validation_exceptions.d.ts.map +1 -0
- package/dist/core/exception/screen_config_validation_exceptions.js +11 -0
- package/dist/core/exception/screen_config_validation_exceptions.js.map +1 -0
- package/dist/core/exception/use_smile_id_attestation_exception.d.ts +12 -0
- package/dist/core/exception/use_smile_id_attestation_exception.d.ts.map +1 -0
- package/dist/core/exception/use_smile_id_attestation_exception.js +12 -0
- package/dist/core/exception/use_smile_id_attestation_exception.js.map +1 -0
- package/dist/core/exception/use_smile_id_builder_exception.d.ts +19 -0
- package/dist/core/exception/use_smile_id_builder_exception.d.ts.map +1 -0
- package/dist/core/exception/use_smile_id_builder_exception.js +19 -0
- package/dist/core/exception/use_smile_id_builder_exception.js.map +1 -0
- package/dist/core/exception/use_smile_id_camera_exception.d.ts +13 -0
- package/dist/core/exception/use_smile_id_camera_exception.d.ts.map +1 -0
- package/dist/core/exception/use_smile_id_camera_exception.js +13 -0
- package/dist/core/exception/use_smile_id_camera_exception.js.map +1 -0
- package/dist/core/exception/use_smile_id_error_code.d.ts +78 -0
- package/dist/core/exception/use_smile_id_error_code.d.ts.map +1 -0
- package/dist/core/exception/use_smile_id_error_code.js +70 -0
- package/dist/core/exception/use_smile_id_error_code.js.map +1 -0
- package/dist/core/exception/use_smile_id_exception.d.ts +27 -0
- package/dist/core/exception/use_smile_id_exception.d.ts.map +1 -0
- package/dist/core/exception/use_smile_id_exception.js +39 -0
- package/dist/core/exception/use_smile_id_exception.js.map +1 -0
- package/dist/core/exception/use_smile_id_general_exception.d.ts +13 -0
- package/dist/core/exception/use_smile_id_general_exception.d.ts.map +1 -0
- package/dist/core/exception/use_smile_id_general_exception.js +13 -0
- package/dist/core/exception/use_smile_id_general_exception.js.map +1 -0
- package/dist/core/exception/use_smile_id_network_exception.d.ts +117 -0
- package/dist/core/exception/use_smile_id_network_exception.d.ts.map +1 -0
- package/dist/core/exception/use_smile_id_network_exception.js +203 -0
- package/dist/core/exception/use_smile_id_network_exception.js.map +1 -0
- package/dist/core/exception/use_smile_id_validation_exception.d.ts +13 -0
- package/dist/core/exception/use_smile_id_validation_exception.d.ts.map +1 -0
- package/dist/core/exception/use_smile_id_validation_exception.js +13 -0
- package/dist/core/exception/use_smile_id_validation_exception.js.map +1 -0
- package/dist/core/models/config.d.ts +35 -0
- package/dist/core/models/config.d.ts.map +1 -0
- package/dist/core/models/config.js +2 -0
- package/dist/core/models/config.js.map +1 -0
- package/dist/core/models/document_capture_mode.d.ts +34 -0
- package/dist/core/models/document_capture_mode.d.ts.map +1 -0
- package/dist/core/models/document_capture_mode.js +23 -0
- package/dist/core/models/document_capture_mode.js.map +1 -0
- package/dist/core/models/document_type.d.ts +52 -0
- package/dist/core/models/document_type.d.ts.map +1 -0
- package/dist/core/models/document_type.js +45 -0
- package/dist/core/models/document_type.js.map +1 -0
- package/dist/core/models/flow_step.d.ts +10 -0
- package/dist/core/models/flow_step.d.ts.map +1 -0
- package/dist/core/models/flow_step.js +16 -0
- package/dist/core/models/flow_step.js.map +1 -0
- package/dist/core/models/head_turn_direction.d.ts +11 -0
- package/dist/core/models/head_turn_direction.d.ts.map +1 -0
- package/dist/core/models/head_turn_direction.js +14 -0
- package/dist/core/models/head_turn_direction.js.map +1 -0
- package/dist/core/models/job_type.d.ts +34 -0
- package/dist/core/models/job_type.d.ts.map +1 -0
- package/dist/core/models/job_type.js +43 -0
- package/dist/core/models/job_type.js.map +1 -0
- package/dist/core/models/ml_config.d.ts +41 -0
- package/dist/core/models/ml_config.d.ts.map +1 -0
- package/dist/core/models/ml_config.js +27 -0
- package/dist/core/models/ml_config.js.map +1 -0
- package/dist/core/models/network_config.d.ts +127 -0
- package/dist/core/models/network_config.d.ts.map +1 -0
- package/dist/core/models/network_config.js +41 -0
- package/dist/core/models/network_config.js.map +1 -0
- package/dist/core/models/params.d.ts +92 -0
- package/dist/core/models/params.d.ts.map +1 -0
- package/dist/core/models/params.js +5 -0
- package/dist/core/models/params.js.map +1 -0
- package/dist/core/models/result.d.ts +29 -0
- package/dist/core/models/result.d.ts.map +1 -0
- package/dist/core/models/result.js +18 -0
- package/dist/core/models/result.js.map +1 -0
- package/dist/data/api/auth/token_holder.d.ts +40 -0
- package/dist/data/api/auth/token_holder.d.ts.map +1 -0
- package/dist/data/api/auth/token_holder.js +67 -0
- package/dist/data/api/auth/token_holder.js.map +1 -0
- package/dist/data/api/interceptors/gzip_interceptor.d.ts +21 -0
- package/dist/data/api/interceptors/gzip_interceptor.d.ts.map +1 -0
- package/dist/data/api/interceptors/gzip_interceptor.js +29 -0
- package/dist/data/api/interceptors/gzip_interceptor.js.map +1 -0
- package/dist/data/api/interceptors/logging_interceptor.d.ts +26 -0
- package/dist/data/api/interceptors/logging_interceptor.d.ts.map +1 -0
- package/dist/data/api/interceptors/logging_interceptor.js +108 -0
- package/dist/data/api/interceptors/logging_interceptor.js.map +1 -0
- package/dist/data/api/interceptors/sensitive_headers.d.ts +26 -0
- package/dist/data/api/interceptors/sensitive_headers.d.ts.map +1 -0
- package/dist/data/api/interceptors/sensitive_headers.js +42 -0
- package/dist/data/api/interceptors/sensitive_headers.js.map +1 -0
- package/dist/data/api/interceptors/smile_auth_interceptor.d.ts +22 -0
- package/dist/data/api/interceptors/smile_auth_interceptor.d.ts.map +1 -0
- package/dist/data/api/interceptors/smile_auth_interceptor.js +71 -0
- package/dist/data/api/interceptors/smile_auth_interceptor.js.map +1 -0
- package/dist/data/api/interceptors/smile_integrity_interceptor.d.ts +39 -0
- package/dist/data/api/interceptors/smile_integrity_interceptor.d.ts.map +1 -0
- package/dist/data/api/interceptors/smile_integrity_interceptor.js +66 -0
- package/dist/data/api/interceptors/smile_integrity_interceptor.js.map +1 -0
- package/dist/data/api/interceptors/smile_request_mac_interceptor.d.ts +34 -0
- package/dist/data/api/interceptors/smile_request_mac_interceptor.d.ts.map +1 -0
- package/dist/data/api/interceptors/smile_request_mac_interceptor.js +66 -0
- package/dist/data/api/interceptors/smile_request_mac_interceptor.js.map +1 -0
- package/dist/data/api/interceptors/token_refresh_interceptor.d.ts +45 -0
- package/dist/data/api/interceptors/token_refresh_interceptor.d.ts.map +1 -0
- package/dist/data/api/interceptors/token_refresh_interceptor.js +58 -0
- package/dist/data/api/interceptors/token_refresh_interceptor.js.map +1 -0
- package/dist/data/api/smile_id_api.d.ts +124 -0
- package/dist/data/api/smile_id_api.d.ts.map +1 -0
- package/dist/data/api/smile_id_api.js +371 -0
- package/dist/data/api/smile_id_api.js.map +1 -0
- package/dist/data/dsl/builder/cache_config_builder.d.ts +20 -0
- package/dist/data/dsl/builder/cache_config_builder.d.ts.map +1 -0
- package/dist/data/dsl/builder/cache_config_builder.js +23 -0
- package/dist/data/dsl/builder/cache_config_builder.js.map +1 -0
- package/dist/data/dsl/builder/config_builder.d.ts +77 -0
- package/dist/data/dsl/builder/config_builder.d.ts.map +1 -0
- package/dist/data/dsl/builder/config_builder.js +111 -0
- package/dist/data/dsl/builder/config_builder.js.map +1 -0
- package/dist/data/dsl/builder/interceptor_config_builder.d.ts +46 -0
- package/dist/data/dsl/builder/interceptor_config_builder.d.ts.map +1 -0
- package/dist/data/dsl/builder/interceptor_config_builder.js +69 -0
- package/dist/data/dsl/builder/interceptor_config_builder.js.map +1 -0
- package/dist/data/dsl/builder/retry_config_builder.d.ts +21 -0
- package/dist/data/dsl/builder/retry_config_builder.d.ts.map +1 -0
- package/dist/data/dsl/builder/retry_config_builder.js +31 -0
- package/dist/data/dsl/builder/retry_config_builder.js.map +1 -0
- package/dist/data/dsl/builder/timeout_config_builder.d.ts +16 -0
- package/dist/data/dsl/builder/timeout_config_builder.d.ts.map +1 -0
- package/dist/data/dsl/builder/timeout_config_builder.js +22 -0
- package/dist/data/dsl/builder/timeout_config_builder.js.map +1 -0
- package/dist/data/dsl/use_smile_id_network_builder.d.ts +37 -0
- package/dist/data/dsl/use_smile_id_network_builder.d.ts.map +1 -0
- package/dist/data/dsl/use_smile_id_network_builder.js +66 -0
- package/dist/data/dsl/use_smile_id_network_builder.js.map +1 -0
- package/dist/data/factory/networking_factory.d.ts +53 -0
- package/dist/data/factory/networking_factory.d.ts.map +1 -0
- package/dist/data/factory/networking_factory.js +164 -0
- package/dist/data/factory/networking_factory.js.map +1 -0
- package/dist/data/model/image_dimensions.d.ts +16 -0
- package/dist/data/model/image_dimensions.d.ts.map +1 -0
- package/dist/data/model/image_dimensions.js +2 -0
- package/dist/data/model/image_dimensions.js.map +1 -0
- package/dist/data/model/job_request.d.ts +130 -0
- package/dist/data/model/job_request.d.ts.map +1 -0
- package/dist/data/model/job_request.js +2 -0
- package/dist/data/model/job_request.js.map +1 -0
- package/dist/data/model/job_submission_response.d.ts +18 -0
- package/dist/data/model/job_submission_response.d.ts.map +1 -0
- package/dist/data/model/job_submission_response.js +2 -0
- package/dist/data/model/job_submission_response.js.map +1 -0
- package/dist/data/model/sdk_config.d.ts +54 -0
- package/dist/data/model/sdk_config.d.ts.map +1 -0
- package/dist/data/model/sdk_config.js +68 -0
- package/dist/data/model/sdk_config.js.map +1 -0
- package/dist/data/model/sdk_config_capture.d.ts +39 -0
- package/dist/data/model/sdk_config_capture.d.ts.map +1 -0
- package/dist/data/model/sdk_config_capture.js +69 -0
- package/dist/data/model/sdk_config_capture.js.map +1 -0
- package/dist/data/model/sdk_config_source.d.ts +25 -0
- package/dist/data/model/sdk_config_source.d.ts.map +1 -0
- package/dist/data/model/sdk_config_source.js +24 -0
- package/dist/data/model/sdk_config_source.js.map +1 -0
- package/dist/data/repository/use_smile_id_repository.d.ts +19 -0
- package/dist/data/repository/use_smile_id_repository.d.ts.map +1 -0
- package/dist/data/repository/use_smile_id_repository.js +2 -0
- package/dist/data/repository/use_smile_id_repository.js.map +1 -0
- package/dist/data/repository/use_smile_id_repository_impl.d.ts +29 -0
- package/dist/data/repository/use_smile_id_repository_impl.d.ts.map +1 -0
- package/dist/data/repository/use_smile_id_repository_impl.js +75 -0
- package/dist/data/repository/use_smile_id_repository_impl.js.map +1 -0
- package/dist/data/security/request_canonicalizer.d.ts +4 -0
- package/dist/data/security/request_canonicalizer.d.ts.map +1 -0
- package/dist/data/security/request_canonicalizer.js +120 -0
- package/dist/data/security/request_canonicalizer.js.map +1 -0
- package/dist/data/security/request_timestamp.d.ts +11 -0
- package/dist/data/security/request_timestamp.d.ts.map +1 -0
- package/dist/data/security/request_timestamp.js +13 -0
- package/dist/data/security/request_timestamp.js.map +1 -0
- package/dist/data/security/signing_crypto.d.ts +25 -0
- package/dist/data/security/signing_crypto.d.ts.map +1 -0
- package/dist/data/security/signing_crypto.js +145 -0
- package/dist/data/security/signing_crypto.js.map +1 -0
- package/dist/data/security/smile_id_crypto_error.d.ts +11 -0
- package/dist/data/security/smile_id_crypto_error.d.ts.map +1 -0
- package/dist/data/security/smile_id_crypto_error.js +14 -0
- package/dist/data/security/smile_id_crypto_error.js.map +1 -0
- package/dist/data/security/smile_id_crypto_manager.d.ts +30 -0
- package/dist/data/security/smile_id_crypto_manager.d.ts.map +1 -0
- package/dist/data/security/smile_id_crypto_manager.js +40 -0
- package/dist/data/security/smile_id_crypto_manager.js.map +1 -0
- package/dist/data/smile_id_urls.d.ts +12 -0
- package/dist/data/smile_id_urls.d.ts.map +1 -0
- package/dist/data/smile_id_urls.js +14 -0
- package/dist/data/smile_id_urls.js.map +1 -0
- package/dist/data/util/retry_util.d.ts +27 -0
- package/dist/data/util/retry_util.d.ts.map +1 -0
- package/dist/data/util/retry_util.js +68 -0
- package/dist/data/util/retry_util.js.map +1 -0
- package/dist/data/util/use_smile_id_token_decoder.d.ts +33 -0
- package/dist/data/util/use_smile_id_token_decoder.d.ts.map +1 -0
- package/dist/data/util/use_smile_id_token_decoder.js +102 -0
- package/dist/data/util/use_smile_id_token_decoder.js.map +1 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +142 -0
- package/dist/index.js.map +1 -0
- package/dist/l10n/strings_en.d.ts +131 -0
- package/dist/l10n/strings_en.d.ts.map +1 -0
- package/dist/l10n/strings_en.js +141 -0
- package/dist/l10n/strings_en.js.map +1 -0
- package/dist/l10n/use_smile_id_localizations.d.ts +173 -0
- package/dist/l10n/use_smile_id_localizations.d.ts.map +1 -0
- package/dist/l10n/use_smile_id_localizations.js +487 -0
- package/dist/l10n/use_smile_id_localizations.js.map +1 -0
- package/dist/l10n/use_smile_id_localizations_provider.d.ts +26 -0
- package/dist/l10n/use_smile_id_localizations_provider.d.ts.map +1 -0
- package/dist/l10n/use_smile_id_localizations_provider.js +53 -0
- package/dist/l10n/use_smile_id_localizations_provider.js.map +1 -0
- package/dist/metadata/document_image_origin.d.ts +20 -0
- package/dist/metadata/document_image_origin.d.ts.map +1 -0
- package/dist/metadata/document_image_origin.js +19 -0
- package/dist/metadata/document_image_origin.js.map +1 -0
- package/dist/metadata/optional_native_modules.d.ts +85 -0
- package/dist/metadata/optional_native_modules.d.ts.map +1 -0
- package/dist/metadata/optional_native_modules.js +101 -0
- package/dist/metadata/optional_native_modules.js.map +1 -0
- package/dist/metadata/use_smile_id_metadata.d.ts +69 -0
- package/dist/metadata/use_smile_id_metadata.d.ts.map +1 -0
- package/dist/metadata/use_smile_id_metadata.js +116 -0
- package/dist/metadata/use_smile_id_metadata.js.map +1 -0
- package/dist/metadata/use_smile_id_metadata_factory.d.ts +82 -0
- package/dist/metadata/use_smile_id_metadata_factory.d.ts.map +1 -0
- package/dist/metadata/use_smile_id_metadata_factory.js +320 -0
- package/dist/metadata/use_smile_id_metadata_factory.js.map +1 -0
- package/dist/presentation/assets/svg/instruction_svg_strings.d.ts +17 -0
- package/dist/presentation/assets/svg/instruction_svg_strings.d.ts.map +1 -0
- package/dist/presentation/assets/svg/instruction_svg_strings.js +21 -0
- package/dist/presentation/assets/svg/instruction_svg_strings.js.map +1 -0
- package/dist/presentation/assets/svg/svg_strings.d.ts +29 -0
- package/dist/presentation/assets/svg/svg_strings.d.ts.map +1 -0
- package/dist/presentation/assets/svg/svg_strings.js +140 -0
- package/dist/presentation/assets/svg/svg_strings.js.map +1 -0
- package/dist/presentation/components/face_oval_defaults.d.ts +41 -0
- package/dist/presentation/components/face_oval_defaults.d.ts.map +1 -0
- package/dist/presentation/components/face_oval_defaults.js +41 -0
- package/dist/presentation/components/face_oval_defaults.js.map +1 -0
- package/dist/presentation/components/helpers/animated_lottie_view.d.ts +9 -0
- package/dist/presentation/components/helpers/animated_lottie_view.d.ts.map +1 -0
- package/dist/presentation/components/helpers/animated_lottie_view.js +9 -0
- package/dist/presentation/components/helpers/animated_lottie_view.js.map +1 -0
- package/dist/presentation/components/helpers/capture_instruction_animation_spec.d.ts +26 -0
- package/dist/presentation/components/helpers/capture_instruction_animation_spec.d.ts.map +1 -0
- package/dist/presentation/components/helpers/capture_instruction_animation_spec.js +47 -0
- package/dist/presentation/components/helpers/capture_instruction_animation_spec.js.map +1 -0
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.d.ts +70 -0
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.d.ts.map +1 -0
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.js +49 -0
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.js.map +1 -0
- package/dist/presentation/components/helpers/scaled_oval_geometry.d.ts +24 -0
- package/dist/presentation/components/helpers/scaled_oval_geometry.d.ts.map +1 -0
- package/dist/presentation/components/helpers/scaled_oval_geometry.js +29 -0
- package/dist/presentation/components/helpers/scaled_oval_geometry.js.map +1 -0
- package/dist/presentation/components/icons/index.d.ts +82 -0
- package/dist/presentation/components/icons/index.d.ts.map +1 -0
- package/dist/presentation/components/icons/index.js +97 -0
- package/dist/presentation/components/icons/index.js.map +1 -0
- package/dist/presentation/components/status_indicator_state.d.ts +20 -0
- package/dist/presentation/components/status_indicator_state.d.ts.map +1 -0
- package/dist/presentation/components/status_indicator_state.js +19 -0
- package/dist/presentation/components/status_indicator_state.js.map +1 -0
- package/dist/presentation/components/use_smile_id_attribution.d.ts +19 -0
- package/dist/presentation/components/use_smile_id_attribution.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_attribution.js +25 -0
- package/dist/presentation/components/use_smile_id_attribution.js.map +1 -0
- package/dist/presentation/components/use_smile_id_back_button.d.ts +15 -0
- package/dist/presentation/components/use_smile_id_back_button.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_back_button.js +38 -0
- package/dist/presentation/components/use_smile_id_back_button.js.map +1 -0
- package/dist/presentation/components/use_smile_id_button.d.ts +20 -0
- package/dist/presentation/components/use_smile_id_button.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_button.js +63 -0
- package/dist/presentation/components/use_smile_id_button.js.map +1 -0
- package/dist/presentation/components/use_smile_id_capture_content.d.ts +58 -0
- package/dist/presentation/components/use_smile_id_capture_content.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_capture_content.js +131 -0
- package/dist/presentation/components/use_smile_id_capture_content.js.map +1 -0
- package/dist/presentation/components/use_smile_id_capture_instruction_animation.d.ts +20 -0
- package/dist/presentation/components/use_smile_id_capture_instruction_animation.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_capture_instruction_animation.js +50 -0
- package/dist/presentation/components/use_smile_id_capture_instruction_animation.js.map +1 -0
- package/dist/presentation/components/use_smile_id_capture_spinner.d.ts +9 -0
- package/dist/presentation/components/use_smile_id_capture_spinner.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_capture_spinner.js +30 -0
- package/dist/presentation/components/use_smile_id_capture_spinner.js.map +1 -0
- package/dist/presentation/components/use_smile_id_captured_document_image.d.ts +23 -0
- package/dist/presentation/components/use_smile_id_captured_document_image.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_captured_document_image.js +41 -0
- package/dist/presentation/components/use_smile_id_captured_document_image.js.map +1 -0
- package/dist/presentation/components/use_smile_id_captured_image_oval.d.ts +41 -0
- package/dist/presentation/components/use_smile_id_captured_image_oval.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_captured_image_oval.js +63 -0
- package/dist/presentation/components/use_smile_id_captured_image_oval.js.map +1 -0
- package/dist/presentation/components/use_smile_id_card_surface.d.ts +17 -0
- package/dist/presentation/components/use_smile_id_card_surface.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_card_surface.js +37 -0
- package/dist/presentation/components/use_smile_id_card_surface.js.map +1 -0
- package/dist/presentation/components/use_smile_id_confirmation_buttons.d.ts +18 -0
- package/dist/presentation/components/use_smile_id_confirmation_buttons.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_confirmation_buttons.js +48 -0
- package/dist/presentation/components/use_smile_id_confirmation_buttons.js.map +1 -0
- package/dist/presentation/components/use_smile_id_consent_row.d.ts +18 -0
- package/dist/presentation/components/use_smile_id_consent_row.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_consent_row.js +32 -0
- package/dist/presentation/components/use_smile_id_consent_row.js.map +1 -0
- package/dist/presentation/components/use_smile_id_content_card.d.ts +21 -0
- package/dist/presentation/components/use_smile_id_content_card.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_content_card.js +41 -0
- package/dist/presentation/components/use_smile_id_content_card.js.map +1 -0
- package/dist/presentation/components/use_smile_id_document_capture_controls.d.ts +27 -0
- package/dist/presentation/components/use_smile_id_document_capture_controls.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_document_capture_controls.js +77 -0
- package/dist/presentation/components/use_smile_id_document_capture_controls.js.map +1 -0
- package/dist/presentation/components/use_smile_id_document_frame_glyph.d.ts +17 -0
- package/dist/presentation/components/use_smile_id_document_frame_glyph.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_document_frame_glyph.js +17 -0
- package/dist/presentation/components/use_smile_id_document_frame_glyph.js.map +1 -0
- package/dist/presentation/components/use_smile_id_document_overlay.d.ts +25 -0
- package/dist/presentation/components/use_smile_id_document_overlay.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_document_overlay.js +118 -0
- package/dist/presentation/components/use_smile_id_document_overlay.js.map +1 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.d.ts +24 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.js +91 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.js.map +1 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts +24 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js +74 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js.map +1 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.d.ts +25 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.js +21 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.js.map +1 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.d.ts +13 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.js +14 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.js.map +1 -0
- package/dist/presentation/components/use_smile_id_expandable_icon.d.ts +22 -0
- package/dist/presentation/components/use_smile_id_expandable_icon.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_expandable_icon.js +55 -0
- package/dist/presentation/components/use_smile_id_expandable_icon.js.map +1 -0
- package/dist/presentation/components/use_smile_id_face_oval_image.d.ts +26 -0
- package/dist/presentation/components/use_smile_id_face_oval_image.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_face_oval_image.js +41 -0
- package/dist/presentation/components/use_smile_id_face_oval_image.js.map +1 -0
- package/dist/presentation/components/use_smile_id_face_overlay.d.ts +23 -0
- package/dist/presentation/components/use_smile_id_face_overlay.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_face_overlay.js +194 -0
- package/dist/presentation/components/use_smile_id_face_overlay.js.map +1 -0
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.d.ts +15 -0
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.js +19 -0
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.js.map +1 -0
- package/dist/presentation/components/use_smile_id_failed_content.d.ts +19 -0
- package/dist/presentation/components/use_smile_id_failed_content.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_failed_content.js +44 -0
- package/dist/presentation/components/use_smile_id_failed_content.js.map +1 -0
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.d.ts +12 -0
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.js +96 -0
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.js.map +1 -0
- package/dist/presentation/components/use_smile_id_instruction_card.d.ts +31 -0
- package/dist/presentation/components/use_smile_id_instruction_card.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_instruction_card.js +43 -0
- package/dist/presentation/components/use_smile_id_instruction_card.js.map +1 -0
- package/dist/presentation/components/use_smile_id_instructions_hero.d.ts +26 -0
- package/dist/presentation/components/use_smile_id_instructions_hero.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_instructions_hero.js +144 -0
- package/dist/presentation/components/use_smile_id_instructions_hero.js.map +1 -0
- package/dist/presentation/components/use_smile_id_learn_more_content.d.ts +24 -0
- package/dist/presentation/components/use_smile_id_learn_more_content.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_learn_more_content.js +70 -0
- package/dist/presentation/components/use_smile_id_learn_more_content.js.map +1 -0
- package/dist/presentation/components/use_smile_id_loading_content.d.ts +14 -0
- package/dist/presentation/components/use_smile_id_loading_content.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_loading_content.js +31 -0
- package/dist/presentation/components/use_smile_id_loading_content.js.map +1 -0
- package/dist/presentation/components/use_smile_id_loading_indicator.d.ts +15 -0
- package/dist/presentation/components/use_smile_id_loading_indicator.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_loading_indicator.js +48 -0
- package/dist/presentation/components/use_smile_id_loading_indicator.js.map +1 -0
- package/dist/presentation/components/use_smile_id_oval_border_palette.d.ts +12 -0
- package/dist/presentation/components/use_smile_id_oval_border_palette.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_oval_border_palette.js +45 -0
- package/dist/presentation/components/use_smile_id_oval_border_palette.js.map +1 -0
- package/dist/presentation/components/use_smile_id_partner_icon.d.ts +18 -0
- package/dist/presentation/components/use_smile_id_partner_icon.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_partner_icon.js +34 -0
- package/dist/presentation/components/use_smile_id_partner_icon.js.map +1 -0
- package/dist/presentation/components/use_smile_id_processing_center_indicator.d.ts +26 -0
- package/dist/presentation/components/use_smile_id_processing_center_indicator.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_processing_center_indicator.js +44 -0
- package/dist/presentation/components/use_smile_id_processing_center_indicator.js.map +1 -0
- package/dist/presentation/components/use_smile_id_rounded_checkbox.d.ts +18 -0
- package/dist/presentation/components/use_smile_id_rounded_checkbox.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_rounded_checkbox.js +41 -0
- package/dist/presentation/components/use_smile_id_rounded_checkbox.js.map +1 -0
- package/dist/presentation/components/use_smile_id_status_indicator.d.ts +16 -0
- package/dist/presentation/components/use_smile_id_status_indicator.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_status_indicator.js +22 -0
- package/dist/presentation/components/use_smile_id_status_indicator.js.map +1 -0
- package/dist/presentation/components/use_smile_id_success_content.d.ts +17 -0
- package/dist/presentation/components/use_smile_id_success_content.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_success_content.js +39 -0
- package/dist/presentation/components/use_smile_id_success_content.js.map +1 -0
- package/dist/presentation/flow/analytics/use_smile_id_analytics_event.d.ts +77 -0
- package/dist/presentation/flow/analytics/use_smile_id_analytics_event.d.ts.map +1 -0
- package/dist/presentation/flow/analytics/use_smile_id_analytics_event.js +71 -0
- package/dist/presentation/flow/analytics/use_smile_id_analytics_event.js.map +1 -0
- package/dist/presentation/flow/config/flow_configuration.d.ts +12 -0
- package/dist/presentation/flow/config/flow_configuration.d.ts.map +1 -0
- package/dist/presentation/flow/config/flow_configuration.js +2 -0
- package/dist/presentation/flow/config/flow_configuration.js.map +1 -0
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts +15 -0
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts.map +1 -0
- package/dist/presentation/flow/dsl/builder/config_builder.js +20 -0
- package/dist/presentation/flow/dsl/builder/config_builder.js.map +1 -0
- package/dist/presentation/flow/dsl/builder/ml_builder.d.ts +80 -0
- package/dist/presentation/flow/dsl/builder/ml_builder.d.ts.map +1 -0
- package/dist/presentation/flow/dsl/builder/ml_builder.js +163 -0
- package/dist/presentation/flow/dsl/builder/ml_builder.js.map +1 -0
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts +122 -0
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts.map +1 -0
- package/dist/presentation/flow/dsl/builder/screens_builder.js +119 -0
- package/dist/presentation/flow/dsl/builder/screens_builder.js.map +1 -0
- package/dist/presentation/flow/dsl/builder/theme_builder.d.ts +44 -0
- package/dist/presentation/flow/dsl/builder/theme_builder.d.ts.map +1 -0
- package/dist/presentation/flow/dsl/builder/theme_builder.js +70 -0
- package/dist/presentation/flow/dsl/builder/theme_builder.js.map +1 -0
- package/dist/presentation/flow/dsl/flow_build_result.d.ts +35 -0
- package/dist/presentation/flow/dsl/flow_build_result.d.ts.map +1 -0
- package/dist/presentation/flow/dsl/flow_build_result.js +2 -0
- package/dist/presentation/flow/dsl/flow_build_result.js.map +1 -0
- package/dist/presentation/flow/dsl/use_smile_id_builder.d.ts +59 -0
- package/dist/presentation/flow/dsl/use_smile_id_builder.d.ts.map +1 -0
- package/dist/presentation/flow/dsl/use_smile_id_builder.js +49 -0
- package/dist/presentation/flow/dsl/use_smile_id_builder.js.map +1 -0
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.d.ts +241 -0
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.d.ts.map +1 -0
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js +308 -0
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js.map +1 -0
- package/dist/presentation/flow/flow_navigation_context.d.ts +17 -0
- package/dist/presentation/flow/flow_navigation_context.d.ts.map +1 -0
- package/dist/presentation/flow/flow_navigation_context.js +34 -0
- package/dist/presentation/flow/flow_navigation_context.js.map +1 -0
- package/dist/presentation/flow/flow_navigation_manager.d.ts +217 -0
- package/dist/presentation/flow/flow_navigation_manager.d.ts.map +1 -0
- package/dist/presentation/flow/flow_navigation_manager.js +766 -0
- package/dist/presentation/flow/flow_navigation_manager.js.map +1 -0
- package/dist/presentation/flow/graph/screen_renderer.d.ts +16 -0
- package/dist/presentation/flow/graph/screen_renderer.d.ts.map +1 -0
- package/dist/presentation/flow/graph/screen_renderer.js +31 -0
- package/dist/presentation/flow/graph/screen_renderer.js.map +1 -0
- package/dist/presentation/flow/job_submission_state.d.ts +23 -0
- package/dist/presentation/flow/job_submission_state.d.ts.map +1 -0
- package/dist/presentation/flow/job_submission_state.js +2 -0
- package/dist/presentation/flow/job_submission_state.js.map +1 -0
- package/dist/presentation/flow/model/instruction_guideline.d.ts +17 -0
- package/dist/presentation/flow/model/instruction_guideline.d.ts.map +1 -0
- package/dist/presentation/flow/model/instruction_guideline.js +2 -0
- package/dist/presentation/flow/model/instruction_guideline.js.map +1 -0
- package/dist/presentation/flow/model/instructions_defaults.d.ts +27 -0
- package/dist/presentation/flow/model/instructions_defaults.d.ts.map +1 -0
- package/dist/presentation/flow/model/instructions_defaults.js +82 -0
- package/dist/presentation/flow/model/instructions_defaults.js.map +1 -0
- package/dist/presentation/flow/screen/helpers/face_session_config.d.ts +25 -0
- package/dist/presentation/flow/screen/helpers/face_session_config.d.ts.map +1 -0
- package/dist/presentation/flow/screen/helpers/face_session_config.js +65 -0
- package/dist/presentation/flow/screen/helpers/face_session_config.js.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_capture_screen.d.ts +13 -0
- package/dist/presentation/flow/screen/orchestrated_capture_screen.d.ts.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_capture_screen.js +203 -0
- package/dist/presentation/flow/screen/orchestrated_capture_screen.js.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_consent_screen.d.ts +14 -0
- package/dist/presentation/flow/screen/orchestrated_consent_screen.d.ts.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_consent_screen.js +47 -0
- package/dist/presentation/flow/screen/orchestrated_consent_screen.js.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.d.ts +12 -0
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.d.ts.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.js +47 -0
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.js.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_preview_screen.d.ts +12 -0
- package/dist/presentation/flow/screen/orchestrated_preview_screen.d.ts.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js +40 -0
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_processing_screen.d.ts +11 -0
- package/dist/presentation/flow/screen/orchestrated_processing_screen.d.ts.map +1 -0
- package/dist/presentation/flow/screen/orchestrated_processing_screen.js +59 -0
- package/dist/presentation/flow/screen/orchestrated_processing_screen.js.map +1 -0
- package/dist/presentation/flow/screen/use_smile_id_orchestrated_screen_host.d.ts +23 -0
- package/dist/presentation/flow/screen/use_smile_id_orchestrated_screen_host.d.ts.map +1 -0
- package/dist/presentation/flow/screen/use_smile_id_orchestrated_screen_host.js +22 -0
- package/dist/presentation/flow/screen/use_smile_id_orchestrated_screen_host.js.map +1 -0
- package/dist/presentation/flow/screen/validation_error_screen.d.ts +12 -0
- package/dist/presentation/flow/screen/validation_error_screen.d.ts.map +1 -0
- package/dist/presentation/flow/screen/validation_error_screen.js +87 -0
- package/dist/presentation/flow/screen/validation_error_screen.js.map +1 -0
- package/dist/presentation/flow/use_smile_id_flow.d.ts +54 -0
- package/dist/presentation/flow/use_smile_id_flow.d.ts.map +1 -0
- package/dist/presentation/flow/use_smile_id_flow.js +264 -0
- package/dist/presentation/flow/use_smile_id_flow.js.map +1 -0
- package/dist/presentation/flow/validation/flow_validator.d.ts +107 -0
- package/dist/presentation/flow/validation/flow_validator.d.ts.map +1 -0
- package/dist/presentation/flow/validation/flow_validator.js +286 -0
- package/dist/presentation/flow/validation/flow_validator.js.map +1 -0
- package/dist/presentation/flow/validation/job_type_validator.d.ts +124 -0
- package/dist/presentation/flow/validation/job_type_validator.d.ts.map +1 -0
- package/dist/presentation/flow/validation/job_type_validator.js +420 -0
- package/dist/presentation/flow/validation/job_type_validator.js.map +1 -0
- package/dist/presentation/flow/validation/validation_state.d.ts +59 -0
- package/dist/presentation/flow/validation/validation_state.d.ts.map +1 -0
- package/dist/presentation/flow/validation/validation_state.js +23 -0
- package/dist/presentation/flow/validation/validation_state.js.map +1 -0
- package/dist/presentation/screen/helpers/capture_screen_helpers.d.ts +29 -0
- package/dist/presentation/screen/helpers/capture_screen_helpers.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/capture_screen_helpers.js +133 -0
- package/dist/presentation/screen/helpers/capture_screen_helpers.js.map +1 -0
- package/dist/presentation/screen/helpers/capture_ui_state.d.ts +54 -0
- package/dist/presentation/screen/helpers/capture_ui_state.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/capture_ui_state.js +179 -0
- package/dist/presentation/screen/helpers/capture_ui_state.js.map +1 -0
- package/dist/presentation/screen/helpers/consent_screen_helpers.d.ts +39 -0
- package/dist/presentation/screen/helpers/consent_screen_helpers.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/consent_screen_helpers.js +68 -0
- package/dist/presentation/screen/helpers/consent_screen_helpers.js.map +1 -0
- package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts +27 -0
- package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/ess_turn_haptics.js +53 -0
- package/dist/presentation/screen/helpers/ess_turn_haptics.js.map +1 -0
- package/dist/presentation/screen/helpers/feedback_debouncer.d.ts +37 -0
- package/dist/presentation/screen/helpers/feedback_debouncer.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/feedback_debouncer.js +77 -0
- package/dist/presentation/screen/helpers/feedback_debouncer.js.map +1 -0
- package/dist/presentation/screen/helpers/instructions_screen_helpers.d.ts +43 -0
- package/dist/presentation/screen/helpers/instructions_screen_helpers.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/instructions_screen_helpers.js +50 -0
- package/dist/presentation/screen/helpers/instructions_screen_helpers.js.map +1 -0
- package/dist/presentation/screen/helpers/preview_screen_helpers.d.ts +29 -0
- package/dist/presentation/screen/helpers/preview_screen_helpers.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/preview_screen_helpers.js +27 -0
- package/dist/presentation/screen/helpers/preview_screen_helpers.js.map +1 -0
- package/dist/presentation/screen/helpers/processing_screen_helpers.d.ts +13 -0
- package/dist/presentation/screen/helpers/processing_screen_helpers.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/processing_screen_helpers.js +12 -0
- package/dist/presentation/screen/helpers/processing_screen_helpers.js.map +1 -0
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts +21 -0
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js +104 -0
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js.map +1 -0
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts +16 -0
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.js +37 -0
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.js.map +1 -0
- package/dist/presentation/screen/helpers/use_debounced_feedback_key.d.ts +9 -0
- package/dist/presentation/screen/helpers/use_debounced_feedback_key.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/use_debounced_feedback_key.js +44 -0
- package/dist/presentation/screen/helpers/use_debounced_feedback_key.js.map +1 -0
- package/dist/presentation/screen/helpers/use_document_orientation_lock.d.ts +24 -0
- package/dist/presentation/screen/helpers/use_document_orientation_lock.d.ts.map +1 -0
- package/dist/presentation/screen/helpers/use_document_orientation_lock.js +47 -0
- package/dist/presentation/screen/helpers/use_document_orientation_lock.js.map +1 -0
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts +71 -0
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts.map +1 -0
- package/dist/presentation/screen/use_smile_id_capture_screen.js +438 -0
- package/dist/presentation/screen/use_smile_id_capture_screen.js.map +1 -0
- package/dist/presentation/screen/use_smile_id_consent_screen.d.ts +56 -0
- package/dist/presentation/screen/use_smile_id_consent_screen.d.ts.map +1 -0
- package/dist/presentation/screen/use_smile_id_consent_screen.js +175 -0
- package/dist/presentation/screen/use_smile_id_consent_screen.js.map +1 -0
- package/dist/presentation/screen/use_smile_id_document_back_instructions.d.ts +24 -0
- package/dist/presentation/screen/use_smile_id_document_back_instructions.d.ts.map +1 -0
- package/dist/presentation/screen/use_smile_id_document_back_instructions.js +51 -0
- package/dist/presentation/screen/use_smile_id_document_back_instructions.js.map +1 -0
- package/dist/presentation/screen/use_smile_id_document_preview_screen.d.ts +24 -0
- package/dist/presentation/screen/use_smile_id_document_preview_screen.d.ts.map +1 -0
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js +64 -0
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js.map +1 -0
- package/dist/presentation/screen/use_smile_id_instructions_screen.d.ts +39 -0
- package/dist/presentation/screen/use_smile_id_instructions_screen.d.ts.map +1 -0
- package/dist/presentation/screen/use_smile_id_instructions_screen.js +65 -0
- package/dist/presentation/screen/use_smile_id_instructions_screen.js.map +1 -0
- package/dist/presentation/screen/use_smile_id_permission_screen.d.ts +16 -0
- package/dist/presentation/screen/use_smile_id_permission_screen.d.ts.map +1 -0
- package/dist/presentation/screen/use_smile_id_permission_screen.js +28 -0
- package/dist/presentation/screen/use_smile_id_permission_screen.js.map +1 -0
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts +42 -0
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts.map +1 -0
- package/dist/presentation/screen/use_smile_id_preview_screen.js +81 -0
- package/dist/presentation/screen/use_smile_id_preview_screen.js.map +1 -0
- package/dist/presentation/screen/use_smile_id_processing_screen.d.ts +55 -0
- package/dist/presentation/screen/use_smile_id_processing_screen.d.ts.map +1 -0
- package/dist/presentation/screen/use_smile_id_processing_screen.js +84 -0
- package/dist/presentation/screen/use_smile_id_processing_screen.js.map +1 -0
- package/dist/presentation/state/processing_state.d.ts +25 -0
- package/dist/presentation/state/processing_state.d.ts.map +1 -0
- package/dist/presentation/state/processing_state.js +2 -0
- package/dist/presentation/state/processing_state.js.map +1 -0
- package/dist/presentation/state/use_smile_id_overlay_state.d.ts +44 -0
- package/dist/presentation/state/use_smile_id_overlay_state.d.ts.map +1 -0
- package/dist/presentation/state/use_smile_id_overlay_state.js +56 -0
- package/dist/presentation/state/use_smile_id_overlay_state.js.map +1 -0
- package/dist/presentation/theme/theme.d.ts +131 -0
- package/dist/presentation/theme/theme.d.ts.map +1 -0
- package/dist/presentation/theme/theme.js +224 -0
- package/dist/presentation/theme/theme.js.map +1 -0
- package/dist/presentation/theme/theme_context.d.ts +14 -0
- package/dist/presentation/theme/theme_context.d.ts.map +1 -0
- package/dist/presentation/theme/theme_context.js +31 -0
- package/dist/presentation/theme/theme_context.js.map +1 -0
- package/dist/presentation/theme/use_smile_id_motion.d.ts +13 -0
- package/dist/presentation/theme/use_smile_id_motion.d.ts.map +1 -0
- package/dist/presentation/theme/use_smile_id_motion.js +13 -0
- package/dist/presentation/theme/use_smile_id_motion.js.map +1 -0
- package/dist/presentation/theme/use_use_smile_id_fonts.d.ts +14 -0
- package/dist/presentation/theme/use_use_smile_id_fonts.d.ts.map +1 -0
- package/dist/presentation/theme/use_use_smile_id_fonts.js +64 -0
- package/dist/presentation/theme/use_use_smile_id_fonts.js.map +1 -0
- package/dist/presentation/utils/force_max_brightness.d.ts +46 -0
- package/dist/presentation/utils/force_max_brightness.d.ts.map +1 -0
- package/dist/presentation/utils/force_max_brightness.js +105 -0
- package/dist/presentation/utils/force_max_brightness.js.map +1 -0
- package/dist/presentation/utils/locale_utils.d.ts +25 -0
- package/dist/presentation/utils/locale_utils.d.ts.map +1 -0
- package/dist/presentation/utils/locale_utils.js +66 -0
- package/dist/presentation/utils/locale_utils.js.map +1 -0
- package/dist/presentation/utils/use_reduced_motion.d.ts +3 -0
- package/dist/presentation/utils/use_reduced_motion.d.ts.map +1 -0
- package/dist/presentation/utils/use_reduced_motion.js +24 -0
- package/dist/presentation/utils/use_reduced_motion.js.map +1 -0
- package/package.json +113 -0
- package/src/__tests__/dsl.test.ts +1115 -0
- package/src/__tests__/enum_parity.test.ts +84 -0
- package/src/__tests__/react_native_mock.tsx +210 -0
- package/src/__tests__/setup_react_native.ts +353 -0
- package/src/__tests__/theme.test.ts +156 -0
- package/src/camera/__tests__/camera_defaults.test.ts +28 -0
- package/src/camera/__tests__/camera_lens.test.ts +18 -0
- package/src/camera/__tests__/document_resize_target.test.ts +44 -0
- package/src/camera/__tests__/focus_state.test.ts +48 -0
- package/src/camera/__tests__/orientation_degrees.test.ts +21 -0
- package/src/camera/__tests__/use_smile_id_frame_stream.test.ts +227 -0
- package/src/camera/camera_configuration.ts +32 -0
- package/src/camera/camera_defaults.ts +23 -0
- package/src/camera/camera_lens.ts +13 -0
- package/src/camera/camera_permissions.ts +36 -0
- package/src/camera/camera_preview_image.ts +19 -0
- package/src/camera/document_image_pipeline.ts +101 -0
- package/src/camera/document_resize_target.ts +22 -0
- package/src/camera/focus_state.ts +26 -0
- package/src/camera/orientation_degrees.ts +22 -0
- package/src/camera/use_smile_id_camera_preview.tsx +256 -0
- package/src/camera/use_smile_id_camera_system.ts +236 -0
- package/src/camera/use_smile_id_frame_stream.ts +189 -0
- package/src/core/exception/__tests__/network_exception_mapper.test.ts +179 -0
- package/src/core/exception/builder_validation_exception.ts +40 -0
- package/src/core/exception/capture_validation_exceptions.ts +8 -0
- package/src/core/exception/consent_validation_exceptions.ts +7 -0
- package/src/core/exception/duplicate_screen_type_exception.ts +22 -0
- package/src/core/exception/empty_screens_block_exception.ts +19 -0
- package/src/core/exception/flow_exceptions.test.ts +39 -0
- package/src/core/exception/flow_exceptions.ts +42 -0
- package/src/core/exception/index.ts +73 -0
- package/src/core/exception/invalid_consent_config_exception.ts +20 -0
- package/src/core/exception/invalid_consent_information_exception.ts +21 -0
- package/src/core/exception/invalid_document_capture_config_exception.ts +22 -0
- package/src/core/exception/invalid_field_value_exception.ts +21 -0
- package/src/core/exception/invalid_job_type_screen_config_exception.ts +70 -0
- package/src/core/exception/invalid_missing_capture_type_exception.ts +19 -0
- package/src/core/exception/invalid_screen_order_exception.ts +28 -0
- package/src/core/exception/invalid_selfie_capture_config_exception.ts +22 -0
- package/src/core/exception/issue_severity.ts +14 -0
- package/src/core/exception/job_validation_exceptions.ts +11 -0
- package/src/core/exception/liveness_frame_count_exception.ts +21 -0
- package/src/core/exception/missing_capture_for_preview_exception.ts +24 -0
- package/src/core/exception/missing_job_type_exception.ts +20 -0
- package/src/core/exception/missing_ml_configuration_block_exception.ts +21 -0
- package/src/core/exception/missing_network_configuration_block_exception.ts +22 -0
- package/src/core/exception/missing_partner_config_exception.ts +38 -0
- package/src/core/exception/missing_required_field_exception.ts +19 -0
- package/src/core/exception/screen_config_validation_exceptions.ts +10 -0
- package/src/core/exception/use_smile_id_attestation_exception.ts +11 -0
- package/src/core/exception/use_smile_id_builder_exception.ts +18 -0
- package/src/core/exception/use_smile_id_camera_exception.ts +12 -0
- package/src/core/exception/use_smile_id_error_code.ts +83 -0
- package/src/core/exception/use_smile_id_exception.ts +52 -0
- package/src/core/exception/use_smile_id_general_exception.ts +12 -0
- package/src/core/exception/use_smile_id_network_exception.ts +279 -0
- package/src/core/exception/use_smile_id_validation_exception.ts +12 -0
- package/src/core/models/__tests__/document_capture_mode.test.ts +43 -0
- package/src/core/models/__tests__/document_type.test.ts +64 -0
- package/src/core/models/__tests__/job_type.test.ts +48 -0
- package/src/core/models/config.ts +36 -0
- package/src/core/models/document_capture_mode.ts +46 -0
- package/src/core/models/document_type.ts +77 -0
- package/src/core/models/flow_step.ts +17 -0
- package/src/core/models/head_turn_direction.ts +15 -0
- package/src/core/models/job_type.ts +53 -0
- package/src/core/models/ml_config.ts +47 -0
- package/src/core/models/network_config.ts +138 -0
- package/src/core/models/params.ts +98 -0
- package/src/core/models/result.test.ts +20 -0
- package/src/core/models/result.ts +32 -0
- package/src/data/api/__tests__/smile_id_api.test.ts +1197 -0
- package/src/data/api/auth/token_holder.ts +72 -0
- package/src/data/api/interceptors/__tests__/logging_interceptor.test.ts +252 -0
- package/src/data/api/interceptors/__tests__/sensitive_headers.test.ts +29 -0
- package/src/data/api/interceptors/__tests__/smile_integrity_interceptor.test.ts +156 -0
- package/src/data/api/interceptors/__tests__/smile_request_mac_interceptor.test.ts +98 -0
- package/src/data/api/interceptors/__tests__/token_refresh_interceptor.test.ts +173 -0
- package/src/data/api/interceptors/gzip_interceptor.ts +31 -0
- package/src/data/api/interceptors/logging_interceptor.ts +155 -0
- package/src/data/api/interceptors/sensitive_headers.ts +46 -0
- package/src/data/api/interceptors/smile_auth_interceptor.ts +88 -0
- package/src/data/api/interceptors/smile_integrity_interceptor.ts +79 -0
- package/src/data/api/interceptors/smile_request_mac_interceptor.ts +93 -0
- package/src/data/api/interceptors/token_refresh_interceptor.ts +122 -0
- package/src/data/api/smile_id_api.ts +488 -0
- package/src/data/dsl/builder/__tests__/interceptor_config_builder.test.ts +173 -0
- package/src/data/dsl/builder/cache_config_builder.ts +26 -0
- package/src/data/dsl/builder/config_builder.ts +125 -0
- package/src/data/dsl/builder/interceptor_config_builder.ts +81 -0
- package/src/data/dsl/builder/retry_config_builder.ts +36 -0
- package/src/data/dsl/builder/timeout_config_builder.ts +24 -0
- package/src/data/dsl/use_smile_id_network_builder.ts +69 -0
- package/src/data/factory/__tests__/networking_factory_order.test.ts +201 -0
- package/src/data/factory/__tests__/signed_job_submission_headers.test.ts +110 -0
- package/src/data/factory/networking_factory.ts +188 -0
- package/src/data/model/__tests__/sdk_config.test.ts +85 -0
- package/src/data/model/__tests__/sdk_config_capture.test.ts +140 -0
- package/src/data/model/image_dimensions.ts +15 -0
- package/src/data/model/job_request.ts +150 -0
- package/src/data/model/job_submission_response.ts +17 -0
- package/src/data/model/sdk_config.ts +74 -0
- package/src/data/model/sdk_config_capture.ts +78 -0
- package/src/data/model/sdk_config_source.ts +26 -0
- package/src/data/repository/__tests__/use_smile_id_repository.test.ts +118 -0
- package/src/data/repository/use_smile_id_repository.ts +19 -0
- package/src/data/repository/use_smile_id_repository_impl.ts +94 -0
- package/src/data/security/__tests__/smile_id_crypto_manager.test.ts +158 -0
- package/src/data/security/request_canonicalizer.ts +148 -0
- package/src/data/security/request_timestamp.ts +12 -0
- package/src/data/security/signing_crypto.ts +219 -0
- package/src/data/security/smile_id_crypto_error.ts +13 -0
- package/src/data/security/smile_id_crypto_manager.ts +46 -0
- package/src/data/smile_id_urls.ts +13 -0
- package/src/data/util/__tests__/retry_util.test.ts +157 -0
- package/src/data/util/__tests__/use_smile_id_token_decoder.test.ts +195 -0
- package/src/data/util/retry_util.ts +72 -0
- package/src/data/util/use_smile_id_token_decoder.ts +138 -0
- package/src/index.ts +512 -0
- package/src/l10n/__tests__/use_smile_id_localizations.test.ts +127 -0
- package/src/l10n/strings_en.ts +171 -0
- package/src/l10n/use_smile_id_localizations.ts +688 -0
- package/src/l10n/use_smile_id_localizations_provider.tsx +71 -0
- package/src/metadata/__tests__/use_smile_id_metadata.test.ts +436 -0
- package/src/metadata/document_image_origin.ts +22 -0
- package/src/metadata/optional_native_modules.ts +120 -0
- package/src/metadata/use_smile_id_metadata.ts +182 -0
- package/src/metadata/use_smile_id_metadata_factory.ts +385 -0
- package/src/presentation/assets/fonts/DMSans-Bold.ttf +0 -0
- package/src/presentation/assets/fonts/DMSans-ExtraBold.ttf +0 -0
- package/src/presentation/assets/fonts/DMSans-Medium.ttf +0 -0
- package/src/presentation/assets/fonts/DMSans-Regular.ttf +0 -0
- package/src/presentation/assets/fonts/DMSans-SemiBold.ttf +0 -0
- package/src/presentation/assets/fonts/OFL.txt +93 -0
- package/src/presentation/assets/si_dark_lighting_animation.json +927 -0
- package/src/presentation/assets/si_device_orientation_animation.json +850 -0
- package/src/presentation/assets/si_document_green_book_hero_animation.json +4668 -0
- package/src/presentation/assets/si_document_hero_animation.json +4799 -0
- package/src/presentation/assets/si_document_hero_back_animation.json +2039 -0
- package/src/presentation/assets/si_document_passport_hero_animation.json +14491 -0
- package/src/presentation/assets/si_ess_animation_all_directions.json +5575 -0
- package/src/presentation/assets/si_selfie_hero_animation.json +1439 -0
- package/src/presentation/assets/si_smile_to_capture_animation.json +1439 -0
- package/src/presentation/assets/svg/instruction_svg_strings.ts +32 -0
- package/src/presentation/assets/svg/si_attribution.svg +19 -0
- package/src/presentation/assets/svg/si_attribution_dark.svg +19 -0
- package/src/presentation/assets/svg/si_checkbox_check.svg +3 -0
- package/src/presentation/assets/svg/si_consent_biometric.svg +9 -0
- package/src/presentation/assets/svg/si_consent_biometric_dark.svg +9 -0
- package/src/presentation/assets/svg/si_consent_contact.svg +8 -0
- package/src/presentation/assets/svg/si_consent_contact_dark.svg +8 -0
- package/src/presentation/assets/svg/si_consent_device.svg +12 -0
- package/src/presentation/assets/svg/si_consent_device_dark.svg +12 -0
- package/src/presentation/assets/svg/si_consent_personal.svg +6 -0
- package/src/presentation/assets/svg/si_consent_personal_dark.svg +6 -0
- package/src/presentation/assets/svg/si_expand_more.svg +3 -0
- package/src/presentation/assets/svg/si_plus.svg +4 -0
- package/src/presentation/assets/svg/si_smile_consent_icon.svg +4 -0
- package/src/presentation/assets/svg/svg_strings.ts +158 -0
- package/src/presentation/components/__tests__/capture_instruction_animation_spec.test.ts +49 -0
- package/src/presentation/components/__tests__/enhanced_smart_selfie_animation_frames.test.ts +91 -0
- package/src/presentation/components/__tests__/use_smile_id_capture_content.test.tsx +348 -0
- package/src/presentation/components/__tests__/use_smile_id_confirmation_buttons.test.tsx +131 -0
- package/src/presentation/components/__tests__/use_smile_id_enhanced_smart_selfie_clip.test.tsx +252 -0
- package/src/presentation/components/__tests__/use_smile_id_enhanced_smart_selfie_direction_animation.test.tsx +138 -0
- package/src/presentation/components/__tests__/use_smile_id_face_overlay.test.tsx +211 -0
- package/src/presentation/components/__tests__/use_smile_id_guideline_thumbnail.test.tsx +79 -0
- package/src/presentation/components/__tests__/use_smile_id_instructions_hero.test.tsx +79 -0
- package/src/presentation/components/__tests__/use_smile_id_loading_indicator.test.tsx +45 -0
- package/src/presentation/components/__tests__/use_smile_id_oval_border_palette.test.ts +101 -0
- package/src/presentation/components/face_oval_defaults.ts +51 -0
- package/src/presentation/components/helpers/__tests__/scaled_oval_geometry.test.ts +69 -0
- package/src/presentation/components/helpers/animated_lottie_view.ts +9 -0
- package/src/presentation/components/helpers/capture_instruction_animation_spec.ts +77 -0
- package/src/presentation/components/helpers/enhanced_smart_selfie_animation_frames.ts +70 -0
- package/src/presentation/components/helpers/scaled_oval_geometry.ts +44 -0
- package/src/presentation/components/icons/index.tsx +287 -0
- package/src/presentation/components/status_indicator_state.ts +21 -0
- package/src/presentation/components/use_smile_id_attribution.tsx +48 -0
- package/src/presentation/components/use_smile_id_back_button.tsx +59 -0
- package/src/presentation/components/use_smile_id_button.tsx +93 -0
- package/src/presentation/components/use_smile_id_capture_content.tsx +344 -0
- package/src/presentation/components/use_smile_id_capture_instruction_animation.tsx +84 -0
- package/src/presentation/components/use_smile_id_capture_spinner.tsx +63 -0
- package/src/presentation/components/use_smile_id_captured_document_image.tsx +86 -0
- package/src/presentation/components/use_smile_id_captured_image_oval.tsx +151 -0
- package/src/presentation/components/use_smile_id_card_surface.tsx +54 -0
- package/src/presentation/components/use_smile_id_confirmation_buttons.tsx +123 -0
- package/src/presentation/components/use_smile_id_consent_row.tsx +58 -0
- package/src/presentation/components/use_smile_id_content_card.tsx +65 -0
- package/src/presentation/components/use_smile_id_document_capture_controls.tsx +155 -0
- package/src/presentation/components/use_smile_id_document_frame_glyph.tsx +162 -0
- package/src/presentation/components/use_smile_id_document_overlay.tsx +245 -0
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_clip.tsx +152 -0
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_direction_animation.tsx +46 -0
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_full_animation.tsx +29 -0
- package/src/presentation/components/use_smile_id_expandable_icon.tsx +102 -0
- package/src/presentation/components/use_smile_id_face_oval_image.tsx +90 -0
- package/src/presentation/components/use_smile_id_face_overlay.tsx +387 -0
- package/src/presentation/components/use_smile_id_face_silhouette_overlay.tsx +27 -0
- package/src/presentation/components/use_smile_id_failed_content.tsx +94 -0
- package/src/presentation/components/use_smile_id_guideline_thumbnail.tsx +134 -0
- package/src/presentation/components/use_smile_id_instructions_hero.tsx +245 -0
- package/src/presentation/components/use_smile_id_learn_more_content.tsx +115 -0
- package/src/presentation/components/use_smile_id_loading_content.tsx +54 -0
- package/src/presentation/components/use_smile_id_loading_indicator.tsx +81 -0
- package/src/presentation/components/use_smile_id_oval_border_palette.ts +60 -0
- package/src/presentation/components/use_smile_id_partner_icon.tsx +56 -0
- package/src/presentation/components/use_smile_id_processing_center_indicator.tsx +77 -0
- package/src/presentation/components/use_smile_id_rounded_checkbox.tsx +67 -0
- package/src/presentation/components/use_smile_id_status_indicator.tsx +44 -0
- package/src/presentation/components/use_smile_id_success_content.tsx +76 -0
- package/src/presentation/flow/__tests__/document_flow_navigation.test.ts +285 -0
- package/src/presentation/flow/__tests__/flow_navigation_manager.test.ts +1163 -0
- package/src/presentation/flow/analytics/__tests__/use_smile_id_analytics_event.test.ts +105 -0
- package/src/presentation/flow/analytics/use_smile_id_analytics_event.ts +83 -0
- package/src/presentation/flow/config/flow_configuration.ts +12 -0
- package/src/presentation/flow/dsl/builder/__tests__/ml_builder.test.ts +161 -0
- package/src/presentation/flow/dsl/builder/__tests__/theme_builder.test.ts +102 -0
- package/src/presentation/flow/dsl/builder/config_builder.ts +22 -0
- package/src/presentation/flow/dsl/builder/ml_builder.ts +201 -0
- package/src/presentation/flow/dsl/builder/screens_builder.ts +180 -0
- package/src/presentation/flow/dsl/builder/theme_builder.ts +102 -0
- package/src/presentation/flow/dsl/flow_build_result.ts +37 -0
- package/src/presentation/flow/dsl/use_smile_id_builder.tsx +123 -0
- package/src/presentation/flow/dsl/use_smile_id_flow_builder.ts +402 -0
- package/src/presentation/flow/flow_navigation_context.tsx +50 -0
- package/src/presentation/flow/flow_navigation_manager.ts +985 -0
- package/src/presentation/flow/graph/screen_renderer.tsx +35 -0
- package/src/presentation/flow/job_submission_state.ts +17 -0
- package/src/presentation/flow/model/instruction_guideline.ts +15 -0
- package/src/presentation/flow/model/instructions_defaults.ts +120 -0
- package/src/presentation/flow/screen/helpers/__tests__/face_session_config.test.ts +115 -0
- package/src/presentation/flow/screen/helpers/face_session_config.ts +77 -0
- package/src/presentation/flow/screen/orchestrated_capture_screen.tsx +296 -0
- package/src/presentation/flow/screen/orchestrated_consent_screen.tsx +66 -0
- package/src/presentation/flow/screen/orchestrated_instructions_screen.tsx +102 -0
- package/src/presentation/flow/screen/orchestrated_preview_screen.tsx +72 -0
- package/src/presentation/flow/screen/orchestrated_processing_screen.tsx +111 -0
- package/src/presentation/flow/screen/use_smile_id_orchestrated_screen_host.tsx +39 -0
- package/src/presentation/flow/screen/validation_error_screen.tsx +147 -0
- package/src/presentation/flow/use_smile_id_flow.tsx +338 -0
- package/src/presentation/flow/validation/__tests__/flow_validator.test.ts +398 -0
- package/src/presentation/flow/validation/__tests__/job_type_validator.test.ts +704 -0
- package/src/presentation/flow/validation/flow_validator.ts +433 -0
- package/src/presentation/flow/validation/job_type_validator.ts +645 -0
- package/src/presentation/flow/validation/validation_state.ts +65 -0
- package/src/presentation/screen/__tests__/capture_screen_helpers.test.ts +112 -0
- package/src/presentation/screen/__tests__/capture_ui_state.test.ts +379 -0
- package/src/presentation/screen/__tests__/consent_screen_helpers.test.ts +63 -0
- package/src/presentation/screen/__tests__/ess_turn_haptics.test.ts +78 -0
- package/src/presentation/screen/__tests__/feedback_debouncer.test.ts +111 -0
- package/src/presentation/screen/__tests__/instructions_screen_helpers.test.ts +142 -0
- package/src/presentation/screen/__tests__/preview_screen_helpers.test.ts +53 -0
- package/src/presentation/screen/__tests__/processing_screen_helpers.test.ts +39 -0
- package/src/presentation/screen/__tests__/scan_state_to_overlay_state.test.ts +203 -0
- package/src/presentation/screen/__tests__/use_smile_id_capture_screen.test.tsx +616 -0
- package/src/presentation/screen/__tests__/use_smile_id_consent_screen.test.tsx +288 -0
- package/src/presentation/screen/__tests__/use_smile_id_document_back_instructions.test.tsx +136 -0
- package/src/presentation/screen/__tests__/use_smile_id_instructions_screen.test.tsx +245 -0
- package/src/presentation/screen/__tests__/use_smile_id_preview_screen.test.tsx +223 -0
- package/src/presentation/screen/__tests__/use_smile_id_processing_screen.test.tsx +333 -0
- package/src/presentation/screen/helpers/capture_screen_helpers.ts +151 -0
- package/src/presentation/screen/helpers/capture_ui_state.ts +298 -0
- package/src/presentation/screen/helpers/consent_screen_helpers.ts +106 -0
- package/src/presentation/screen/helpers/ess_turn_haptics.ts +67 -0
- package/src/presentation/screen/helpers/feedback_debouncer.ts +89 -0
- package/src/presentation/screen/helpers/instructions_screen_helpers.ts +108 -0
- package/src/presentation/screen/helpers/preview_screen_helpers.ts +41 -0
- package/src/presentation/screen/helpers/processing_screen_helpers.ts +27 -0
- package/src/presentation/screen/helpers/scan_state_to_overlay_state.ts +128 -0
- package/src/presentation/screen/helpers/use_capture_orientation_lock.ts +46 -0
- package/src/presentation/screen/helpers/use_debounced_feedback_key.ts +52 -0
- package/src/presentation/screen/use_smile_id_capture_screen.tsx +635 -0
- package/src/presentation/screen/use_smile_id_consent_screen.tsx +382 -0
- package/src/presentation/screen/use_smile_id_document_back_instructions.tsx +134 -0
- package/src/presentation/screen/use_smile_id_document_preview_screen.tsx +142 -0
- package/src/presentation/screen/use_smile_id_instructions_screen.tsx +194 -0
- package/src/presentation/screen/use_smile_id_permission_screen.tsx +52 -0
- package/src/presentation/screen/use_smile_id_preview_screen.tsx +159 -0
- package/src/presentation/screen/use_smile_id_processing_screen.tsx +223 -0
- package/src/presentation/state/__tests__/use_smile_id_overlay_state.test.ts +30 -0
- package/src/presentation/state/processing_state.ts +19 -0
- package/src/presentation/state/use_smile_id_overlay_state.ts +70 -0
- package/src/presentation/theme/theme.ts +399 -0
- package/src/presentation/theme/theme_context.tsx +45 -0
- package/src/presentation/theme/use_smile_id_motion.ts +12 -0
- package/src/presentation/theme/use_use_smile_id_fonts.ts +71 -0
- package/src/presentation/utils/__tests__/force_max_brightness.test.tsx +237 -0
- package/src/presentation/utils/__tests__/locale_utils.test.ts +37 -0
- package/src/presentation/utils/force_max_brightness.tsx +113 -0
- package/src/presentation/utils/locale_utils.ts +71 -0
- package/src/presentation/utils/use_reduced_motion.ts +26 -0
|
@@ -0,0 +1,1197 @@
|
|
|
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 { UseSmileIDMetadata } from "../../../metadata/use_smile_id_metadata";
|
|
43
|
+
|
|
44
|
+
type RecordedCall = {
|
|
45
|
+
url: string;
|
|
46
|
+
body: FormData;
|
|
47
|
+
config?: { headers?: Record<string, string> } & Record<string, unknown>;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function makeApi(
|
|
51
|
+
partnerOverrides: {
|
|
52
|
+
callbackUrl?: string;
|
|
53
|
+
partnerParams?: Record<string, string>;
|
|
54
|
+
} = {},
|
|
55
|
+
): {
|
|
56
|
+
api: SmileIDAPI;
|
|
57
|
+
calls: RecordedCall[];
|
|
58
|
+
setNextResponse: (data: unknown) => void;
|
|
59
|
+
} {
|
|
60
|
+
const calls: RecordedCall[] = [];
|
|
61
|
+
let nextResponse: unknown = {
|
|
62
|
+
job_id: "job-1",
|
|
63
|
+
user_id: "user-1",
|
|
64
|
+
status: "accepted",
|
|
65
|
+
message: "ok",
|
|
66
|
+
};
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
+
const fakeClient: any = {
|
|
69
|
+
post: vi.fn(
|
|
70
|
+
async (
|
|
71
|
+
url: string,
|
|
72
|
+
body: FormData,
|
|
73
|
+
config?: { headers?: Record<string, string> } & Record<string, unknown>,
|
|
74
|
+
) => {
|
|
75
|
+
const call: RecordedCall = { url, body };
|
|
76
|
+
if (config !== undefined) {
|
|
77
|
+
call.config = config;
|
|
78
|
+
}
|
|
79
|
+
calls.push(call);
|
|
80
|
+
return { data: nextResponse };
|
|
81
|
+
},
|
|
82
|
+
),
|
|
83
|
+
};
|
|
84
|
+
const api = new SmileIDAPI(fakeClient, {
|
|
85
|
+
partnerId: "p",
|
|
86
|
+
callbackUrl: partnerOverrides.callbackUrl ?? "",
|
|
87
|
+
useSandbox: true,
|
|
88
|
+
...(partnerOverrides.partnerParams !== undefined
|
|
89
|
+
? { partnerParams: partnerOverrides.partnerParams }
|
|
90
|
+
: {}),
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
api,
|
|
94
|
+
calls,
|
|
95
|
+
setNextResponse: (d) => {
|
|
96
|
+
nextResponse = d;
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const consent: ConsentInformation = Object.freeze({
|
|
102
|
+
granted: true,
|
|
103
|
+
grantedAt: "2026-04-30T00:00:00.000Z",
|
|
104
|
+
noticeLanguage: "EN",
|
|
105
|
+
noticePrivacyPolicyUrl: "https://example.test/p",
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Per-submission metadata snapshot. The request-construction site
|
|
109
|
+
// builds this and it travels on every `JobRequest`; the API
|
|
110
|
+
// serializes `request.metadata` as the `metadata` multipart part.
|
|
111
|
+
const metadata = new UseSmileIDMetadata({
|
|
112
|
+
sdkVersion: "12.0.0",
|
|
113
|
+
sdk: "react-native-expo",
|
|
114
|
+
deviceOs: "",
|
|
115
|
+
deviceModel: "",
|
|
116
|
+
appName: "",
|
|
117
|
+
sessionId: "test-session-id",
|
|
118
|
+
clientIp: "",
|
|
119
|
+
networkConnection: "",
|
|
120
|
+
carrierInfo: "",
|
|
121
|
+
proxy: false,
|
|
122
|
+
timezone: "",
|
|
123
|
+
locale: "",
|
|
124
|
+
screenResolution: "",
|
|
125
|
+
memoryInfoMb: 0,
|
|
126
|
+
deviceOrientation: "",
|
|
127
|
+
systemArchitecture: "",
|
|
128
|
+
numberOfCameras: 0,
|
|
129
|
+
hostApplication: "",
|
|
130
|
+
proximitySensor: false,
|
|
131
|
+
securityPolicyVersion: "12.0.0",
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Read every multipart part out of a `FormData` instance. The native
|
|
136
|
+
* spec exposes `entries()`; the RN runtime FormData polyfill in
|
|
137
|
+
* tests does too. Returns an array of `[name, value]` tuples
|
|
138
|
+
* preserving insertion order so tests can assert ordering when
|
|
139
|
+
* needed.
|
|
140
|
+
*/
|
|
141
|
+
function dumpFormData(form: FormData): Array<[string, unknown]> {
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
143
|
+
const entries: Array<[string, unknown]> = [];
|
|
144
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
145
|
+
for (const [k, v] of (form as any).entries()) {
|
|
146
|
+
entries.push([k, v]);
|
|
147
|
+
}
|
|
148
|
+
return entries;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function partsByName(form: FormData): Record<string, unknown[]> {
|
|
152
|
+
const out: Record<string, unknown[]> = {};
|
|
153
|
+
for (const [name, value] of dumpFormData(form)) {
|
|
154
|
+
(out[name] ??= []).push(value);
|
|
155
|
+
}
|
|
156
|
+
return out;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Read a JSON-content multipart part as a string. The SDK appends
|
|
161
|
+
* JSON parts as plain text form fields carrying the JSON-serialized
|
|
162
|
+
* value as the part body (no per-part `Content-Type` header — the
|
|
163
|
+
* live server's multipart parser rejects parts tagged
|
|
164
|
+
* `application/json` as "missing or invalid"). Node's native
|
|
165
|
+
* `FormData` stores text form-field values as plain strings; this
|
|
166
|
+
* helper coerces defensively in case a future runtime wraps them.
|
|
167
|
+
*/
|
|
168
|
+
/**
|
|
169
|
+
* A value carrying an async `text()` reader. The runtime `Blob` (Node /
|
|
170
|
+
* vitest) exposes `text(): Promise<string>`, but the ambient `Blob` type
|
|
171
|
+
* pulled in via `react-native` types does not declare it, so the helper
|
|
172
|
+
* narrows structurally on the method it actually calls.
|
|
173
|
+
*/
|
|
174
|
+
type TextReadable = { text(): Promise<string> };
|
|
175
|
+
|
|
176
|
+
function hasTextReader(value: unknown): value is TextReadable {
|
|
177
|
+
return (
|
|
178
|
+
typeof Blob !== "undefined" &&
|
|
179
|
+
value instanceof Blob &&
|
|
180
|
+
typeof (value as { text?: unknown }).text === "function"
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
async function readJsonPart(part: unknown): Promise<string> {
|
|
185
|
+
if (hasTextReader(part)) {
|
|
186
|
+
return await part.text();
|
|
187
|
+
}
|
|
188
|
+
return String(part);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Assert that a JSON multipart part is NOT tagged with a per-part
|
|
193
|
+
* `Content-Type: application/json` header. Concrete scenario: the
|
|
194
|
+
* live server's multipart parser expects `user_details`, `consent`,
|
|
195
|
+
* `metadata`, and `partner_params` as plain text form fields and
|
|
196
|
+
* rejects parts tagged `application/json` as "missing or invalid".
|
|
197
|
+
* This assertion pins the wire shape so a regression that wraps the
|
|
198
|
+
* value in a `Blob({ type: "application/json" })` would fail here.
|
|
199
|
+
*/
|
|
200
|
+
function expectNoJsonContentType(part: unknown): void {
|
|
201
|
+
// A plain-string form-field value has no `.type` to inspect. If the
|
|
202
|
+
// runtime did wrap the value in a `Blob`, its `type` MUST NOT be
|
|
203
|
+
// `application/json` (or any other MIME type that would tag the
|
|
204
|
+
// multipart part on the wire).
|
|
205
|
+
if (typeof Blob !== "undefined" && part instanceof Blob) {
|
|
206
|
+
expect((part as Blob).type).not.toBe("application/json");
|
|
207
|
+
} else {
|
|
208
|
+
expect(typeof part).toBe("string");
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
describe("SmileIDAPI.biometricKyc", () => {
|
|
213
|
+
function makeRequest(
|
|
214
|
+
overrides: Partial<BiometricKycRequest["params"]> & {
|
|
215
|
+
userDetails?: UserDetails;
|
|
216
|
+
} = {},
|
|
217
|
+
): BiometricKycRequest {
|
|
218
|
+
const { userDetails: userDetailsOverride, ...paramOverrides } = overrides;
|
|
219
|
+
return {
|
|
220
|
+
jobType: JobType.biometricKyc,
|
|
221
|
+
selfieImage: "file:///selfie.jpg",
|
|
222
|
+
livenessImages: [
|
|
223
|
+
"file:///l1.jpg",
|
|
224
|
+
"file:///l2.jpg",
|
|
225
|
+
"file:///l3.jpg",
|
|
226
|
+
"file:///l4.jpg",
|
|
227
|
+
"file:///l5.jpg",
|
|
228
|
+
"file:///l6.jpg",
|
|
229
|
+
"file:///l7.jpg",
|
|
230
|
+
],
|
|
231
|
+
consent,
|
|
232
|
+
metadata,
|
|
233
|
+
expectedLivenessImageCount: 7,
|
|
234
|
+
userDetails: userDetailsOverride ?? {
|
|
235
|
+
givenNames: "John",
|
|
236
|
+
lastName: "Doe",
|
|
237
|
+
email: "john@example.test",
|
|
238
|
+
phoneNumber: "+254700000000",
|
|
239
|
+
},
|
|
240
|
+
params: {
|
|
241
|
+
idType: "NATIONAL_ID",
|
|
242
|
+
idNumber: "32232403",
|
|
243
|
+
country: "KE",
|
|
244
|
+
// `useEnrolledImage` is non-nullable on the public type;
|
|
245
|
+
// tests default to `false` and individual cases opt into
|
|
246
|
+
// `true` via `overrides`.
|
|
247
|
+
useEnrolledImage: false,
|
|
248
|
+
...paramOverrides,
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
it("sends a `user_details` JSON multipart part with snake_case keys", async () => {
|
|
254
|
+
const { api, calls } = makeApi();
|
|
255
|
+
await api.biometricKyc(makeRequest());
|
|
256
|
+
expect(calls).toHaveLength(1);
|
|
257
|
+
const parts = partsByName(calls[0]!.body);
|
|
258
|
+
expect(parts["user_details"]).toBeDefined();
|
|
259
|
+
const userDetailsRaw = await readJsonPart(parts["user_details"]![0]);
|
|
260
|
+
const parsed = JSON.parse(userDetailsRaw);
|
|
261
|
+
expect(parsed).toEqual({
|
|
262
|
+
given_names: "John",
|
|
263
|
+
last_name: "Doe",
|
|
264
|
+
email: "john@example.test",
|
|
265
|
+
phone_number: "+254700000000",
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it("sends the `user_details` part as a plain text form field (no application/json tag)", async () => {
|
|
270
|
+
// Concrete scenario: the live server's multipart parser rejects
|
|
271
|
+
// parts tagged `Content-Type: application/json` with "missing or
|
|
272
|
+
// invalid" — it expects `user_details`, `consent`, `metadata`,
|
|
273
|
+
// and `partner_params` as plain text form fields (Postman
|
|
274
|
+
// `"type": "text"`) carrying a JSON-serialized string value.
|
|
275
|
+
// This test pins the wire shape so a future refactor that wraps
|
|
276
|
+
// the value in a `Blob({ type: "application/json" })` would
|
|
277
|
+
// surface as a regression here.
|
|
278
|
+
const { api, calls } = makeApi();
|
|
279
|
+
await api.biometricKyc(makeRequest());
|
|
280
|
+
const parts = partsByName(calls[0]!.body);
|
|
281
|
+
expectNoJsonContentType(parts["user_details"]![0]);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it("sends the `consent` part as a plain text form field (no application/json tag)", async () => {
|
|
285
|
+
const { api, calls } = makeApi();
|
|
286
|
+
await api.biometricKyc(makeRequest());
|
|
287
|
+
const parts = partsByName(calls[0]!.body);
|
|
288
|
+
expectNoJsonContentType(parts["consent"]![0]);
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it("serializes the `metadata` part from `request.metadata` (built at the request-construction site)", async () => {
|
|
292
|
+
// Concrete scenario: the metadata snapshot is built by the flow
|
|
293
|
+
// navigation manager and travels on the request. The API no longer
|
|
294
|
+
// holds a metadata provider — it serializes `request.metadata`
|
|
295
|
+
// directly. This pins that the `session_id` entry (and the array
|
|
296
|
+
// wire shape) come from the request's own snapshot.
|
|
297
|
+
const { api, calls } = makeApi();
|
|
298
|
+
await api.biometricKyc(makeRequest());
|
|
299
|
+
const parts = partsByName(calls[0]!.body);
|
|
300
|
+
expect(parts["metadata"]).toBeDefined();
|
|
301
|
+
expectNoJsonContentType(parts["metadata"]![0]);
|
|
302
|
+
const parsed = JSON.parse(await readJsonPart(parts["metadata"]![0]));
|
|
303
|
+
expect(parsed).toEqual(metadata.toEntries());
|
|
304
|
+
const sessionEntry = (
|
|
305
|
+
parsed as Array<{ name: string; value: string }>
|
|
306
|
+
).find((entry) => entry.name === "session_id");
|
|
307
|
+
expect(sessionEntry?.value).toBe("test-session-id");
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it("sends the `partner_params` part as a plain text form field (no application/json tag)", async () => {
|
|
311
|
+
const { api, calls } = makeApi({ partnerParams: { jobRef: "ref-1" } });
|
|
312
|
+
await api.biometricKyc(makeRequest());
|
|
313
|
+
const parts = partsByName(calls[0]!.body);
|
|
314
|
+
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it("does NOT send the legacy flat PII parts (server strips them anyway)", async () => {
|
|
318
|
+
const { api, calls } = makeApi();
|
|
319
|
+
await api.biometricKyc(makeRequest());
|
|
320
|
+
const parts = partsByName(calls[0]!.body);
|
|
321
|
+
expect(parts["given_names"]).toBeUndefined();
|
|
322
|
+
expect(parts["last_name"]).toBeUndefined();
|
|
323
|
+
expect(parts["email"]).toBeUndefined();
|
|
324
|
+
expect(parts["phone_number"]).toBeUndefined();
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
it("omits `email` and `phone_number` from user_details when empty", async () => {
|
|
328
|
+
const { api, calls } = makeApi();
|
|
329
|
+
await api.biometricKyc(
|
|
330
|
+
makeRequest({
|
|
331
|
+
userDetails: {
|
|
332
|
+
givenNames: "John",
|
|
333
|
+
lastName: "Doe",
|
|
334
|
+
phoneNumber: "+254700000000",
|
|
335
|
+
},
|
|
336
|
+
}),
|
|
337
|
+
);
|
|
338
|
+
const parts = partsByName(calls[0]!.body);
|
|
339
|
+
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
340
|
+
expect(parsed).toEqual({
|
|
341
|
+
given_names: "John",
|
|
342
|
+
last_name: "Doe",
|
|
343
|
+
phone_number: "+254700000000",
|
|
344
|
+
});
|
|
345
|
+
expect(parsed.email).toBeUndefined();
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
it("trims whitespace and omits whitespace only optional user_details fields", async () => {
|
|
349
|
+
const { api, calls } = makeApi();
|
|
350
|
+
await api.biometricKyc(
|
|
351
|
+
makeRequest({
|
|
352
|
+
userDetails: {
|
|
353
|
+
givenNames: "John",
|
|
354
|
+
lastName: "Doe",
|
|
355
|
+
email: " john@example.test ",
|
|
356
|
+
phoneNumber: " ",
|
|
357
|
+
},
|
|
358
|
+
}),
|
|
359
|
+
);
|
|
360
|
+
const parts = partsByName(calls[0]!.body);
|
|
361
|
+
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
362
|
+
expect(parsed.email).toBe("john@example.test");
|
|
363
|
+
expect(parsed.phone_number).toBeUndefined();
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
it("appends `use_enrolled_image=true` and still sends selfie + liveness when set", async () => {
|
|
367
|
+
const { api, calls } = makeApi();
|
|
368
|
+
await api.biometricKyc(makeRequest({ useEnrolledImage: true }));
|
|
369
|
+
const parts = partsByName(calls[0]!.body);
|
|
370
|
+
expect(parts["use_enrolled_image"]).toEqual(["true"]);
|
|
371
|
+
expect(parts["selfie_image"]).toHaveLength(1);
|
|
372
|
+
expect(parts["liveness_images"]).toHaveLength(7);
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
it("omits `use_enrolled_image` part by default and sends selfie + liveness", async () => {
|
|
376
|
+
const { api, calls } = makeApi();
|
|
377
|
+
await api.biometricKyc(makeRequest());
|
|
378
|
+
const parts = partsByName(calls[0]!.body);
|
|
379
|
+
expect(parts["use_enrolled_image"]).toBeUndefined();
|
|
380
|
+
expect(parts["selfie_image"]).toHaveLength(1);
|
|
381
|
+
expect(parts["liveness_images"]).toHaveLength(7);
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
it("never serializes user_id as a multipart part", async () => {
|
|
385
|
+
const { api, calls } = makeApi();
|
|
386
|
+
await api.biometricKyc(makeRequest());
|
|
387
|
+
const parts = partsByName(calls[0]!.body);
|
|
388
|
+
expect(parts["user_id"]).toBeUndefined();
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
it("emits `callback_url` part from PartnerConfig.callbackUrl when set", async () => {
|
|
392
|
+
// Concrete scenario: partner configures `p.callbackUrl =
|
|
393
|
+
// 'https://partner.test/cb'` at the SDK level. `PartnerConfig` is
|
|
394
|
+
// the sole source for `callback_url` on Biometric KYC submissions
|
|
395
|
+
// — symmetric with Enhanced KYC and the canonical SDKs.
|
|
396
|
+
const { api, calls } = makeApi({
|
|
397
|
+
callbackUrl: "https://partner.test/cb",
|
|
398
|
+
});
|
|
399
|
+
await api.biometricKyc(makeRequest());
|
|
400
|
+
const parts = partsByName(calls[0]!.body);
|
|
401
|
+
expect(parts["callback_url"]).toEqual(["https://partner.test/cb"]);
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
it("omits `callback_url` part when PartnerConfig.callbackUrl is empty", async () => {
|
|
405
|
+
const { api, calls } = makeApi();
|
|
406
|
+
await api.biometricKyc(makeRequest());
|
|
407
|
+
const parts = partsByName(calls[0]!.body);
|
|
408
|
+
expect(parts["callback_url"]).toBeUndefined();
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
it("emits `partner_params` JSON part from PartnerConfig.partnerParams when set", async () => {
|
|
412
|
+
const { api, calls } = makeApi({
|
|
413
|
+
partnerParams: { jobRef: "ref-1", sessionId: "s-1" },
|
|
414
|
+
});
|
|
415
|
+
await api.biometricKyc(makeRequest());
|
|
416
|
+
const parts = partsByName(calls[0]!.body);
|
|
417
|
+
expect(parts["partner_params"]).toBeDefined();
|
|
418
|
+
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
419
|
+
const parsed = JSON.parse(await readJsonPart(parts["partner_params"]![0]));
|
|
420
|
+
expect(parsed).toEqual({ jobRef: "ref-1", sessionId: "s-1" });
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
it("omits `partner_params` part when PartnerConfig.partnerParams is unset", async () => {
|
|
424
|
+
const { api, calls } = makeApi();
|
|
425
|
+
await api.biometricKyc(makeRequest());
|
|
426
|
+
const parts = partsByName(calls[0]!.body);
|
|
427
|
+
expect(parts["partner_params"]).toBeUndefined();
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
it("posts to `/v3/biometric_kyc`", async () => {
|
|
431
|
+
const { api, calls } = makeApi();
|
|
432
|
+
await api.biometricKyc(makeRequest());
|
|
433
|
+
expect(calls[0]!.url).toBe("/v3/biometric_kyc");
|
|
434
|
+
});
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
describe("SmileIDAPI.enhancedKyc", () => {
|
|
438
|
+
function makeRequest(
|
|
439
|
+
overrides: Partial<EnhancedKycRequest["params"]> & {
|
|
440
|
+
userDetails?: UserDetails;
|
|
441
|
+
} = {},
|
|
442
|
+
): EnhancedKycRequest {
|
|
443
|
+
const { userDetails: userDetailsOverride, ...paramOverrides } = overrides;
|
|
444
|
+
return {
|
|
445
|
+
jobType: JobType.enhancedKyc,
|
|
446
|
+
consent,
|
|
447
|
+
metadata,
|
|
448
|
+
userDetails: userDetailsOverride ?? {
|
|
449
|
+
givenNames: "John",
|
|
450
|
+
lastName: "Doe",
|
|
451
|
+
email: "john@example.test",
|
|
452
|
+
phoneNumber: "+254700000000",
|
|
453
|
+
},
|
|
454
|
+
params: {
|
|
455
|
+
idType: "NATIONAL_ID",
|
|
456
|
+
idNumber: "32232403",
|
|
457
|
+
country: "KE",
|
|
458
|
+
...paramOverrides,
|
|
459
|
+
},
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
it("sends user_details and the three id fields, no flat PII", async () => {
|
|
464
|
+
const { api, calls } = makeApi();
|
|
465
|
+
await api.enhancedKyc(makeRequest());
|
|
466
|
+
const parts = partsByName(calls[0]!.body);
|
|
467
|
+
expect(parts["id_type"]).toEqual(["NATIONAL_ID"]);
|
|
468
|
+
expect(parts["id_number"]).toEqual(["32232403"]);
|
|
469
|
+
expect(parts["country"]).toEqual(["KE"]);
|
|
470
|
+
expect(parts["user_details"]).toBeDefined();
|
|
471
|
+
expect(parts["given_names"]).toBeUndefined();
|
|
472
|
+
expect(parts["last_name"]).toBeUndefined();
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
it("sends `bank_code` part when set", async () => {
|
|
476
|
+
const { api, calls } = makeApi();
|
|
477
|
+
await api.enhancedKyc(makeRequest({ bankCode: "044" }));
|
|
478
|
+
const parts = partsByName(calls[0]!.body);
|
|
479
|
+
expect(parts["bank_code"]).toEqual(["044"]);
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
it("sends `operator` part when mobileOperator is set (TS name maps to wire key)", async () => {
|
|
483
|
+
const { api, calls } = makeApi();
|
|
484
|
+
await api.enhancedKyc(makeRequest({ mobileOperator: "MTN" }));
|
|
485
|
+
const parts = partsByName(calls[0]!.body);
|
|
486
|
+
// TS public field is `mobileOperator`; wire key stays `operator`.
|
|
487
|
+
expect(parts["operator"]).toEqual(["MTN"]);
|
|
488
|
+
expect(parts["mobile_operator"]).toBeUndefined();
|
|
489
|
+
expect(parts["mobileOperator"]).toBeUndefined();
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
it("omits `bank_code` and `operator` parts when unset", async () => {
|
|
493
|
+
const { api, calls } = makeApi();
|
|
494
|
+
await api.enhancedKyc(makeRequest());
|
|
495
|
+
const parts = partsByName(calls[0]!.body);
|
|
496
|
+
expect(parts["bank_code"]).toBeUndefined();
|
|
497
|
+
expect(parts["operator"]).toBeUndefined();
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
it("sends the `user_details` part as a plain text form field (no application/json tag)", async () => {
|
|
501
|
+
const { api, calls } = makeApi();
|
|
502
|
+
await api.enhancedKyc(makeRequest());
|
|
503
|
+
const parts = partsByName(calls[0]!.body);
|
|
504
|
+
expectNoJsonContentType(parts["user_details"]![0]);
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
it("posts to `/v3/enhanced_kyc`", async () => {
|
|
508
|
+
const { api, calls } = makeApi();
|
|
509
|
+
await api.enhancedKyc(makeRequest());
|
|
510
|
+
expect(calls[0]!.url).toBe("/v3/enhanced_kyc");
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
it("emits `callback_url` part from PartnerConfig.callbackUrl when set", async () => {
|
|
514
|
+
// Concrete scenario: partner configures `p.callbackUrl =
|
|
515
|
+
// 'https://partner.test/cb'` at the SDK level (not per-job). The
|
|
516
|
+
// server expects the callback URL as the `callback_url` multipart
|
|
517
|
+
// part, in addition to the `callback-url` HTTP header that the
|
|
518
|
+
// auth interceptor adds on every request.
|
|
519
|
+
const { api, calls } = makeApi({
|
|
520
|
+
callbackUrl: "https://partner.test/cb",
|
|
521
|
+
});
|
|
522
|
+
await api.enhancedKyc(makeRequest());
|
|
523
|
+
const parts = partsByName(calls[0]!.body);
|
|
524
|
+
expect(parts["callback_url"]).toEqual(["https://partner.test/cb"]);
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
it("omits `callback_url` part when PartnerConfig.callbackUrl is empty", async () => {
|
|
528
|
+
const { api, calls } = makeApi();
|
|
529
|
+
await api.enhancedKyc(makeRequest());
|
|
530
|
+
const parts = partsByName(calls[0]!.body);
|
|
531
|
+
expect(parts["callback_url"]).toBeUndefined();
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
it("emits `partner_params` JSON part from PartnerConfig.partnerParams when set", async () => {
|
|
535
|
+
const { api, calls } = makeApi({
|
|
536
|
+
partnerParams: { jobRef: "ref-1", sessionId: "s-1" },
|
|
537
|
+
});
|
|
538
|
+
await api.enhancedKyc(makeRequest());
|
|
539
|
+
const parts = partsByName(calls[0]!.body);
|
|
540
|
+
expect(parts["partner_params"]).toBeDefined();
|
|
541
|
+
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
542
|
+
const parsed = JSON.parse(await readJsonPart(parts["partner_params"]![0]));
|
|
543
|
+
expect(parsed).toEqual({ jobRef: "ref-1", sessionId: "s-1" });
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
it("omits `partner_params` part when PartnerConfig.partnerParams is unset", async () => {
|
|
547
|
+
const { api, calls } = makeApi();
|
|
548
|
+
await api.enhancedKyc(makeRequest());
|
|
549
|
+
const parts = partsByName(calls[0]!.body);
|
|
550
|
+
expect(parts["partner_params"]).toBeUndefined();
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
describe("SmileIDAPI.documentVerification / enhancedDocumentVerification", () => {
|
|
555
|
+
const livenessImages: readonly string[] = [
|
|
556
|
+
"file:///l1.jpg",
|
|
557
|
+
"file:///l2.jpg",
|
|
558
|
+
"file:///l3.jpg",
|
|
559
|
+
"file:///l4.jpg",
|
|
560
|
+
"file:///l5.jpg",
|
|
561
|
+
"file:///l6.jpg",
|
|
562
|
+
"file:///l7.jpg",
|
|
563
|
+
];
|
|
564
|
+
|
|
565
|
+
const baseUserDetails: UserDetails = {
|
|
566
|
+
givenNames: "John",
|
|
567
|
+
lastName: "Doe",
|
|
568
|
+
email: "john@example.test",
|
|
569
|
+
phoneNumber: "+254700000000",
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
function documentRequest(
|
|
573
|
+
overrides: Partial<DocumentVerificationRequest> = {},
|
|
574
|
+
): DocumentVerificationRequest {
|
|
575
|
+
return {
|
|
576
|
+
jobType: JobType.documentVerification,
|
|
577
|
+
selfieImage: "file:///selfie.jpg",
|
|
578
|
+
livenessImages,
|
|
579
|
+
frontDocument: "file:///front.jpg",
|
|
580
|
+
country: "KE",
|
|
581
|
+
userDetails: baseUserDetails,
|
|
582
|
+
consent,
|
|
583
|
+
metadata,
|
|
584
|
+
expectedLivenessImageCount: 7,
|
|
585
|
+
...overrides,
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
function enhancedRequest(
|
|
590
|
+
overrides: Partial<EnhancedDocumentVerificationRequest> = {},
|
|
591
|
+
): EnhancedDocumentVerificationRequest {
|
|
592
|
+
return {
|
|
593
|
+
jobType: JobType.enhancedDocumentVerification,
|
|
594
|
+
selfieImage: "file:///selfie.jpg",
|
|
595
|
+
livenessImages,
|
|
596
|
+
frontDocument: "file:///front.jpg",
|
|
597
|
+
country: "KE",
|
|
598
|
+
idType: "NATIONAL_ID",
|
|
599
|
+
userDetails: baseUserDetails,
|
|
600
|
+
consent,
|
|
601
|
+
metadata,
|
|
602
|
+
expectedLivenessImageCount: 7,
|
|
603
|
+
...overrides,
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
it("names the front document part `document` — NOT `front_document`", async () => {
|
|
608
|
+
const { api, calls } = makeApi();
|
|
609
|
+
await api.documentVerification(documentRequest());
|
|
610
|
+
const parts = partsByName(calls[0]!.body);
|
|
611
|
+
expect(parts["document"]).toHaveLength(1);
|
|
612
|
+
expect(parts["front_document"]).toBeUndefined();
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
it("names the back document part `document_back` — NOT `back_document` — when present", async () => {
|
|
616
|
+
const { api, calls } = makeApi();
|
|
617
|
+
await api.documentVerification(
|
|
618
|
+
documentRequest({ backDocument: "file:///back.jpg" }),
|
|
619
|
+
);
|
|
620
|
+
const parts = partsByName(calls[0]!.body);
|
|
621
|
+
expect(parts["document_back"]).toHaveLength(1);
|
|
622
|
+
expect(parts["back_document"]).toBeUndefined();
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
it("omits the `document_back` part when no back image was captured", async () => {
|
|
626
|
+
const { api, calls } = makeApi();
|
|
627
|
+
await api.documentVerification(documentRequest());
|
|
628
|
+
const parts = partsByName(calls[0]!.body);
|
|
629
|
+
expect(parts["document_back"]).toBeUndefined();
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
it("sends selfie + liveness + country + user_details parts", async () => {
|
|
633
|
+
const { api, calls } = makeApi();
|
|
634
|
+
await api.documentVerification(documentRequest());
|
|
635
|
+
const parts = partsByName(calls[0]!.body);
|
|
636
|
+
expect(parts["selfie_image"]).toHaveLength(1);
|
|
637
|
+
expect(parts["liveness_images"]).toHaveLength(7);
|
|
638
|
+
expect(parts["country"]).toEqual(["KE"]);
|
|
639
|
+
expect(parts["user_details"]).toBeDefined();
|
|
640
|
+
expectNoJsonContentType(parts["user_details"]![0]);
|
|
641
|
+
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
642
|
+
expect(parsed).toEqual({
|
|
643
|
+
given_names: "John",
|
|
644
|
+
last_name: "Doe",
|
|
645
|
+
email: "john@example.test",
|
|
646
|
+
phone_number: "+254700000000",
|
|
647
|
+
});
|
|
648
|
+
});
|
|
649
|
+
|
|
650
|
+
it("omits `id_type` on document_verification when the request leaves it unset", async () => {
|
|
651
|
+
const { api, calls } = makeApi();
|
|
652
|
+
await api.documentVerification(documentRequest());
|
|
653
|
+
const parts = partsByName(calls[0]!.body);
|
|
654
|
+
expect(parts["id_type"]).toBeUndefined();
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
it("sends `id_type` on document_verification when supplied", async () => {
|
|
658
|
+
const { api, calls } = makeApi();
|
|
659
|
+
await api.documentVerification(documentRequest({ idType: "PASSPORT" }));
|
|
660
|
+
const parts = partsByName(calls[0]!.body);
|
|
661
|
+
expect(parts["id_type"]).toEqual(["PASSPORT"]);
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
it("always sends `id_type` (required) on enhanced_document_verification", async () => {
|
|
665
|
+
const { api, calls } = makeApi();
|
|
666
|
+
await api.enhancedDocumentVerification(enhancedRequest());
|
|
667
|
+
const parts = partsByName(calls[0]!.body);
|
|
668
|
+
expect(parts["id_type"]).toEqual(["NATIONAL_ID"]);
|
|
669
|
+
expect(parts["country"]).toEqual(["KE"]);
|
|
670
|
+
expect(parts["document"]).toHaveLength(1);
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
it("forwards PartnerConfig.callbackUrl and partnerParams as multipart parts", async () => {
|
|
674
|
+
const { api, calls } = makeApi({
|
|
675
|
+
callbackUrl: "https://partner.test/cb",
|
|
676
|
+
partnerParams: { jobRef: "ref-1" },
|
|
677
|
+
});
|
|
678
|
+
await api.documentVerification(documentRequest());
|
|
679
|
+
const parts = partsByName(calls[0]!.body);
|
|
680
|
+
expect(parts["callback_url"]).toEqual(["https://partner.test/cb"]);
|
|
681
|
+
expect(parts["partner_params"]).toBeDefined();
|
|
682
|
+
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
it("posts to the canonical document endpoints", async () => {
|
|
686
|
+
const { api, calls } = makeApi();
|
|
687
|
+
await api.documentVerification(documentRequest());
|
|
688
|
+
await api.enhancedDocumentVerification(enhancedRequest());
|
|
689
|
+
expect(calls[0]!.url).toBe("/v3/document_verification");
|
|
690
|
+
expect(calls[1]!.url).toBe("/v3/enhanced_document_verification");
|
|
691
|
+
});
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
describe("SmileIDAPI response mapping (job_id, user_id, created_at)", () => {
|
|
695
|
+
it("parses snake_case wire keys into camelCase fields including createdAt", async () => {
|
|
696
|
+
const { api, calls, setNextResponse } = makeApi();
|
|
697
|
+
setNextResponse({
|
|
698
|
+
job_id: "job-XYZ",
|
|
699
|
+
user_id: "user-XYZ",
|
|
700
|
+
status: "accepted",
|
|
701
|
+
message: "Request accepted and queued for processing.",
|
|
702
|
+
created_at: "2026-05-05T15:00:00.000Z",
|
|
703
|
+
});
|
|
704
|
+
const response = await api.enhancedKyc({
|
|
705
|
+
jobType: JobType.enhancedKyc,
|
|
706
|
+
consent,
|
|
707
|
+
metadata,
|
|
708
|
+
userDetails: {
|
|
709
|
+
givenNames: "John",
|
|
710
|
+
lastName: "Doe",
|
|
711
|
+
email: "john@example.test",
|
|
712
|
+
},
|
|
713
|
+
params: {
|
|
714
|
+
idType: "NATIONAL_ID",
|
|
715
|
+
idNumber: "1",
|
|
716
|
+
country: "KE",
|
|
717
|
+
},
|
|
718
|
+
});
|
|
719
|
+
expect(calls).toHaveLength(1);
|
|
720
|
+
expect(response.jobId).toBe("job-XYZ");
|
|
721
|
+
expect(response.userId).toBe("user-XYZ");
|
|
722
|
+
expect(response.status).toBe("accepted");
|
|
723
|
+
expect(response.createdAt).toBe("2026-05-05T15:00:00.000Z");
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
it("leaves createdAt undefined when the server omits it", async () => {
|
|
727
|
+
const { api, setNextResponse } = makeApi();
|
|
728
|
+
setNextResponse({
|
|
729
|
+
job_id: "job-1",
|
|
730
|
+
user_id: "user-1",
|
|
731
|
+
status: "accepted",
|
|
732
|
+
message: "ok",
|
|
733
|
+
});
|
|
734
|
+
const response = await api.enhancedKyc({
|
|
735
|
+
jobType: JobType.enhancedKyc,
|
|
736
|
+
consent,
|
|
737
|
+
metadata,
|
|
738
|
+
userDetails: {
|
|
739
|
+
givenNames: "John",
|
|
740
|
+
lastName: "Doe",
|
|
741
|
+
email: "john@example.test",
|
|
742
|
+
},
|
|
743
|
+
params: {
|
|
744
|
+
idType: "NATIONAL_ID",
|
|
745
|
+
idNumber: "1",
|
|
746
|
+
country: "KE",
|
|
747
|
+
},
|
|
748
|
+
});
|
|
749
|
+
expect(response.createdAt).toBeUndefined();
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
it("throws when the server returns a null body", async () => {
|
|
753
|
+
const { api, setNextResponse } = makeApi();
|
|
754
|
+
setNextResponse(null);
|
|
755
|
+
await expect(
|
|
756
|
+
api.enhancedKyc({
|
|
757
|
+
jobType: JobType.enhancedKyc,
|
|
758
|
+
consent,
|
|
759
|
+
metadata,
|
|
760
|
+
userDetails: {
|
|
761
|
+
givenNames: "John",
|
|
762
|
+
lastName: "Doe",
|
|
763
|
+
email: "john@example.test",
|
|
764
|
+
},
|
|
765
|
+
params: {
|
|
766
|
+
idType: "NATIONAL_ID",
|
|
767
|
+
idNumber: "1",
|
|
768
|
+
country: "KE",
|
|
769
|
+
},
|
|
770
|
+
}),
|
|
771
|
+
).rejects.toThrow(/empty or non.object/i);
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
it("throws when the server returns an array body", async () => {
|
|
775
|
+
const { api, setNextResponse } = makeApi();
|
|
776
|
+
setNextResponse([]);
|
|
777
|
+
await expect(
|
|
778
|
+
api.enhancedKyc({
|
|
779
|
+
jobType: JobType.enhancedKyc,
|
|
780
|
+
consent,
|
|
781
|
+
metadata,
|
|
782
|
+
userDetails: {
|
|
783
|
+
givenNames: "John",
|
|
784
|
+
lastName: "Doe",
|
|
785
|
+
email: "john@example.test",
|
|
786
|
+
},
|
|
787
|
+
params: {
|
|
788
|
+
idType: "NATIONAL_ID",
|
|
789
|
+
idNumber: "1",
|
|
790
|
+
country: "KE",
|
|
791
|
+
},
|
|
792
|
+
}),
|
|
793
|
+
).rejects.toThrow(/empty or non.object/i);
|
|
794
|
+
});
|
|
795
|
+
});
|
|
796
|
+
|
|
797
|
+
describe("SmileIDAPI.smartSelfieEnrollment", () => {
|
|
798
|
+
function makeRequest(
|
|
799
|
+
userDetailsOverride?: UserDetails,
|
|
800
|
+
): SmartSelfieEnrollmentRequest {
|
|
801
|
+
return {
|
|
802
|
+
jobType: JobType.smartSelfieEnrollment,
|
|
803
|
+
selfieImage: "file:///selfie.jpg",
|
|
804
|
+
// 7-frame canonical liveness count — matches the
|
|
805
|
+
// `REQUIRED_LIVENESS_FRAME_COUNT` enforced by `SmileIDAPI`.
|
|
806
|
+
livenessImages: [
|
|
807
|
+
"file:///l1.jpg",
|
|
808
|
+
"file:///l2.jpg",
|
|
809
|
+
"file:///l3.jpg",
|
|
810
|
+
"file:///l4.jpg",
|
|
811
|
+
"file:///l5.jpg",
|
|
812
|
+
"file:///l6.jpg",
|
|
813
|
+
"file:///l7.jpg",
|
|
814
|
+
],
|
|
815
|
+
consent,
|
|
816
|
+
metadata,
|
|
817
|
+
expectedLivenessImageCount: 7,
|
|
818
|
+
userDetails: userDetailsOverride ?? {
|
|
819
|
+
givenNames: "John",
|
|
820
|
+
lastName: "Doe",
|
|
821
|
+
email: "john@example.test",
|
|
822
|
+
phoneNumber: "+254700000000",
|
|
823
|
+
},
|
|
824
|
+
enhanced: false,
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
it("posts to the canonical `/v3/registration` path", async () => {
|
|
829
|
+
// Concrete scenario: the previous behavior selected a different
|
|
830
|
+
// URL when `enhanced: true`. The lambda only routes on
|
|
831
|
+
// `/v3/registration` for smart-selfie enrollment, so both paths
|
|
832
|
+
// collapse onto the canonical URL.
|
|
833
|
+
const { api, calls } = makeApi();
|
|
834
|
+
await api.smartSelfieEnrollment(makeRequest());
|
|
835
|
+
expect(calls[0]!.url).toBe("/v3/registration");
|
|
836
|
+
});
|
|
837
|
+
|
|
838
|
+
it("posts to `/v3/registration` even when the request is marked enhanced", async () => {
|
|
839
|
+
const { api, calls } = makeApi();
|
|
840
|
+
await api.smartSelfieEnrollment({ ...makeRequest(), enhanced: true });
|
|
841
|
+
expect(calls[0]!.url).toBe("/v3/registration");
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
it("sends a `user_details` JSON multipart part with snake_case keys", async () => {
|
|
845
|
+
const { api, calls } = makeApi();
|
|
846
|
+
await api.smartSelfieEnrollment(makeRequest());
|
|
847
|
+
const parts = partsByName(calls[0]!.body);
|
|
848
|
+
expect(parts["user_details"]).toBeDefined();
|
|
849
|
+
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
850
|
+
expect(parsed).toEqual({
|
|
851
|
+
given_names: "John",
|
|
852
|
+
last_name: "Doe",
|
|
853
|
+
email: "john@example.test",
|
|
854
|
+
phone_number: "+254700000000",
|
|
855
|
+
});
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
it("sends the `user_details` part as a plain text form field (no application/json tag)", async () => {
|
|
859
|
+
// Concrete scenario: the live server's multipart parser rejects
|
|
860
|
+
// parts tagged `Content-Type: application/json` with "missing or
|
|
861
|
+
// invalid". `user_details` rides as a plain text form field
|
|
862
|
+
// carrying a JSON-serialized string value (Postman `"type":
|
|
863
|
+
// "text"` shape).
|
|
864
|
+
const { api, calls } = makeApi();
|
|
865
|
+
await api.smartSelfieEnrollment(makeRequest());
|
|
866
|
+
const parts = partsByName(calls[0]!.body);
|
|
867
|
+
expectNoJsonContentType(parts["user_details"]![0]);
|
|
868
|
+
});
|
|
869
|
+
|
|
870
|
+
it("omits `email` from user_details when blank", async () => {
|
|
871
|
+
const { api, calls } = makeApi();
|
|
872
|
+
await api.smartSelfieEnrollment(
|
|
873
|
+
makeRequest({
|
|
874
|
+
givenNames: "John",
|
|
875
|
+
lastName: "Doe",
|
|
876
|
+
phoneNumber: "+254700000000",
|
|
877
|
+
}),
|
|
878
|
+
);
|
|
879
|
+
const parts = partsByName(calls[0]!.body);
|
|
880
|
+
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
881
|
+
expect(parsed.email).toBeUndefined();
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
it("sends selfie + liveness file parts", async () => {
|
|
885
|
+
const { api, calls } = makeApi();
|
|
886
|
+
await api.smartSelfieEnrollment(makeRequest());
|
|
887
|
+
const parts = partsByName(calls[0]!.body);
|
|
888
|
+
expect(parts["selfie_image"]).toHaveLength(1);
|
|
889
|
+
expect(parts["liveness_images"]).toHaveLength(7);
|
|
890
|
+
});
|
|
891
|
+
|
|
892
|
+
it("forwards PartnerConfig.callbackUrl and partnerParams as multipart parts", async () => {
|
|
893
|
+
const { api, calls } = makeApi({
|
|
894
|
+
callbackUrl: "https://partner.test/cb",
|
|
895
|
+
partnerParams: { jobRef: "ref-1" },
|
|
896
|
+
});
|
|
897
|
+
await api.smartSelfieEnrollment(makeRequest());
|
|
898
|
+
const parts = partsByName(calls[0]!.body);
|
|
899
|
+
expect(parts["callback_url"]).toEqual(["https://partner.test/cb"]);
|
|
900
|
+
expect(parts["partner_params"]).toBeDefined();
|
|
901
|
+
expectNoJsonContentType(parts["partner_params"]![0]);
|
|
902
|
+
});
|
|
903
|
+
});
|
|
904
|
+
|
|
905
|
+
describe("SmileIDAPI.smartSelfieAuthentication", () => {
|
|
906
|
+
function makeRequest(
|
|
907
|
+
userDetailsOverride?: UserDetails,
|
|
908
|
+
): SmartSelfieAuthenticationRequest {
|
|
909
|
+
return {
|
|
910
|
+
jobType: JobType.smartSelfieAuthentication,
|
|
911
|
+
selfieImage: "file:///selfie.jpg",
|
|
912
|
+
// 7-frame canonical liveness count — matches the
|
|
913
|
+
// `REQUIRED_LIVENESS_FRAME_COUNT` enforced by `SmileIDAPI`.
|
|
914
|
+
livenessImages: [
|
|
915
|
+
"file:///l1.jpg",
|
|
916
|
+
"file:///l2.jpg",
|
|
917
|
+
"file:///l3.jpg",
|
|
918
|
+
"file:///l4.jpg",
|
|
919
|
+
"file:///l5.jpg",
|
|
920
|
+
"file:///l6.jpg",
|
|
921
|
+
"file:///l7.jpg",
|
|
922
|
+
],
|
|
923
|
+
consent,
|
|
924
|
+
metadata,
|
|
925
|
+
expectedLivenessImageCount: 7,
|
|
926
|
+
userDetails: userDetailsOverride ?? {
|
|
927
|
+
givenNames: "Jane",
|
|
928
|
+
lastName: "Doe",
|
|
929
|
+
email: "jane@example.test",
|
|
930
|
+
phoneNumber: "+254700000000",
|
|
931
|
+
},
|
|
932
|
+
userId: "prior-enrollment-user-id",
|
|
933
|
+
enhanced: false,
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
it("posts to the canonical `/v3/authentication` path", async () => {
|
|
938
|
+
const { api, calls } = makeApi();
|
|
939
|
+
await api.smartSelfieAuthentication(makeRequest());
|
|
940
|
+
expect(calls[0]!.url).toBe("/v3/authentication");
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
it("posts to `/v3/authentication` even when the request is marked enhanced", async () => {
|
|
944
|
+
const { api, calls } = makeApi();
|
|
945
|
+
await api.smartSelfieAuthentication({ ...makeRequest(), enhanced: true });
|
|
946
|
+
expect(calls[0]!.url).toBe("/v3/authentication");
|
|
947
|
+
});
|
|
948
|
+
|
|
949
|
+
it("sends a `user_details` JSON multipart part with snake_case keys", async () => {
|
|
950
|
+
const { api, calls } = makeApi();
|
|
951
|
+
await api.smartSelfieAuthentication(makeRequest());
|
|
952
|
+
const parts = partsByName(calls[0]!.body);
|
|
953
|
+
expect(parts["user_details"]).toBeDefined();
|
|
954
|
+
const parsed = JSON.parse(await readJsonPart(parts["user_details"]![0]));
|
|
955
|
+
expect(parsed).toEqual({
|
|
956
|
+
given_names: "Jane",
|
|
957
|
+
last_name: "Doe",
|
|
958
|
+
email: "jane@example.test",
|
|
959
|
+
phone_number: "+254700000000",
|
|
960
|
+
});
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
it("sends the `user_details` part as a plain text form field (no application/json tag)", async () => {
|
|
964
|
+
const { api, calls } = makeApi();
|
|
965
|
+
await api.smartSelfieAuthentication(makeRequest());
|
|
966
|
+
const parts = partsByName(calls[0]!.body);
|
|
967
|
+
expectNoJsonContentType(parts["user_details"]![0]);
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
it("sends selfie + liveness file parts", async () => {
|
|
971
|
+
const { api, calls } = makeApi();
|
|
972
|
+
await api.smartSelfieAuthentication(makeRequest());
|
|
973
|
+
const parts = partsByName(calls[0]!.body);
|
|
974
|
+
expect(parts["selfie_image"]).toHaveLength(1);
|
|
975
|
+
expect(parts["liveness_images"]).toHaveLength(7);
|
|
976
|
+
});
|
|
977
|
+
|
|
978
|
+
it("sends a `user_id` plain text multipart part carrying the request's userId", async () => {
|
|
979
|
+
const { api, calls } = makeApi();
|
|
980
|
+
await api.smartSelfieAuthentication(makeRequest());
|
|
981
|
+
const parts = partsByName(calls[0]!.body);
|
|
982
|
+
expect(parts["user_id"]).toEqual(["prior-enrollment-user-id"]);
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
it("sends the `user_id` part as a plain text form field (no application/json tag)", async () => {
|
|
986
|
+
const { api, calls } = makeApi();
|
|
987
|
+
await api.smartSelfieAuthentication(makeRequest());
|
|
988
|
+
const parts = partsByName(calls[0]!.body);
|
|
989
|
+
expectNoJsonContentType(parts["user_id"]![0]);
|
|
990
|
+
});
|
|
991
|
+
});
|
|
992
|
+
|
|
993
|
+
describe("SmileIDAPI response-body parse failures", () => {
|
|
994
|
+
/**
|
|
995
|
+
* Lock down the parse-error path: when the server returns a 2xx
|
|
996
|
+
* response with a malformed body (e.g. wire-format change, broken
|
|
997
|
+
* proxy that strips JSON, …), the SDK must throw
|
|
998
|
+
* `NetworkResponseParseException` so partner code branching on
|
|
999
|
+
* `e instanceof NetworkResponseParseException` sees the right
|
|
1000
|
+
* type. The repository's `_mapError` recognises this typed
|
|
1001
|
+
* exception via the idempotent pass-through in `mapAxiosError`
|
|
1002
|
+
* and surfaces it through `failure(...)` without re-wrapping.
|
|
1003
|
+
*/
|
|
1004
|
+
|
|
1005
|
+
function makeSelfieRequest(): SmartSelfieEnrollmentRequest {
|
|
1006
|
+
return {
|
|
1007
|
+
jobType: JobType.smartSelfieEnrollment,
|
|
1008
|
+
selfieImage: "file:///selfie.jpg",
|
|
1009
|
+
livenessImages: [
|
|
1010
|
+
"file:///l1.jpg",
|
|
1011
|
+
"file:///l2.jpg",
|
|
1012
|
+
"file:///l3.jpg",
|
|
1013
|
+
"file:///l4.jpg",
|
|
1014
|
+
"file:///l5.jpg",
|
|
1015
|
+
"file:///l6.jpg",
|
|
1016
|
+
"file:///l7.jpg",
|
|
1017
|
+
],
|
|
1018
|
+
consent,
|
|
1019
|
+
metadata,
|
|
1020
|
+
expectedLivenessImageCount: 7,
|
|
1021
|
+
userDetails: {
|
|
1022
|
+
givenNames: "John",
|
|
1023
|
+
lastName: "Doe",
|
|
1024
|
+
email: "john@example.test",
|
|
1025
|
+
phoneNumber: "+254700000000",
|
|
1026
|
+
},
|
|
1027
|
+
enhanced: false,
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
it("throws NetworkResponseParseException when the body is null", async () => {
|
|
1032
|
+
const { api, setNextResponse } = makeApi();
|
|
1033
|
+
setNextResponse(null);
|
|
1034
|
+
await expect(
|
|
1035
|
+
api.smartSelfieEnrollment(makeSelfieRequest()),
|
|
1036
|
+
).rejects.toBeInstanceOf(NetworkResponseParseException);
|
|
1037
|
+
});
|
|
1038
|
+
|
|
1039
|
+
it("throws NetworkResponseParseException when the body is an array", async () => {
|
|
1040
|
+
// A server / proxy returning a JSON array instead of a job-result
|
|
1041
|
+
// object would otherwise slip through as `NetworkUnknownException`
|
|
1042
|
+
// and bury the wire-format mismatch. The typed exception keeps
|
|
1043
|
+
// partner triage tight.
|
|
1044
|
+
const { api, setNextResponse } = makeApi();
|
|
1045
|
+
setNextResponse([]);
|
|
1046
|
+
await expect(
|
|
1047
|
+
api.smartSelfieEnrollment(makeSelfieRequest()),
|
|
1048
|
+
).rejects.toBeInstanceOf(NetworkResponseParseException);
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
it("throws NetworkResponseParseException when the body is a string", async () => {
|
|
1052
|
+
const { api, setNextResponse } = makeApi();
|
|
1053
|
+
setNextResponse("not-an-object");
|
|
1054
|
+
await expect(
|
|
1055
|
+
api.smartSelfieEnrollment(makeSelfieRequest()),
|
|
1056
|
+
).rejects.toBeInstanceOf(NetworkResponseParseException);
|
|
1057
|
+
});
|
|
1058
|
+
|
|
1059
|
+
it("the thrown exception carries the canonical error code", async () => {
|
|
1060
|
+
const { api, setNextResponse } = makeApi();
|
|
1061
|
+
setNextResponse(null);
|
|
1062
|
+
try {
|
|
1063
|
+
await api.smartSelfieEnrollment(makeSelfieRequest());
|
|
1064
|
+
throw new Error("expected smartSelfieEnrollment to throw");
|
|
1065
|
+
} catch (error) {
|
|
1066
|
+
expect(error).toBeInstanceOf(NetworkResponseParseException);
|
|
1067
|
+
expect((error as NetworkResponseParseException).errorCode).toBe(
|
|
1068
|
+
"NETWORK_PARSE_ERROR",
|
|
1069
|
+
);
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
});
|
|
1073
|
+
|
|
1074
|
+
describe("SmileIDAPI signed job opt-in (request MAC + attestation)", () => {
|
|
1075
|
+
// An endpoint missing the opt-in flags ships an unsigned job the
|
|
1076
|
+
// server rejects — while the interceptors' own tests stay green.
|
|
1077
|
+
const livenessImages: readonly string[] = [
|
|
1078
|
+
"file:///l1.jpg",
|
|
1079
|
+
"file:///l2.jpg",
|
|
1080
|
+
"file:///l3.jpg",
|
|
1081
|
+
"file:///l4.jpg",
|
|
1082
|
+
"file:///l5.jpg",
|
|
1083
|
+
"file:///l6.jpg",
|
|
1084
|
+
"file:///l7.jpg",
|
|
1085
|
+
];
|
|
1086
|
+
const userDetails: UserDetails = {
|
|
1087
|
+
givenNames: "John",
|
|
1088
|
+
lastName: "Doe",
|
|
1089
|
+
};
|
|
1090
|
+
const kycParams = {
|
|
1091
|
+
idType: "NATIONAL_ID",
|
|
1092
|
+
idNumber: "32232403",
|
|
1093
|
+
country: "KE",
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
const submissions: ReadonlyArray<{
|
|
1097
|
+
readonly endpoint: string;
|
|
1098
|
+
readonly submit: (api: SmileIDAPI) => Promise<unknown>;
|
|
1099
|
+
}> = [
|
|
1100
|
+
{
|
|
1101
|
+
endpoint: "/v3/registration",
|
|
1102
|
+
submit: (api) =>
|
|
1103
|
+
api.smartSelfieEnrollment({
|
|
1104
|
+
jobType: JobType.smartSelfieEnrollment,
|
|
1105
|
+
selfieImage: "file:///selfie.jpg",
|
|
1106
|
+
livenessImages,
|
|
1107
|
+
userDetails,
|
|
1108
|
+
enhanced: false,
|
|
1109
|
+
consent,
|
|
1110
|
+
metadata,
|
|
1111
|
+
expectedLivenessImageCount: 7,
|
|
1112
|
+
}),
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
endpoint: "/v3/authentication",
|
|
1116
|
+
submit: (api) =>
|
|
1117
|
+
api.smartSelfieAuthentication({
|
|
1118
|
+
jobType: JobType.smartSelfieAuthentication,
|
|
1119
|
+
selfieImage: "file:///selfie.jpg",
|
|
1120
|
+
livenessImages,
|
|
1121
|
+
userDetails,
|
|
1122
|
+
userId: "user-1",
|
|
1123
|
+
enhanced: false,
|
|
1124
|
+
consent,
|
|
1125
|
+
metadata,
|
|
1126
|
+
expectedLivenessImageCount: 7,
|
|
1127
|
+
}),
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
endpoint: "/v3/enhanced_kyc",
|
|
1131
|
+
submit: (api) =>
|
|
1132
|
+
api.enhancedKyc({
|
|
1133
|
+
jobType: JobType.enhancedKyc,
|
|
1134
|
+
params: kycParams,
|
|
1135
|
+
userDetails,
|
|
1136
|
+
consent,
|
|
1137
|
+
metadata,
|
|
1138
|
+
}),
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
endpoint: "/v3/biometric_kyc",
|
|
1142
|
+
submit: (api) =>
|
|
1143
|
+
api.biometricKyc({
|
|
1144
|
+
jobType: JobType.biometricKyc,
|
|
1145
|
+
selfieImage: "file:///selfie.jpg",
|
|
1146
|
+
livenessImages,
|
|
1147
|
+
params: { ...kycParams, useEnrolledImage: false },
|
|
1148
|
+
userDetails,
|
|
1149
|
+
consent,
|
|
1150
|
+
metadata,
|
|
1151
|
+
expectedLivenessImageCount: 7,
|
|
1152
|
+
}),
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
endpoint: "/v3/document_verification",
|
|
1156
|
+
submit: (api) =>
|
|
1157
|
+
api.documentVerification({
|
|
1158
|
+
jobType: JobType.documentVerification,
|
|
1159
|
+
selfieImage: "file:///selfie.jpg",
|
|
1160
|
+
livenessImages,
|
|
1161
|
+
frontDocument: "file:///front.jpg",
|
|
1162
|
+
country: "KE",
|
|
1163
|
+
userDetails,
|
|
1164
|
+
consent,
|
|
1165
|
+
metadata,
|
|
1166
|
+
expectedLivenessImageCount: 7,
|
|
1167
|
+
}),
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
endpoint: "/v3/enhanced_document_verification",
|
|
1171
|
+
submit: (api) =>
|
|
1172
|
+
api.enhancedDocumentVerification({
|
|
1173
|
+
jobType: JobType.enhancedDocumentVerification,
|
|
1174
|
+
selfieImage: "file:///selfie.jpg",
|
|
1175
|
+
livenessImages,
|
|
1176
|
+
frontDocument: "file:///front.jpg",
|
|
1177
|
+
country: "KE",
|
|
1178
|
+
idType: "NATIONAL_ID",
|
|
1179
|
+
userDetails,
|
|
1180
|
+
consent,
|
|
1181
|
+
metadata,
|
|
1182
|
+
expectedLivenessImageCount: 7,
|
|
1183
|
+
}),
|
|
1184
|
+
},
|
|
1185
|
+
];
|
|
1186
|
+
|
|
1187
|
+
for (const { endpoint, submit } of submissions) {
|
|
1188
|
+
it(`opts the ${endpoint} submission into MAC signing and attestation`, async () => {
|
|
1189
|
+
const { api, calls } = makeApi();
|
|
1190
|
+
await submit(api);
|
|
1191
|
+
expect(calls).toHaveLength(1);
|
|
1192
|
+
expect(calls[0]!.url).toBe(endpoint);
|
|
1193
|
+
expect(calls[0]!.config?.[REQUEST_MAC_OPT_IN_KEY]).toBe(true);
|
|
1194
|
+
expect(calls[0]!.config?.[ATTESTATION_OPT_IN_KEY]).toBe(true);
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
});
|