@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,94 @@
|
|
|
1
|
+
import type { JobRequest } from "../model/job_request";
|
|
2
|
+
import type { JobSubmissionResponse } from "../model/job_submission_response";
|
|
3
|
+
import type { SmileIDAPI } from "../api/smile_id_api";
|
|
4
|
+
import type { RetryConfig } from "../../core/models/network_config";
|
|
5
|
+
import type { UseSmileIDResult } from "../../core/models/result";
|
|
6
|
+
import { failure, success } from "../../core/models/result";
|
|
7
|
+
import { JobType } from "../../core/models/job_type";
|
|
8
|
+
import { withRetry } from "../util/retry_util";
|
|
9
|
+
import { InvalidFieldValueException } from "../../core/exception/job_validation_exceptions";
|
|
10
|
+
import { UseSmileIDValidationException } from "../../core/exception/use_smile_id_validation_exception";
|
|
11
|
+
import {
|
|
12
|
+
mapAxiosError,
|
|
13
|
+
type UseSmileIDNetworkException,
|
|
14
|
+
} from "../../core/exception/use_smile_id_network_exception";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Concrete repository.
|
|
18
|
+
*
|
|
19
|
+
* Exhaustive-switch dispatch over the `JobRequest` discriminated
|
|
20
|
+
* union — adding a new variant fails to compile here until the new
|
|
21
|
+
* dispatch case lands, so partner orchestrator code never silently
|
|
22
|
+
* skips a request type.
|
|
23
|
+
*/
|
|
24
|
+
export class UseSmileIDRepositoryImpl {
|
|
25
|
+
private readonly _api: SmileIDAPI;
|
|
26
|
+
private readonly _retry: RetryConfig;
|
|
27
|
+
|
|
28
|
+
constructor(api: SmileIDAPI, retry: RetryConfig) {
|
|
29
|
+
this._api = api;
|
|
30
|
+
this._retry = retry;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async submit(
|
|
34
|
+
request: JobRequest,
|
|
35
|
+
): Promise<UseSmileIDResult<JobSubmissionResponse>> {
|
|
36
|
+
// BVN is not yet supported. Fail fast at the repository boundary
|
|
37
|
+
// with the canonical typed exception so partner `onResult` sees a
|
|
38
|
+
// structured error rather than a wire-level failure from the
|
|
39
|
+
// server.
|
|
40
|
+
if (request.jobType === JobType.bvn) {
|
|
41
|
+
return failure(
|
|
42
|
+
new InvalidFieldValueException({
|
|
43
|
+
fieldName: "jobType",
|
|
44
|
+
reason: "BVN submission is not yet supported",
|
|
45
|
+
}),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const response = await withRetry(this._retry, () =>
|
|
50
|
+
this._dispatch(request),
|
|
51
|
+
);
|
|
52
|
+
return success(response);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
// A validation failure (e.g. a liveness-count mismatch) is a
|
|
55
|
+
// pre-network constraint violation — surface the typed exception
|
|
56
|
+
// directly rather than collapsing it into the network hierarchy, so
|
|
57
|
+
// partners can catch it as the validation error it is.
|
|
58
|
+
if (error instanceof UseSmileIDValidationException) {
|
|
59
|
+
return failure(error);
|
|
60
|
+
}
|
|
61
|
+
return failure(this._mapError(error));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private _dispatch(
|
|
66
|
+
request: Exclude<JobRequest, { jobType: typeof JobType.bvn }>,
|
|
67
|
+
): Promise<JobSubmissionResponse> {
|
|
68
|
+
switch (request.jobType) {
|
|
69
|
+
case JobType.smartSelfieEnrollment:
|
|
70
|
+
return this._api.smartSelfieEnrollment(request);
|
|
71
|
+
case JobType.smartSelfieAuthentication:
|
|
72
|
+
return this._api.smartSelfieAuthentication(request);
|
|
73
|
+
case JobType.enhancedKyc:
|
|
74
|
+
return this._api.enhancedKyc(request);
|
|
75
|
+
case JobType.biometricKyc:
|
|
76
|
+
return this._api.biometricKyc(request);
|
|
77
|
+
case JobType.documentVerification:
|
|
78
|
+
return this._api.documentVerification(request);
|
|
79
|
+
case JobType.enhancedDocumentVerification:
|
|
80
|
+
return this._api.enhancedDocumentVerification(request);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Translate any caught error into the typed
|
|
86
|
+
* [UseSmileIDNetworkException] hierarchy. Delegates to the canonical
|
|
87
|
+
* [mapAxiosError] so a single mapper implementation covers both the
|
|
88
|
+
* repository layer and any future call sites (interceptors,
|
|
89
|
+
* partner-supplied error wrappers).
|
|
90
|
+
*/
|
|
91
|
+
private _mapError(error: unknown): UseSmileIDNetworkException {
|
|
92
|
+
return mapAxiosError(error);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { SigningCrypto, base64Encode, utf8Bytes } from "../signing_crypto";
|
|
4
|
+
import { SmileIDCryptoManager } from "../smile_id_crypto_manager";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Pins down the request-signing contract:
|
|
8
|
+
* - A multipart request signs to a fixed known-answer vector so any
|
|
9
|
+
* divergence from the canonical algorithm — the logical payload (JSON
|
|
10
|
+
* fields parsed, file parts Base64'd, scalars as strings) key-sorted and
|
|
11
|
+
* compact-stringified, then PBKDF2-HMAC-SHA256 keyed and Base64-encoded —
|
|
12
|
+
* fails loud.
|
|
13
|
+
* - Only `smileid-*` headers are signed, and the body is canonicalised so the
|
|
14
|
+
* MAC is independent of header / part ordering.
|
|
15
|
+
*/
|
|
16
|
+
const TIMESTAMP = "1700000000000";
|
|
17
|
+
const subject = new SmileIDCryptoManager("test-signing-secret");
|
|
18
|
+
|
|
19
|
+
const KAT_HEADERS = {
|
|
20
|
+
"smileid-token": "test-token",
|
|
21
|
+
"smileid-request-timestamp": TIMESTAMP,
|
|
22
|
+
"content-type": "multipart/form-data",
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** Minimal stand-in for React Native's `FormData` (only `getParts` is read). */
|
|
26
|
+
function formData(
|
|
27
|
+
parts: ReadonlyArray<{ fieldName: string; string?: string; uri?: string }>,
|
|
28
|
+
) {
|
|
29
|
+
return { getParts: () => parts };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The known-answer-vector body: scalar string fields, a top-level boolean
|
|
34
|
+
* string, two JSON fields, and a file part — exercising every classification.
|
|
35
|
+
* The file is a `data:` URI so the canonicalizer's `fetch` reads its bytes
|
|
36
|
+
* (Base64 of "selfiebytes").
|
|
37
|
+
*/
|
|
38
|
+
function katBody() {
|
|
39
|
+
return formData([
|
|
40
|
+
{ fieldName: "country", string: "NG" },
|
|
41
|
+
{ fieldName: "id_type", string: "PASSPORT" },
|
|
42
|
+
{ fieldName: "allow_new_enroll", string: "true" },
|
|
43
|
+
{
|
|
44
|
+
fieldName: "consent",
|
|
45
|
+
string: '{"granted":true,"personal_details":false}',
|
|
46
|
+
},
|
|
47
|
+
{ fieldName: "partner_params", string: '{"job_id":"j1","user_id":"u1"}' },
|
|
48
|
+
{
|
|
49
|
+
fieldName: "selfie_image",
|
|
50
|
+
uri: "data:application/octet-stream;base64,c2VsZmllYnl0ZXM=",
|
|
51
|
+
},
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
describe("SmileIDCryptoManager", () => {
|
|
56
|
+
it("signs a multipart request to the known-answer vector", async () => {
|
|
57
|
+
const mac = await subject.sign(TIMESTAMP, KAT_HEADERS, katBody());
|
|
58
|
+
expect(mac).toBe("nW0HenQOrKH/qAwQBveK+TSXvg70oVWfD0aGGtfI1bk=");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("multipart body MAC is independent of part order", async () => {
|
|
62
|
+
const headers = { "smileid-request-timestamp": TIMESTAMP };
|
|
63
|
+
const first = await subject.sign(
|
|
64
|
+
TIMESTAMP,
|
|
65
|
+
headers,
|
|
66
|
+
formData([
|
|
67
|
+
{ fieldName: "country", string: "NG" },
|
|
68
|
+
{ fieldName: "id_type", string: "PASSPORT" },
|
|
69
|
+
]),
|
|
70
|
+
);
|
|
71
|
+
const second = await subject.sign(
|
|
72
|
+
TIMESTAMP,
|
|
73
|
+
headers,
|
|
74
|
+
formData([
|
|
75
|
+
{ fieldName: "id_type", string: "PASSPORT" },
|
|
76
|
+
{ fieldName: "country", string: "NG" },
|
|
77
|
+
]),
|
|
78
|
+
);
|
|
79
|
+
expect(first).toBe(second);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("non-smileid headers do not affect the MAC", async () => {
|
|
83
|
+
const body = () => formData([{ fieldName: "country", string: "NG" }]);
|
|
84
|
+
const withoutExtras = await subject.sign(
|
|
85
|
+
TIMESTAMP,
|
|
86
|
+
{ "smileid-token": "test-token" },
|
|
87
|
+
body(),
|
|
88
|
+
);
|
|
89
|
+
const withExtras = await subject.sign(
|
|
90
|
+
TIMESTAMP,
|
|
91
|
+
{
|
|
92
|
+
"smileid-token": "test-token",
|
|
93
|
+
"x-extra": "ignored",
|
|
94
|
+
accept: "application/json",
|
|
95
|
+
},
|
|
96
|
+
body(),
|
|
97
|
+
);
|
|
98
|
+
expect(withoutExtras).toBe(withExtras);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("internal marker headers do not affect the MAC", async () => {
|
|
102
|
+
const body = () => formData([{ fieldName: "country", string: "NG" }]);
|
|
103
|
+
const withoutMarkers = await subject.sign(
|
|
104
|
+
TIMESTAMP,
|
|
105
|
+
{ "smileid-token": "test-token" },
|
|
106
|
+
body(),
|
|
107
|
+
);
|
|
108
|
+
const withMarkers = await subject.sign(
|
|
109
|
+
TIMESTAMP,
|
|
110
|
+
{
|
|
111
|
+
"smileid-token": "test-token",
|
|
112
|
+
"x-smileid-requires-attestation": "true",
|
|
113
|
+
"x-smileid-requires-mac": "true",
|
|
114
|
+
},
|
|
115
|
+
body(),
|
|
116
|
+
);
|
|
117
|
+
expect(withoutMarkers).toBe(withMarkers);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("smileid-prefixed headers affect the MAC", async () => {
|
|
121
|
+
const body = () => formData([{ fieldName: "country", string: "NG" }]);
|
|
122
|
+
const withFirstToken = await subject.sign(
|
|
123
|
+
TIMESTAMP,
|
|
124
|
+
{ "smileid-token": "token-one" },
|
|
125
|
+
body(),
|
|
126
|
+
);
|
|
127
|
+
const withSecondToken = await subject.sign(
|
|
128
|
+
TIMESTAMP,
|
|
129
|
+
{ "smileid-token": "token-two" },
|
|
130
|
+
body(),
|
|
131
|
+
);
|
|
132
|
+
expect(withFirstToken).not.toBe(withSecondToken);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("different signing secrets produce different MACs", async () => {
|
|
136
|
+
const withDefaultSecret = await subject.sign(
|
|
137
|
+
TIMESTAMP,
|
|
138
|
+
KAT_HEADERS,
|
|
139
|
+
katBody(),
|
|
140
|
+
);
|
|
141
|
+
const withOtherSecret = await new SmileIDCryptoManager("other-secret").sign(
|
|
142
|
+
TIMESTAMP,
|
|
143
|
+
KAT_HEADERS,
|
|
144
|
+
katBody(),
|
|
145
|
+
);
|
|
146
|
+
expect(withDefaultSecret).not.toBe(withOtherSecret);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("hmacSha256 matches RFC 4231 Test Case 2", async () => {
|
|
150
|
+
const mac = await SigningCrypto.hmacSha256(
|
|
151
|
+
utf8Bytes("Jefe"),
|
|
152
|
+
utf8Bytes("what do ya want for nothing?"),
|
|
153
|
+
);
|
|
154
|
+
expect(base64Encode(mac)).toBe(
|
|
155
|
+
"W9zBRr9gdU5qBCQmCJV1x1oAPwidJzmDnexYuWTsOEM=",
|
|
156
|
+
);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { base64Encode, utf8Bytes } from "./signing_crypto";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reduces a request to the canonical bytes that get signed: the signed headers
|
|
5
|
+
* as sorted-key JSON, followed by the canonicalised body. Canonicalisation
|
|
6
|
+
* reconstructs the logical request payload the server validates against, so the
|
|
7
|
+
* client and server sign the same bytes.
|
|
8
|
+
*
|
|
9
|
+
* The body reconstruction mirrors the server's form parser + payload processor:
|
|
10
|
+
* - JSON fields (`partner_params`, `metadata`, `failure_reason`, `consent`,
|
|
11
|
+
* `user_details`) are parsed into objects.
|
|
12
|
+
* - File parts contribute the Base64 of their bytes; repeated names (e.g.
|
|
13
|
+
* `liveness_images`) collapse into a list.
|
|
14
|
+
* - Every other field contributes its string value; a top-level `"true"` /
|
|
15
|
+
* `"false"` becomes a boolean.
|
|
16
|
+
* The result is key-sorted recursively and emitted as compact JSON, then
|
|
17
|
+
* `latitude`/`longitude` and the `device_movement_detected` metadata value are
|
|
18
|
+
* coerced from string to number to match the server.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const SIGNED_HEADER_PREFIX = "smileid-";
|
|
22
|
+
const REQUEST_MAC_HEADER = "smileid-request-mac";
|
|
23
|
+
const DEVICE_NONCE_HEADER = "smileid-device-nonce";
|
|
24
|
+
const JSON_FIELDS = new Set([
|
|
25
|
+
"partner_params",
|
|
26
|
+
"metadata",
|
|
27
|
+
"failure_reason",
|
|
28
|
+
"consent",
|
|
29
|
+
"user_details",
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
const LATITUDE_LONGITUDE =
|
|
33
|
+
/"(latitude|longitude)":"(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)"/g;
|
|
34
|
+
const DEVICE_MOVEMENT =
|
|
35
|
+
/("name":"device_movement_detected",.*?"value":)"(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)"/g;
|
|
36
|
+
|
|
37
|
+
/** The subset of React Native's `FormData` part shape the canonicalizer reads. */
|
|
38
|
+
type FormDataPart = {
|
|
39
|
+
readonly fieldName: string;
|
|
40
|
+
readonly string?: string;
|
|
41
|
+
readonly uri?: string;
|
|
42
|
+
};
|
|
43
|
+
type FormDataLike = { getParts(): readonly FormDataPart[] };
|
|
44
|
+
|
|
45
|
+
function isFormDataLike(body: unknown): body is FormDataLike {
|
|
46
|
+
return (
|
|
47
|
+
typeof body === "object" &&
|
|
48
|
+
body !== null &&
|
|
49
|
+
typeof (body as { getParts?: unknown }).getParts === "function"
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const RequestCanonicalizer = {
|
|
54
|
+
async canonicalize(
|
|
55
|
+
headers: Record<string, string>,
|
|
56
|
+
body: unknown,
|
|
57
|
+
): Promise<Uint8Array> {
|
|
58
|
+
return concat(canonicalHeaders(headers), await canonicalBody(body));
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
function canonicalHeaders(headers: Record<string, string>): Uint8Array {
|
|
63
|
+
const signed: Record<string, string> = {};
|
|
64
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
65
|
+
const name = key.toLowerCase();
|
|
66
|
+
if (
|
|
67
|
+
name.startsWith(SIGNED_HEADER_PREFIX) &&
|
|
68
|
+
name !== REQUEST_MAC_HEADER &&
|
|
69
|
+
name !== DEVICE_NONCE_HEADER
|
|
70
|
+
) {
|
|
71
|
+
signed[name] = value;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return utf8Bytes(canonicalJson(signed));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function canonicalBody(body: unknown): Promise<Uint8Array> {
|
|
78
|
+
if (!isFormDataLike(body)) return utf8Bytes("{}");
|
|
79
|
+
const payload: Record<string, unknown> = {};
|
|
80
|
+
for (const part of body.getParts()) {
|
|
81
|
+
merge(payload, part.fieldName, await partValue(part));
|
|
82
|
+
}
|
|
83
|
+
return utf8Bytes(coerceNumbers(canonicalJson(payload)));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** File parts (a `uri`) → Base64 of bytes; JSON fields → parsed; else string with bool coercion. */
|
|
87
|
+
async function partValue(part: FormDataPart): Promise<unknown> {
|
|
88
|
+
if (part.uri != null) {
|
|
89
|
+
const response = await fetch(part.uri);
|
|
90
|
+
return base64Encode(new Uint8Array(await response.arrayBuffer()));
|
|
91
|
+
}
|
|
92
|
+
const value = part.string ?? "";
|
|
93
|
+
if (JSON_FIELDS.has(part.fieldName)) {
|
|
94
|
+
try {
|
|
95
|
+
return JSON.parse(value);
|
|
96
|
+
} catch {
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (value === "true") return true;
|
|
101
|
+
if (value === "false") return false;
|
|
102
|
+
return value;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function merge(
|
|
106
|
+
payload: Record<string, unknown>,
|
|
107
|
+
name: string,
|
|
108
|
+
value: unknown,
|
|
109
|
+
): void {
|
|
110
|
+
if (!(name in payload)) {
|
|
111
|
+
payload[name] = value;
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const existing = payload[name];
|
|
115
|
+
payload[name] = Array.isArray(existing)
|
|
116
|
+
? [...existing, value]
|
|
117
|
+
: [existing, value];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Compact JSON with recursively sorted object keys (no whitespace). */
|
|
121
|
+
function canonicalJson(value: unknown): string {
|
|
122
|
+
return JSON.stringify(sortValue(value));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function sortValue(value: unknown): unknown {
|
|
126
|
+
if (Array.isArray(value)) return value.map(sortValue);
|
|
127
|
+
if (typeof value === "object" && value !== null) {
|
|
128
|
+
const sorted: Record<string, unknown> = {};
|
|
129
|
+
for (const key of Object.keys(value as Record<string, unknown>).sort()) {
|
|
130
|
+
sorted[key] = sortValue((value as Record<string, unknown>)[key]);
|
|
131
|
+
}
|
|
132
|
+
return sorted;
|
|
133
|
+
}
|
|
134
|
+
return value;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function coerceNumbers(json: string): string {
|
|
138
|
+
return json
|
|
139
|
+
.replace(LATITUDE_LONGITUDE, '"$1":$2')
|
|
140
|
+
.replace(DEVICE_MOVEMENT, "$1$2");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function concat(a: Uint8Array, b: Uint8Array): Uint8Array {
|
|
144
|
+
const out = new Uint8Array(a.length + b.length);
|
|
145
|
+
out.set(a, 0);
|
|
146
|
+
out.set(b, a.length);
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The request timestamp used for request signing: epoch milliseconds rendered
|
|
3
|
+
* as a string.
|
|
4
|
+
*
|
|
5
|
+
* Stamped as the `smileid-request-timestamp` header and reused as the
|
|
6
|
+
* request-MAC salt, so producing it in one place keeps the clock read and the
|
|
7
|
+
* wire format consistent between the header and the signature. The server
|
|
8
|
+
* validates the value against its accepted clock-skew window.
|
|
9
|
+
*/
|
|
10
|
+
export function currentRequestTimestamp(): string {
|
|
11
|
+
return Date.now().toString();
|
|
12
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { SmileIDCryptoError } from "./smile_id_crypto_error";
|
|
2
|
+
|
|
3
|
+
// Ambient declaration for the text-encoding global. `tsconfig.base.json` ships
|
|
4
|
+
// `lib: ["ES2022"]` (no DOM types) so `TextEncoder` isn't in scope by default.
|
|
5
|
+
// React Native exposes it (Hermes built-in since 0.71); Node provides it too.
|
|
6
|
+
declare class TextEncoder {
|
|
7
|
+
encode(input: string): Uint8Array;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// CommonJS `require`, provided by the Metro / Node runtime. Declared so the
|
|
11
|
+
// workspace `tsc` build doesn't need `@types/node` for the single lazy require
|
|
12
|
+
// of the native crypto provider below. Matches the attestation bridge module.
|
|
13
|
+
declare function require(moduleName: string): unknown;
|
|
14
|
+
|
|
15
|
+
const KEY_LENGTH_BYTES = 32;
|
|
16
|
+
const ITERATIONS = 200000;
|
|
17
|
+
|
|
18
|
+
/** UTF-8 encodes a string to bytes. */
|
|
19
|
+
export function utf8Bytes(input: string): Uint8Array {
|
|
20
|
+
return new TextEncoder().encode(input);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const BASE64_ALPHABET =
|
|
24
|
+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
25
|
+
|
|
26
|
+
/** Standard-alphabet Base64 of [bytes] (no line wrap). */
|
|
27
|
+
export function base64Encode(bytes: Uint8Array): string {
|
|
28
|
+
let out = "";
|
|
29
|
+
for (let i = 0; i < bytes.length; i += 3) {
|
|
30
|
+
const b0 = bytes[i] as number;
|
|
31
|
+
const b1 = i + 1 < bytes.length ? (bytes[i + 1] as number) : 0;
|
|
32
|
+
const b2 = i + 2 < bytes.length ? (bytes[i + 2] as number) : 0;
|
|
33
|
+
out += BASE64_ALPHABET[b0 >> 2];
|
|
34
|
+
out += BASE64_ALPHABET[((b0 & 0x03) << 4) | (b1 >> 4)];
|
|
35
|
+
out +=
|
|
36
|
+
i + 1 < bytes.length
|
|
37
|
+
? BASE64_ALPHABET[((b1 & 0x0f) << 2) | (b2 >> 6)]
|
|
38
|
+
: "=";
|
|
39
|
+
out += i + 2 < bytes.length ? BASE64_ALPHABET[b2 & 0x3f] : "=";
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Minimal structural type for the Web Crypto `SubtleCrypto` surface this module
|
|
46
|
+
* uses. Declared locally because the workspace tsconfig omits the DOM lib.
|
|
47
|
+
*/
|
|
48
|
+
interface SubtleLike {
|
|
49
|
+
importKey(
|
|
50
|
+
format: "raw",
|
|
51
|
+
keyData: ArrayBuffer,
|
|
52
|
+
algorithm: { name: "HMAC"; hash: "SHA-256" } | "PBKDF2",
|
|
53
|
+
extractable: boolean,
|
|
54
|
+
keyUsages: readonly ("sign" | "deriveBits")[],
|
|
55
|
+
): Promise<unknown>;
|
|
56
|
+
sign(
|
|
57
|
+
algorithm: "HMAC",
|
|
58
|
+
key: unknown,
|
|
59
|
+
data: ArrayBuffer,
|
|
60
|
+
): Promise<ArrayBuffer>;
|
|
61
|
+
deriveBits(
|
|
62
|
+
algorithm: {
|
|
63
|
+
name: "PBKDF2";
|
|
64
|
+
salt: ArrayBuffer;
|
|
65
|
+
iterations: number;
|
|
66
|
+
hash: "SHA-256";
|
|
67
|
+
},
|
|
68
|
+
key: unknown,
|
|
69
|
+
length: number,
|
|
70
|
+
): Promise<ArrayBuffer>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Cached only once a provider is found. A not-found result is never cached, so a
|
|
74
|
+
// provider that appears later (e.g. a partner that polyfills `globalThis.crypto`
|
|
75
|
+
// or calls `react-native-quick-crypto`'s `install()` after the first signing
|
|
76
|
+
// attempt) is picked up on the next call instead of being stuck throwing.
|
|
77
|
+
let cachedSubtle: SubtleLike | undefined;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Resolve the Web Crypto provider for request signing:
|
|
81
|
+
*
|
|
82
|
+
* 1. An existing global `crypto.subtle` — Node (vitest) provides it, and a
|
|
83
|
+
* runtime that already polyfills Web Crypto (e.g. a partner app that calls
|
|
84
|
+
* `react-native-quick-crypto`'s `install()`) exposes it here.
|
|
85
|
+
* 2. `react-native-quick-crypto` — the native (OpenSSL) provider bundled on
|
|
86
|
+
* device. Hermes ships no `crypto.subtle`, so this is the on-device path;
|
|
87
|
+
* PBKDF2/HMAC then run in compiled native code (~ms) rather than the JS
|
|
88
|
+
* engine. Its `subtle` is read across the export shapes the package exposes
|
|
89
|
+
* (`subtle`, `webcrypto.subtle`, and the same under `default`).
|
|
90
|
+
*
|
|
91
|
+
* Preferring the global first means tests transparently use Node's crypto and
|
|
92
|
+
* the lazy `require` is only reached on device (where Hermes has no global
|
|
93
|
+
* subtle and Metro has bundled the native module) — no runtime sniffing needed.
|
|
94
|
+
*
|
|
95
|
+
* Returns `null` (uncached) when neither resolves; callers throw
|
|
96
|
+
* {@link SmileIDCryptoError}. There is intentionally **no pure-JS PBKDF2/HMAC
|
|
97
|
+
* fallback**: a pure-JS 200_000-iteration PBKDF2 takes 40–80 s on device and,
|
|
98
|
+
* being silent, presents as "slow network".
|
|
99
|
+
*/
|
|
100
|
+
function resolveSubtle(): SubtleLike | null {
|
|
101
|
+
if (cachedSubtle) return cachedSubtle;
|
|
102
|
+
|
|
103
|
+
const globalSubtle = (globalThis as { crypto?: { subtle?: SubtleLike } })
|
|
104
|
+
.crypto?.subtle;
|
|
105
|
+
if (globalSubtle) {
|
|
106
|
+
cachedSubtle = globalSubtle;
|
|
107
|
+
return cachedSubtle;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
const moduleExports = require("react-native-quick-crypto") as {
|
|
112
|
+
subtle?: SubtleLike;
|
|
113
|
+
webcrypto?: { subtle?: SubtleLike };
|
|
114
|
+
default?: { subtle?: SubtleLike; webcrypto?: { subtle?: SubtleLike } };
|
|
115
|
+
};
|
|
116
|
+
const nativeSubtle =
|
|
117
|
+
moduleExports.subtle ??
|
|
118
|
+
moduleExports.webcrypto?.subtle ??
|
|
119
|
+
moduleExports.default?.subtle ??
|
|
120
|
+
moduleExports.default?.webcrypto?.subtle;
|
|
121
|
+
if (nativeSubtle) {
|
|
122
|
+
cachedSubtle = nativeSubtle;
|
|
123
|
+
return cachedSubtle;
|
|
124
|
+
}
|
|
125
|
+
} catch {
|
|
126
|
+
// Module not installed / not linked.
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Not found — intentionally uncached so a later polyfill / install() resolves.
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function requireSubtle(): SubtleLike {
|
|
134
|
+
const subtle = resolveSubtle();
|
|
135
|
+
if (!subtle) {
|
|
136
|
+
throw new SmileIDCryptoError(
|
|
137
|
+
"No Web Crypto provider available for request signing. Install the " +
|
|
138
|
+
"`react-native-quick-crypto` peer dependency (with its peers " +
|
|
139
|
+
"`react-native-nitro-modules` and `react-native-quick-base64`), or " +
|
|
140
|
+
"expose a global `crypto.subtle`.",
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
return subtle;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The exact bytes of [bytes] as a standalone `ArrayBuffer`. Reading `.buffer`
|
|
148
|
+
* directly is wrong when the view covers only part of a larger buffer (a
|
|
149
|
+
* `subarray` / `slice`), which would feed the surrounding bytes into PBKDF2/HMAC.
|
|
150
|
+
*/
|
|
151
|
+
function exactBuffer(bytes: Uint8Array): ArrayBuffer {
|
|
152
|
+
return bytes.buffer.slice(
|
|
153
|
+
bytes.byteOffset,
|
|
154
|
+
bytes.byteOffset + bytes.byteLength,
|
|
155
|
+
) as ArrayBuffer;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Low-level signing primitives: PBKDF2 key derivation and HMAC-SHA256. Stateless
|
|
160
|
+
* and deterministic, so the server reproduces the same key and MAC from the same
|
|
161
|
+
* inputs. Backed by the native Web Crypto provider resolved above.
|
|
162
|
+
*/
|
|
163
|
+
export const SigningCrypto = {
|
|
164
|
+
/**
|
|
165
|
+
* Derives a 32-byte key from [secret] and [salt] with PBKDF2-HMAC-SHA256.
|
|
166
|
+
*
|
|
167
|
+
* @throws {SmileIDCryptoError} if no provider is available or derivation fails.
|
|
168
|
+
*/
|
|
169
|
+
async deriveKey(secret: string, salt: Uint8Array): Promise<Uint8Array> {
|
|
170
|
+
const subtle = requireSubtle();
|
|
171
|
+
try {
|
|
172
|
+
const keyMaterial = await subtle.importKey(
|
|
173
|
+
"raw",
|
|
174
|
+
exactBuffer(utf8Bytes(secret)),
|
|
175
|
+
"PBKDF2",
|
|
176
|
+
false,
|
|
177
|
+
["deriveBits"],
|
|
178
|
+
);
|
|
179
|
+
const bits = await subtle.deriveBits(
|
|
180
|
+
{
|
|
181
|
+
name: "PBKDF2",
|
|
182
|
+
salt: exactBuffer(salt),
|
|
183
|
+
iterations: ITERATIONS,
|
|
184
|
+
hash: "SHA-256",
|
|
185
|
+
},
|
|
186
|
+
keyMaterial,
|
|
187
|
+
KEY_LENGTH_BYTES * 8,
|
|
188
|
+
);
|
|
189
|
+
return new Uint8Array(bits);
|
|
190
|
+
} catch (cause) {
|
|
191
|
+
if (cause instanceof SmileIDCryptoError) throw cause;
|
|
192
|
+
throw new SmileIDCryptoError(`Key derivation failed: ${String(cause)}`);
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Computes HMAC-SHA256 of [data] under [key].
|
|
198
|
+
*
|
|
199
|
+
* @throws {SmileIDCryptoError} if no provider is available or the MAC cannot
|
|
200
|
+
* be computed.
|
|
201
|
+
*/
|
|
202
|
+
async hmacSha256(key: Uint8Array, data: Uint8Array): Promise<Uint8Array> {
|
|
203
|
+
const subtle = requireSubtle();
|
|
204
|
+
try {
|
|
205
|
+
const cryptoKey = await subtle.importKey(
|
|
206
|
+
"raw",
|
|
207
|
+
exactBuffer(key),
|
|
208
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
209
|
+
false,
|
|
210
|
+
["sign"],
|
|
211
|
+
);
|
|
212
|
+
const digest = await subtle.sign("HMAC", cryptoKey, exactBuffer(data));
|
|
213
|
+
return new Uint8Array(digest);
|
|
214
|
+
} catch (cause) {
|
|
215
|
+
if (cause instanceof SmileIDCryptoError) throw cause;
|
|
216
|
+
throw new SmileIDCryptoError(`MAC computation failed: ${String(cause)}`);
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown by {@link SmileIDCryptoManager} and its supporting crypto
|
|
3
|
+
* routines.
|
|
4
|
+
*
|
|
5
|
+
* Typed so call sites can catch a key-derivation / MAC-computation failure
|
|
6
|
+
* (environment problem) intentionally rather than catching everything.
|
|
7
|
+
*/
|
|
8
|
+
export class SmileIDCryptoError extends Error {
|
|
9
|
+
constructor(message = "SmileID request signing failed") {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = "SmileIDCryptoError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { RequestCanonicalizer } from "./request_canonicalizer";
|
|
2
|
+
import { base64Encode, SigningCrypto, utf8Bytes } from "./signing_crypto";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Signs outbound requests so the Smile ID server can prove the bytes it
|
|
6
|
+
* receives were produced by a genuine SDK install.
|
|
7
|
+
*
|
|
8
|
+
* The request is reduced to a canonical payload ({@link RequestCanonicalizer}),
|
|
9
|
+
* the signing key is PBKDF2-derived from the Arkana secret salted with the
|
|
10
|
+
* payload length and request timestamp, and the payload is HMAC-SHA256'd
|
|
11
|
+
* ({@link SigningCrypto}). The Base64 result is the `smileid-request-mac` value.
|
|
12
|
+
*
|
|
13
|
+
* Constructed by the networking factory with the Arkana signing secret
|
|
14
|
+
* (obtained from the bridge) and injected into `SmileRequestMacInterceptor`.
|
|
15
|
+
* Construct directly only in tests, passing a known secret.
|
|
16
|
+
*/
|
|
17
|
+
export class SmileIDCryptoManager {
|
|
18
|
+
private readonly _signingSecret: string;
|
|
19
|
+
|
|
20
|
+
constructor(signingSecret: string) {
|
|
21
|
+
this._signingSecret = signingSecret;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Signs a request's `smileid-*` headers and body.
|
|
26
|
+
*
|
|
27
|
+
* @param timestamp the value of the `smileid-request-timestamp` header,
|
|
28
|
+
* reused here so the salt matches the header the server reads.
|
|
29
|
+
* @param headers the full request headers; only those prefixed `smileid-`
|
|
30
|
+
* (case-insensitive) are signed.
|
|
31
|
+
* @param body the request body, canonicalised before signing.
|
|
32
|
+
* @returns the Base64-encoded HMAC.
|
|
33
|
+
* @throws {SmileIDCryptoError} if key derivation or MAC computation fails.
|
|
34
|
+
*/
|
|
35
|
+
async sign(
|
|
36
|
+
timestamp: string,
|
|
37
|
+
headers: Record<string, string>,
|
|
38
|
+
body: unknown,
|
|
39
|
+
): Promise<string> {
|
|
40
|
+
const payload = await RequestCanonicalizer.canonicalize(headers, body);
|
|
41
|
+
const salt = utf8Bytes(`${payload.length}${timestamp}`);
|
|
42
|
+
const key = await SigningCrypto.deriveKey(this._signingSecret, salt);
|
|
43
|
+
const mac = await SigningCrypto.hmacSha256(key, payload);
|
|
44
|
+
return base64Encode(mac);
|
|
45
|
+
}
|
|
46
|
+
}
|