@smileid/usesmileid 12.0.0 → 12.0.2
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 +8 -0
- package/README.md +1 -1
- package/dist/camera/camera_defaults.d.ts +2 -0
- package/dist/camera/camera_defaults.d.ts.map +1 -1
- package/dist/camera/camera_defaults.js +2 -0
- package/dist/camera/camera_defaults.js.map +1 -1
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.d.ts +11 -0
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.d.ts.map +1 -0
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.js +17 -0
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.js.map +1 -0
- package/dist/core/exception/capture_validation_exceptions.d.ts +1 -0
- package/dist/core/exception/capture_validation_exceptions.d.ts.map +1 -1
- package/dist/core/exception/capture_validation_exceptions.js +1 -0
- package/dist/core/exception/capture_validation_exceptions.js.map +1 -1
- package/dist/core/exception/flow_exceptions.d.ts +4 -2
- package/dist/core/exception/flow_exceptions.d.ts.map +1 -1
- package/dist/core/exception/flow_exceptions.js +3 -2
- package/dist/core/exception/flow_exceptions.js.map +1 -1
- package/dist/core/exception/index.d.ts +1 -0
- package/dist/core/exception/index.d.ts.map +1 -1
- package/dist/core/exception/index.js +1 -0
- package/dist/core/exception/index.js.map +1 -1
- package/dist/core/exception/missing_job_type_exception.d.ts +1 -3
- package/dist/core/exception/missing_job_type_exception.d.ts.map +1 -1
- package/dist/core/exception/missing_job_type_exception.js +2 -4
- package/dist/core/exception/missing_job_type_exception.js.map +1 -1
- package/dist/core/exception/use_smile_id_error_code.d.ts +1 -0
- package/dist/core/exception/use_smile_id_error_code.d.ts.map +1 -1
- package/dist/core/exception/use_smile_id_error_code.js +1 -0
- package/dist/core/exception/use_smile_id_error_code.js.map +1 -1
- package/dist/core/models/config.d.ts +19 -0
- package/dist/core/models/config.d.ts.map +1 -1
- package/dist/core/models/document_type.d.ts +1 -1
- package/dist/core/models/document_type.d.ts.map +1 -1
- package/dist/core/models/document_type.js +2 -2
- package/dist/core/models/document_type.js.map +1 -1
- package/dist/core/models/global_privacy_control.d.ts +36 -0
- package/dist/core/models/global_privacy_control.d.ts.map +1 -0
- package/dist/core/models/global_privacy_control.js +39 -0
- package/dist/core/models/global_privacy_control.js.map +1 -0
- package/dist/core/models/network_config.d.ts +2 -2
- package/dist/core/models/network_config.js +2 -2
- package/dist/data/api/interceptors/smile_auth_interceptor.d.ts.map +1 -1
- package/dist/data/api/interceptors/smile_auth_interceptor.js +3 -17
- package/dist/data/api/interceptors/smile_auth_interceptor.js.map +1 -1
- package/dist/data/api/smile_id_api.d.ts +5 -1
- package/dist/data/api/smile_id_api.d.ts.map +1 -1
- package/dist/data/api/smile_id_api.js +30 -27
- package/dist/data/api/smile_id_api.js.map +1 -1
- package/dist/data/dsl/builder/retry_config_builder.d.ts +4 -4
- package/dist/data/dsl/builder/retry_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/retry_config_builder.js +6 -6
- package/dist/data/dsl/builder/retry_config_builder.js.map +1 -1
- package/dist/data/model/job_request.d.ts +28 -12
- package/dist/data/model/job_request.d.ts.map +1 -1
- package/dist/data/model/token_payload.d.ts +78 -0
- package/dist/data/model/token_payload.d.ts.map +1 -0
- package/dist/data/model/token_payload.js +132 -0
- package/dist/data/model/token_payload.js.map +1 -0
- package/dist/data/model/user_details_payload.d.ts +39 -0
- package/dist/data/model/user_details_payload.d.ts.map +1 -0
- package/dist/data/model/user_details_payload.js +53 -0
- package/dist/data/model/user_details_payload.js.map +1 -0
- package/dist/data/smile_id_urls.d.ts +1 -1
- package/dist/data/smile_id_urls.js +1 -1
- package/dist/data/smile_id_urls.js.map +1 -1
- package/dist/data/util/retry_util.d.ts +1 -1
- package/dist/data/util/retry_util.d.ts.map +1 -1
- package/dist/data/util/retry_util.js +5 -0
- package/dist/data/util/retry_util.js.map +1 -1
- package/dist/data/util/use_smile_id_token_decoder.d.ts +15 -3
- package/dist/data/util/use_smile_id_token_decoder.d.ts.map +1 -1
- package/dist/data/util/use_smile_id_token_decoder.js +20 -8
- package/dist/data/util/use_smile_id_token_decoder.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/l10n/strings_en.d.ts +4 -1
- package/dist/l10n/strings_en.d.ts.map +1 -1
- package/dist/l10n/strings_en.js +4 -1
- package/dist/l10n/strings_en.js.map +1 -1
- package/dist/l10n/use_smile_id_localizations.d.ts +10 -0
- package/dist/l10n/use_smile_id_localizations.d.ts.map +1 -1
- package/dist/l10n/use_smile_id_localizations.js +59 -3
- package/dist/l10n/use_smile_id_localizations.js.map +1 -1
- package/dist/metadata/builder_configuration.d.ts +5 -0
- package/dist/metadata/builder_configuration.d.ts.map +1 -1
- package/dist/metadata/builder_configuration.js +1 -0
- package/dist/metadata/builder_configuration.js.map +1 -1
- package/dist/metadata/metadata_configuration_mappers.d.ts +2 -3
- package/dist/metadata/metadata_configuration_mappers.d.ts.map +1 -1
- package/dist/metadata/metadata_configuration_mappers.js +13 -6
- package/dist/metadata/metadata_configuration_mappers.js.map +1 -1
- package/dist/metadata/use_smile_id_metadata_factory.d.ts.map +1 -1
- package/dist/metadata/use_smile_id_metadata_factory.js +14 -5
- package/dist/metadata/use_smile_id_metadata_factory.js.map +1 -1
- package/dist/presentation/components/use_smile_id_button.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_button.js +8 -2
- package/dist/presentation/components/use_smile_id_button.js.map +1 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts +5 -2
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js +8 -3
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js.map +1 -1
- package/dist/presentation/components/use_smile_id_instructions_hero.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_instructions_hero.js +8 -3
- package/dist/presentation/components/use_smile_id_instructions_hero.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts +16 -0
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/config_builder.js +18 -0
- package/dist/presentation/flow/dsl/builder/config_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts +6 -12
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.js +7 -12
- package/dist/presentation/flow/dsl/builder/screens_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js +23 -1
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js.map +1 -1
- package/dist/presentation/flow/flow_navigation_manager.d.ts +22 -3
- package/dist/presentation/flow/flow_navigation_manager.d.ts.map +1 -1
- package/dist/presentation/flow/flow_navigation_manager.js +84 -46
- package/dist/presentation/flow/flow_navigation_manager.js.map +1 -1
- package/dist/presentation/flow/model/instructions_defaults.d.ts.map +1 -1
- package/dist/presentation/flow/model/instructions_defaults.js +1 -1
- package/dist/presentation/flow/model/instructions_defaults.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_capture_screen.d.ts.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_capture_screen.js +13 -3
- package/dist/presentation/flow/screen/orchestrated_capture_screen.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_consent_screen.d.ts.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_consent_screen.js +3 -1
- package/dist/presentation/flow/screen/orchestrated_consent_screen.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_preview_screen.d.ts.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js +0 -8
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_processing_screen.d.ts.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_processing_screen.js +25 -5
- package/dist/presentation/flow/screen/orchestrated_processing_screen.js.map +1 -1
- package/dist/presentation/flow/use_smile_id_flow.d.ts.map +1 -1
- package/dist/presentation/flow/use_smile_id_flow.js +45 -12
- package/dist/presentation/flow/use_smile_id_flow.js.map +1 -1
- package/dist/presentation/flow/validation/flow_validator.d.ts +16 -2
- package/dist/presentation/flow/validation/flow_validator.d.ts.map +1 -1
- package/dist/presentation/flow/validation/flow_validator.js +61 -47
- package/dist/presentation/flow/validation/flow_validator.js.map +1 -1
- package/dist/presentation/flow/validation/job_type_validator.d.ts +7 -0
- package/dist/presentation/flow/validation/job_type_validator.d.ts.map +1 -1
- package/dist/presentation/flow/validation/job_type_validator.js +52 -27
- package/dist/presentation/flow/validation/job_type_validator.js.map +1 -1
- package/dist/presentation/flow/validation/user_details_validator.d.ts +9 -0
- package/dist/presentation/flow/validation/user_details_validator.d.ts.map +1 -0
- package/dist/presentation/flow/validation/user_details_validator.js +40 -0
- package/dist/presentation/flow/validation/user_details_validator.js.map +1 -0
- package/dist/presentation/screen/helpers/capture_screen_helpers.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/capture_screen_helpers.js +1 -0
- package/dist/presentation/screen/helpers/capture_screen_helpers.js.map +1 -1
- package/dist/presentation/screen/helpers/capture_ui_state.d.ts +6 -6
- package/dist/presentation/screen/helpers/capture_ui_state.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/capture_ui_state.js +19 -19
- package/dist/presentation/screen/helpers/capture_ui_state.js.map +1 -1
- package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts +2 -2
- package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/ess_turn_haptics.js +6 -6
- package/dist/presentation/screen/helpers/ess_turn_haptics.js.map +1 -1
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts +5 -5
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js +11 -11
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js.map +1 -1
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts +13 -3
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.js +48 -6
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts +4 -2
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.js +90 -23
- package/dist/presentation/screen/use_smile_id_capture_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_consent_screen.d.ts +7 -0
- package/dist/presentation/screen/use_smile_id_consent_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_consent_screen.js +6 -5
- package/dist/presentation/screen/use_smile_id_consent_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_document_back_instructions.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_document_back_instructions.js +5 -13
- package/dist/presentation/screen/use_smile_id_document_back_instructions.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js +1 -1
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts +1 -21
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.js +3 -14
- package/dist/presentation/screen/use_smile_id_preview_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.js +1 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.js.map +1 -1
- package/dist/presentation/utils/locale_utils.d.ts +10 -4
- package/dist/presentation/utils/locale_utils.d.ts.map +1 -1
- package/dist/presentation/utils/locale_utils.js +13 -5
- package/dist/presentation/utils/locale_utils.js.map +1 -1
- package/dist/testing/fake_face_analyzer.d.ts +43 -0
- package/dist/testing/fake_face_analyzer.d.ts.map +1 -0
- package/dist/testing/fake_face_analyzer.js +52 -0
- package/dist/testing/fake_face_analyzer.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +7 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/scenario_expectations.d.ts +28 -0
- package/dist/testing/scenario_expectations.d.ts.map +1 -0
- package/dist/testing/scenario_expectations.js +65 -0
- package/dist/testing/scenario_expectations.js.map +1 -0
- package/dist/testing/scenario_loader.d.ts +11 -0
- package/dist/testing/scenario_loader.d.ts.map +1 -0
- package/dist/testing/scenario_loader.js +64 -0
- package/dist/testing/scenario_loader.js.map +1 -0
- package/dist/testing/scripted_scan_results.d.ts +17 -0
- package/dist/testing/scripted_scan_results.d.ts.map +1 -0
- package/dist/testing/scripted_scan_results.js +52 -0
- package/dist/testing/scripted_scan_results.js.map +1 -0
- package/package.json +11 -4
- package/src/__tests__/dsl.test.ts +51 -1
- package/src/__tests__/react_native_mock.tsx +22 -0
- package/src/__tests__/setup_react_native.ts +17 -2
- package/src/__tests__/snapshots/__snapshots__/screens_structural.test.tsx.snap +5267 -0
- package/src/__tests__/snapshots/screens_structural.test.tsx +230 -0
- package/src/camera/__tests__/camera_permissions.test.ts +72 -0
- package/src/camera/__tests__/camera_system_focus.test.ts +173 -0
- package/src/camera/__tests__/use_smile_id_camera_preview.test.tsx +461 -0
- package/src/camera/__tests__/use_smile_id_camera_system.test.ts +103 -0
- package/src/camera/__tests__/use_smile_id_frame_stream_hook.test.tsx +229 -0
- package/src/camera/camera_defaults.ts +3 -0
- package/src/core/exception/__tests__/builder_validation_exceptions.test.ts +81 -0
- package/src/core/exception/agent_mode_with_enhanced_liveness_exception.ts +20 -0
- package/src/core/exception/capture_validation_exceptions.ts +1 -0
- package/src/core/exception/flow_exceptions.test.ts +10 -0
- package/src/core/exception/flow_exceptions.ts +3 -2
- package/src/core/exception/index.ts +1 -0
- package/src/core/exception/missing_job_type_exception.ts +2 -4
- package/src/core/exception/use_smile_id_error_code.ts +1 -0
- package/src/core/models/__tests__/document_type.test.ts +2 -2
- package/src/core/models/__tests__/flow_models.test.ts +26 -0
- package/src/core/models/config.ts +22 -0
- package/src/core/models/document_type.ts +2 -2
- package/src/core/models/global_privacy_control.ts +45 -0
- package/src/core/models/network_config.ts +2 -2
- package/src/data/api/__tests__/smile_id_api.test.ts +275 -1
- package/src/data/api/interceptors/__tests__/credential_header_redaction.test.ts +144 -0
- package/src/data/api/interceptors/__tests__/gzip_interceptor.test.ts +83 -0
- package/src/data/api/interceptors/smile_auth_interceptor.ts +3 -18
- package/src/data/api/smile_id_api.ts +36 -49
- package/src/data/compression/__tests__/payload_compressor_real_jpeg.test.ts +6 -2
- package/src/data/dsl/__tests__/use_smile_id_network_builder.test.ts +157 -0
- package/src/data/dsl/builder/__tests__/config_builders.test.ts +62 -0
- package/src/data/dsl/builder/retry_config_builder.ts +6 -6
- package/src/data/factory/__tests__/retry_gzip_mac_composition.test.ts +163 -0
- package/src/data/factory/__tests__/signed_job_submission_headers.test.ts +1 -1
- package/src/data/model/__tests__/token_payload.test.ts +224 -0
- package/src/data/model/__tests__/user_details_payload.test.ts +100 -0
- package/src/data/model/job_request.ts +27 -12
- package/src/data/model/token_payload.ts +182 -0
- package/src/data/model/user_details_payload.ts +84 -0
- package/src/data/repository/__tests__/network_retries.test.ts +1 -1
- package/src/data/repository/__tests__/repository_dispatch.test.ts +366 -0
- package/src/data/repository/__tests__/use_smile_id_repository.test.ts +1 -1
- package/src/data/security/__tests__/request_canonicalizer.test.ts +132 -0
- package/src/data/security/__tests__/signing_crypto.test.ts +203 -0
- package/src/data/smile_id_urls.ts +1 -1
- package/src/data/util/__tests__/retry_util.test.ts +25 -0
- package/src/data/util/__tests__/use_smile_id_token_decoder.test.ts +179 -0
- package/src/data/util/retry_util.ts +9 -1
- package/src/data/util/use_smile_id_token_decoder.ts +29 -8
- package/src/index.ts +6 -4
- package/src/l10n/__tests__/use_smile_id_localizations.test.ts +122 -5
- package/src/l10n/__tests__/use_smile_id_localizations_provider.test.tsx +112 -0
- package/src/l10n/__tests__/use_smile_id_localizations_surface.test.ts +231 -0
- package/src/l10n/strings_en.ts +5 -1
- package/src/l10n/use_smile_id_localizations.ts +80 -3
- package/src/metadata/__tests__/device_orientation_sampling.test.ts +165 -0
- package/src/metadata/__tests__/geolocation.test.ts +150 -0
- package/src/metadata/__tests__/metadata_configuration_mappers.test.ts +39 -0
- package/src/metadata/__tests__/metadata_configuration_objects.test.ts +2 -1
- package/src/metadata/__tests__/metadata_device_context.test.ts +3 -3
- package/src/metadata/__tests__/metadata_device_os_android.test.ts +18 -0
- package/src/metadata/__tests__/metadata_golden_fixture.json +1 -1
- package/src/metadata/__tests__/metadata_payload_golden.test.ts +4 -4
- package/src/metadata/__tests__/optional_native_modules.test.ts +234 -0
- package/src/metadata/__tests__/use_smile_id_metadata.test.ts +1 -1
- package/src/metadata/__tests__/use_smile_id_metadata_factory.test.ts +615 -0
- package/src/metadata/builder_configuration.ts +6 -0
- package/src/metadata/metadata_configuration_mappers.ts +21 -7
- package/src/metadata/use_smile_id_metadata_factory.ts +17 -6
- package/src/presentation/assets/si_document_green_book_hero_animation.json +1 -4668
- package/src/presentation/assets/si_document_hero_animation.json +1 -4799
- package/src/presentation/assets/si_document_hero_back_animation.json +1 -2039
- package/src/presentation/assets/si_document_passport_hero_animation.json +1 -14491
- package/src/presentation/assets/si_ess_all_directions_hero_animation.json +1 -0
- package/src/presentation/assets/si_ess_animation_all_directions.json +1 -6589
- package/src/presentation/assets/si_selfie_hero_animation.json +1 -1439
- package/src/presentation/assets/si_smile_to_capture_animation.json +1 -1439
- package/src/presentation/components/__tests__/use_smile_id_content_card.test.tsx +112 -0
- package/src/presentation/components/__tests__/use_smile_id_enhanced_smart_selfie_clip.test.tsx +9 -4
- package/src/presentation/components/__tests__/use_smile_id_face_oval_image.test.tsx +190 -0
- package/src/presentation/components/__tests__/use_smile_id_instructions_hero.test.tsx +44 -0
- package/src/presentation/components/__tests__/use_smile_id_learn_more_content.test.tsx +159 -0
- package/src/presentation/components/__tests__/use_smile_id_processing_center_indicator.test.tsx +88 -0
- package/src/presentation/components/use_smile_id_button.tsx +7 -2
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_clip.tsx +9 -3
- package/src/presentation/components/use_smile_id_instructions_hero.tsx +10 -0
- package/src/presentation/flow/__tests__/document_flow_navigation.test.ts +3 -3
- package/src/presentation/flow/__tests__/flow_navigation_manager.test.ts +372 -1
- package/src/presentation/flow/__tests__/use_smile_id_flow.test.tsx +651 -0
- package/src/presentation/flow/dsl/__tests__/use_smile_id_builder_component.test.tsx +120 -0
- package/src/presentation/flow/dsl/builder/__tests__/config_builder.test.ts +25 -0
- package/src/presentation/flow/dsl/builder/config_builder.ts +21 -0
- package/src/presentation/flow/dsl/builder/screens_builder.ts +7 -12
- package/src/presentation/flow/dsl/use_smile_id_flow_builder.ts +27 -1
- package/src/presentation/flow/flow_navigation_manager.ts +108 -93
- package/src/presentation/flow/graph/__tests__/screen_renderer.test.tsx +102 -0
- package/src/presentation/flow/model/instructions_defaults.ts +1 -1
- package/src/presentation/flow/screen/__tests__/orchestrated_capture_screen.test.tsx +836 -0
- package/src/presentation/flow/screen/__tests__/orchestrated_consent_screen.test.tsx +165 -0
- package/src/presentation/flow/screen/__tests__/orchestrated_instructions_screen.test.tsx +163 -0
- package/src/presentation/flow/screen/__tests__/orchestrated_preview_screen.test.tsx +224 -0
- package/src/presentation/flow/screen/__tests__/orchestrated_processing_screen.test.tsx +338 -0
- package/src/presentation/flow/screen/orchestrated_capture_screen.tsx +18 -3
- package/src/presentation/flow/screen/orchestrated_consent_screen.tsx +5 -0
- package/src/presentation/flow/screen/orchestrated_preview_screen.tsx +0 -12
- package/src/presentation/flow/screen/orchestrated_processing_screen.tsx +42 -5
- package/src/presentation/flow/use_smile_id_flow.tsx +63 -12
- package/src/presentation/flow/validation/__tests__/flow_validator.test.ts +219 -1
- package/src/presentation/flow/validation/__tests__/job_type_validator.test.ts +200 -0
- package/src/presentation/flow/validation/flow_validator.ts +85 -57
- package/src/presentation/flow/validation/job_type_validator.ts +73 -39
- package/src/presentation/flow/validation/user_details_validator.ts +53 -0
- package/src/presentation/screen/__tests__/capture_ui_state.test.ts +66 -47
- package/src/presentation/screen/__tests__/ess_turn_haptics.test.ts +15 -11
- package/src/presentation/screen/__tests__/feedback_copy_table.test.ts +145 -0
- package/src/presentation/screen/__tests__/scan_state_to_overlay_state.test.ts +47 -27
- package/src/presentation/screen/__tests__/use_smile_id_capture_screen.test.tsx +524 -14
- package/src/presentation/screen/__tests__/use_smile_id_document_back_instructions.test.tsx +4 -2
- package/src/presentation/screen/__tests__/use_smile_id_permission_screen.test.tsx +68 -0
- package/src/presentation/screen/__tests__/use_smile_id_preview_screen.test.tsx +10 -40
- package/src/presentation/screen/helpers/__tests__/use_capture_orientation_lock.test.tsx +212 -0
- package/src/presentation/screen/helpers/capture_screen_helpers.ts +1 -0
- package/src/presentation/screen/helpers/capture_ui_state.ts +27 -27
- package/src/presentation/screen/helpers/ess_turn_haptics.ts +9 -9
- package/src/presentation/screen/helpers/scan_state_to_overlay_state.ts +13 -13
- package/src/presentation/screen/helpers/use_capture_orientation_lock.ts +69 -7
- package/src/presentation/screen/use_smile_id_capture_screen.tsx +107 -28
- package/src/presentation/screen/use_smile_id_consent_screen.tsx +16 -5
- package/src/presentation/screen/use_smile_id_document_back_instructions.tsx +14 -23
- package/src/presentation/screen/use_smile_id_document_preview_screen.tsx +1 -1
- package/src/presentation/screen/use_smile_id_preview_screen.tsx +13 -45
- package/src/presentation/screen/use_smile_id_processing_screen.tsx +1 -1
- package/src/presentation/theme/__tests__/use_use_smile_id_fonts.test.tsx +166 -0
- package/src/presentation/utils/__tests__/locale_utils.test.ts +46 -5
- package/src/presentation/utils/locale_utils.ts +13 -4
- package/src/testing/__tests__/fake_face_analyzer.test.ts +42 -0
- package/src/testing/__tests__/scenario_expectations.test.ts +110 -0
- package/src/testing/__tests__/scenario_loader.test.ts +64 -0
- package/src/testing/fake_face_analyzer.ts +82 -0
- package/src/testing/index.ts +15 -0
- package/src/testing/scenario_expectations.ts +87 -0
- package/src/testing/scenario_loader.ts +83 -0
- package/src/testing/scripted_scan_results.ts +66 -0
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.d.ts +0 -15
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.js +0 -19
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.js.map +0 -1
- package/src/presentation/components/use_smile_id_face_silhouette_overlay.tsx +0 -27
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
// `vi.mock` is hoisted above the imports, so anything its factory closes over
|
|
4
|
+
// must be created with `vi.hoisted` or it is still in the TDZ when the factory
|
|
5
|
+
// runs.
|
|
6
|
+
const { loadExpoSensors } = vi.hoisted(() => ({ loadExpoSensors: vi.fn() }));
|
|
7
|
+
|
|
8
|
+
vi.mock("../optional_native_modules", () => ({ loadExpoSensors }));
|
|
9
|
+
|
|
10
|
+
import { DeviceOrientationCollector } from "../device_orientation_collector";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Sampling behaviour of the accelerometer collector: the ~15 Hz throttle,
|
|
14
|
+
* the 90 s session cap, the movement-span computation, and the graceful
|
|
15
|
+
* no-op when `expo-sensors` is absent. The empty-session contract is pinned
|
|
16
|
+
* separately in `device_orientation_collector.test.ts`.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
type Sample = { x: number; y: number; z: number };
|
|
20
|
+
|
|
21
|
+
function makeSensors() {
|
|
22
|
+
const listeners: Array<(data: Sample) => void> = [];
|
|
23
|
+
const remove = vi.fn(() => {
|
|
24
|
+
listeners.length = 0;
|
|
25
|
+
});
|
|
26
|
+
const setUpdateInterval = vi.fn();
|
|
27
|
+
const addListener = vi.fn((listener: (data: Sample) => void) => {
|
|
28
|
+
listeners.push(listener);
|
|
29
|
+
return { remove };
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
module: { Accelerometer: { setUpdateInterval, addListener } },
|
|
33
|
+
emit: (sample: Sample) => {
|
|
34
|
+
for (const listener of [...listeners]) listener(sample);
|
|
35
|
+
},
|
|
36
|
+
setUpdateInterval,
|
|
37
|
+
addListener,
|
|
38
|
+
remove,
|
|
39
|
+
listenerCount: () => listeners.length,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
describe("DeviceOrientationCollector — sampling", () => {
|
|
44
|
+
beforeEach(() => {
|
|
45
|
+
vi.useFakeTimers();
|
|
46
|
+
vi.setSystemTime(new Date("2026-07-30T00:00:00.000Z"));
|
|
47
|
+
loadExpoSensors.mockReset();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
afterEach(() => {
|
|
51
|
+
vi.useRealTimers();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("subscribes at the ~15 Hz sampling interval on start", () => {
|
|
55
|
+
const sensors = makeSensors();
|
|
56
|
+
loadExpoSensors.mockReturnValue(sensors.module);
|
|
57
|
+
|
|
58
|
+
new DeviceOrientationCollector().start();
|
|
59
|
+
|
|
60
|
+
expect(sensors.setUpdateInterval).toHaveBeenCalledWith(66);
|
|
61
|
+
expect(sensors.addListener).toHaveBeenCalledTimes(1);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("records epoch-stamped samples and the movement span", () => {
|
|
65
|
+
const sensors = makeSensors();
|
|
66
|
+
loadExpoSensors.mockReturnValue(sensors.module);
|
|
67
|
+
const collector = new DeviceOrientationCollector();
|
|
68
|
+
collector.start();
|
|
69
|
+
|
|
70
|
+
const firstStamp = Date.now();
|
|
71
|
+
sensors.emit({ x: 0, y: 0, z: 1 });
|
|
72
|
+
vi.advanceTimersByTime(100);
|
|
73
|
+
const secondStamp = Date.now();
|
|
74
|
+
sensors.emit({ x: 0, y: 0, z: 2 });
|
|
75
|
+
|
|
76
|
+
expect(collector.devicePositions).toEqual([
|
|
77
|
+
`${firstStamp},0,0,1`,
|
|
78
|
+
`${secondStamp},0,0,2`,
|
|
79
|
+
]);
|
|
80
|
+
// |1 − 0.981| = 0.019 and |2 − 0.981| = 1.019 → span 1.
|
|
81
|
+
expect(collector.deviceMovementDetected).toBeCloseTo(1, 10);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("throttles samples arriving faster than the interval", () => {
|
|
85
|
+
const sensors = makeSensors();
|
|
86
|
+
loadExpoSensors.mockReturnValue(sensors.module);
|
|
87
|
+
const collector = new DeviceOrientationCollector();
|
|
88
|
+
collector.start();
|
|
89
|
+
|
|
90
|
+
sensors.emit({ x: 1, y: 0, z: 0 });
|
|
91
|
+
vi.advanceTimersByTime(10);
|
|
92
|
+
sensors.emit({ x: 2, y: 0, z: 0 });
|
|
93
|
+
vi.advanceTimersByTime(10);
|
|
94
|
+
sensors.emit({ x: 3, y: 0, z: 0 });
|
|
95
|
+
|
|
96
|
+
expect(collector.devicePositions).toHaveLength(1);
|
|
97
|
+
expect(collector.devicePositions[0]).toContain(",1,0,0");
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("stops sampling once the 90 s session cap is exceeded", () => {
|
|
101
|
+
const sensors = makeSensors();
|
|
102
|
+
loadExpoSensors.mockReturnValue(sensors.module);
|
|
103
|
+
const collector = new DeviceOrientationCollector();
|
|
104
|
+
collector.start();
|
|
105
|
+
|
|
106
|
+
sensors.emit({ x: 0, y: 0, z: 1 });
|
|
107
|
+
vi.advanceTimersByTime(90 * 1000 + 1);
|
|
108
|
+
sensors.emit({ x: 0, y: 0, z: 9 });
|
|
109
|
+
|
|
110
|
+
expect(collector.devicePositions).toHaveLength(1);
|
|
111
|
+
expect(sensors.remove).toHaveBeenCalledTimes(1);
|
|
112
|
+
expect(sensors.listenerCount()).toBe(0);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("start() is idempotent while a session is already running", () => {
|
|
116
|
+
const sensors = makeSensors();
|
|
117
|
+
loadExpoSensors.mockReturnValue(sensors.module);
|
|
118
|
+
const collector = new DeviceOrientationCollector();
|
|
119
|
+
|
|
120
|
+
collector.start();
|
|
121
|
+
collector.start();
|
|
122
|
+
|
|
123
|
+
expect(sensors.addListener).toHaveBeenCalledTimes(1);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it("stop() unsubscribes but preserves the collected data", () => {
|
|
127
|
+
const sensors = makeSensors();
|
|
128
|
+
loadExpoSensors.mockReturnValue(sensors.module);
|
|
129
|
+
const collector = new DeviceOrientationCollector();
|
|
130
|
+
collector.start();
|
|
131
|
+
sensors.emit({ x: 0, y: 0, z: 1 });
|
|
132
|
+
|
|
133
|
+
collector.stop();
|
|
134
|
+
|
|
135
|
+
expect(sensors.remove).toHaveBeenCalledTimes(1);
|
|
136
|
+
expect(collector.devicePositions).toHaveLength(1);
|
|
137
|
+
// A second stop on an already-stopped collector is harmless.
|
|
138
|
+
collector.stop();
|
|
139
|
+
expect(sensors.remove).toHaveBeenCalledTimes(1);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it("a restart clears the previous session's samples", () => {
|
|
143
|
+
const sensors = makeSensors();
|
|
144
|
+
loadExpoSensors.mockReturnValue(sensors.module);
|
|
145
|
+
const collector = new DeviceOrientationCollector();
|
|
146
|
+
collector.start();
|
|
147
|
+
sensors.emit({ x: 0, y: 0, z: 1 });
|
|
148
|
+
collector.stop();
|
|
149
|
+
|
|
150
|
+
collector.start();
|
|
151
|
+
expect(collector.devicePositions).toHaveLength(0);
|
|
152
|
+
expect(collector.deviceMovementDetected).toBeNull();
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it("no-ops when expo-sensors is not installed", () => {
|
|
156
|
+
loadExpoSensors.mockReturnValue(null);
|
|
157
|
+
const collector = new DeviceOrientationCollector();
|
|
158
|
+
|
|
159
|
+
collector.start();
|
|
160
|
+
collector.stop();
|
|
161
|
+
|
|
162
|
+
expect(collector.devicePositions).toHaveLength(0);
|
|
163
|
+
expect(collector.deviceMovementDetected).toBeNull();
|
|
164
|
+
});
|
|
165
|
+
});
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
// `vi.mock` is hoisted above the imports, so anything its factory closes over
|
|
4
|
+
// must be created with `vi.hoisted` or it is still in the TDZ when the factory
|
|
5
|
+
// runs.
|
|
6
|
+
const { loadExpoLocation } = vi.hoisted(() => ({
|
|
7
|
+
loadExpoLocation: vi.fn(),
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
vi.mock("../optional_native_modules", () => ({ loadExpoLocation }));
|
|
11
|
+
|
|
12
|
+
import { resolveGeolocation } from "../geolocation";
|
|
13
|
+
|
|
14
|
+
function makeLocationModule(overrides: {
|
|
15
|
+
granted?: boolean;
|
|
16
|
+
position?: {
|
|
17
|
+
coords: { latitude: number; longitude: number; accuracy: number | null };
|
|
18
|
+
} | null;
|
|
19
|
+
permissionsError?: Error;
|
|
20
|
+
positionError?: Error;
|
|
21
|
+
}) {
|
|
22
|
+
return {
|
|
23
|
+
getForegroundPermissionsAsync: vi.fn(async () => {
|
|
24
|
+
if (overrides.permissionsError) throw overrides.permissionsError;
|
|
25
|
+
return { granted: overrides.granted ?? true };
|
|
26
|
+
}),
|
|
27
|
+
getLastKnownPositionAsync: vi.fn(async () => {
|
|
28
|
+
if (overrides.positionError) throw overrides.positionError;
|
|
29
|
+
return overrides.position ?? null;
|
|
30
|
+
}),
|
|
31
|
+
requestForegroundPermissionsAsync: vi.fn(),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function position(accuracy: number | null) {
|
|
36
|
+
return { coords: { latitude: 6.5244, longitude: 3.3792, accuracy } };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
beforeEach(() => {
|
|
40
|
+
loadExpoLocation.mockReset();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe("resolveGeolocation", () => {
|
|
44
|
+
it("returns null when expo-location isn't installed", async () => {
|
|
45
|
+
loadExpoLocation.mockReturnValue(null);
|
|
46
|
+
|
|
47
|
+
await expect(resolveGeolocation()).resolves.toBeNull();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("never prompts — it only reads an already-granted permission", async () => {
|
|
51
|
+
const location = makeLocationModule({
|
|
52
|
+
granted: true,
|
|
53
|
+
position: position(5),
|
|
54
|
+
});
|
|
55
|
+
loadExpoLocation.mockReturnValue(location);
|
|
56
|
+
|
|
57
|
+
await resolveGeolocation();
|
|
58
|
+
|
|
59
|
+
expect(location.getForegroundPermissionsAsync).toHaveBeenCalledTimes(1);
|
|
60
|
+
expect(location.requestForegroundPermissionsAsync).not.toHaveBeenCalled();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("returns null and skips the location read when permission is absent", async () => {
|
|
64
|
+
const location = makeLocationModule({ granted: false });
|
|
65
|
+
loadExpoLocation.mockReturnValue(location);
|
|
66
|
+
|
|
67
|
+
await expect(resolveGeolocation()).resolves.toBeNull();
|
|
68
|
+
expect(location.getLastKnownPositionAsync).not.toHaveBeenCalled();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("returns null when there is no cached fix", async () => {
|
|
72
|
+
loadExpoLocation.mockReturnValue(
|
|
73
|
+
makeLocationModule({ granted: true, position: null }),
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
await expect(resolveGeolocation()).resolves.toBeNull();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("classifies a sub-20m fix as precise and tags the source as gps", async () => {
|
|
80
|
+
loadExpoLocation.mockReturnValue(
|
|
81
|
+
makeLocationModule({ granted: true, position: position(12) }),
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
await expect(resolveGeolocation()).resolves.toEqual({
|
|
85
|
+
latitude: 6.5244,
|
|
86
|
+
longitude: 3.3792,
|
|
87
|
+
accuracy: "precise",
|
|
88
|
+
source: "gps",
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("classifies a sub-100m fix as approximate", async () => {
|
|
93
|
+
loadExpoLocation.mockReturnValue(
|
|
94
|
+
makeLocationModule({ granted: true, position: position(45) }),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const result = await resolveGeolocation();
|
|
98
|
+
|
|
99
|
+
expect(result?.accuracy).toBe("approximate");
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("classifies a coarse fix as unknown rather than overstating precision", async () => {
|
|
103
|
+
loadExpoLocation.mockReturnValue(
|
|
104
|
+
makeLocationModule({ granted: true, position: position(250) }),
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
const result = await resolveGeolocation();
|
|
108
|
+
|
|
109
|
+
expect(result?.accuracy).toBe("unknown");
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("treats a missing accuracy reading as unknown", async () => {
|
|
113
|
+
loadExpoLocation.mockReturnValue(
|
|
114
|
+
makeLocationModule({ granted: true, position: position(null) }),
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const result = await resolveGeolocation();
|
|
118
|
+
|
|
119
|
+
expect(result?.accuracy).toBe("unknown");
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("treats a non-positive accuracy reading as unknown", async () => {
|
|
123
|
+
loadExpoLocation.mockReturnValue(
|
|
124
|
+
makeLocationModule({ granted: true, position: position(0) }),
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const result = await resolveGeolocation();
|
|
128
|
+
|
|
129
|
+
expect(result?.accuracy).toBe("unknown");
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it("swallows a throwing permission check so metadata collection never fails", async () => {
|
|
133
|
+
loadExpoLocation.mockReturnValue(
|
|
134
|
+
makeLocationModule({ permissionsError: new Error("location off") }),
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
await expect(resolveGeolocation()).resolves.toBeNull();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it("swallows a throwing location read", async () => {
|
|
141
|
+
loadExpoLocation.mockReturnValue(
|
|
142
|
+
makeLocationModule({
|
|
143
|
+
granted: true,
|
|
144
|
+
positionError: new Error("provider unavailable"),
|
|
145
|
+
}),
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
await expect(resolveGeolocation()).resolves.toBeNull();
|
|
149
|
+
});
|
|
150
|
+
});
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
ModelProvider,
|
|
13
13
|
MODEL_DESCRIPTOR_UNKNOWN,
|
|
14
14
|
} from "../model_configuration";
|
|
15
|
+
import { GlobalPrivacyControl } from "../../core/models/global_privacy_control";
|
|
15
16
|
import {
|
|
16
17
|
flowConfigurationToBuilderConfiguration,
|
|
17
18
|
flowConfigurationToModelConfiguration,
|
|
@@ -201,6 +202,21 @@ describe("flowConfigurationToSelfieLivenessTelemetry", () => {
|
|
|
201
202
|
expect(telemetry.activeLivenessType).toBe("head_pose");
|
|
202
203
|
});
|
|
203
204
|
|
|
205
|
+
it("reports back_camera in agent mode", () => {
|
|
206
|
+
const telemetry = flowConfigurationToSelfieLivenessTelemetry(
|
|
207
|
+
flow((screens) =>
|
|
208
|
+
screens.capture((capture) => {
|
|
209
|
+
capture.captureType = CaptureType.selfie;
|
|
210
|
+
capture.selfie((selfie) => {
|
|
211
|
+
selfie.allowAgentMode = true;
|
|
212
|
+
});
|
|
213
|
+
}),
|
|
214
|
+
),
|
|
215
|
+
);
|
|
216
|
+
expect(telemetry.selfieImageOrigin).toBe("back_camera");
|
|
217
|
+
expect(telemetry.activeLivenessType).toBe("smile");
|
|
218
|
+
});
|
|
219
|
+
|
|
204
220
|
it("is all-null for a document-only flow", () => {
|
|
205
221
|
const telemetry = flowConfigurationToSelfieLivenessTelemetry(
|
|
206
222
|
flow((screens) =>
|
|
@@ -212,4 +228,27 @@ describe("flowConfigurationToSelfieLivenessTelemetry", () => {
|
|
|
212
228
|
expect(telemetry.activeLivenessType).toBeNull();
|
|
213
229
|
expect(telemetry.selfieImageOrigin).toBeNull();
|
|
214
230
|
});
|
|
231
|
+
|
|
232
|
+
it("global privacy control lands in the configuration metadata", () => {
|
|
233
|
+
// Default posture: a snapshot without a config block reports the
|
|
234
|
+
// opt-out baseline.
|
|
235
|
+
expect(
|
|
236
|
+
flowConfigurationToBuilderConfiguration(flow(() => {}))
|
|
237
|
+
.globalPrivacyControl,
|
|
238
|
+
).toBe("opt-out");
|
|
239
|
+
|
|
240
|
+
// Explicit legacy posture flows through the config snapshot.
|
|
241
|
+
const optIn: FlowConfiguration = {
|
|
242
|
+
...flow(() => {}),
|
|
243
|
+
config: {
|
|
244
|
+
enableCrashReporting: true,
|
|
245
|
+
enableDebugMode: false,
|
|
246
|
+
allowOfflineMode: false,
|
|
247
|
+
globalPrivacyControl: GlobalPrivacyControl.OptIn,
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
expect(
|
|
251
|
+
flowConfigurationToBuilderConfiguration(optIn).globalPrivacyControl,
|
|
252
|
+
).toBe("opt-in");
|
|
253
|
+
});
|
|
215
254
|
});
|
|
@@ -25,6 +25,7 @@ const builderConfiguration: BuilderConfiguration = {
|
|
|
25
25
|
allowGalleryUpload: true,
|
|
26
26
|
captureBothSides: true,
|
|
27
27
|
allowSkipBack: false,
|
|
28
|
+
globalPrivacyControl: "opt-out",
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
const modelConfiguration: ModelConfiguration = {
|
|
@@ -37,7 +38,7 @@ const modelConfiguration: ModelConfiguration = {
|
|
|
37
38
|
documentModel: {
|
|
38
39
|
provider: ModelProvider.Smile,
|
|
39
40
|
name: "noop_document_detector",
|
|
40
|
-
version: "12.0.
|
|
41
|
+
version: "12.0.2",
|
|
41
42
|
bundled: true,
|
|
42
43
|
},
|
|
43
44
|
};
|
|
@@ -9,7 +9,7 @@ function fields(
|
|
|
9
9
|
overrides: Partial<UseSmileIDMetadataFields> = {},
|
|
10
10
|
): UseSmileIDMetadataFields {
|
|
11
11
|
return {
|
|
12
|
-
sdkVersion: "12.0.
|
|
12
|
+
sdkVersion: "12.0.2",
|
|
13
13
|
sdk: "react-native-expo",
|
|
14
14
|
deviceOs: "Android 14",
|
|
15
15
|
deviceModel: "",
|
|
@@ -89,10 +89,10 @@ describe("device-context keys (62-key parity)", () => {
|
|
|
89
89
|
it("emits wrapper identity when present and omits it when blank", () => {
|
|
90
90
|
const populated = fields({
|
|
91
91
|
wrapperName: "react_native_expo",
|
|
92
|
-
wrapperVersion: "12.0.
|
|
92
|
+
wrapperVersion: "12.0.2",
|
|
93
93
|
});
|
|
94
94
|
expect(value("wrapper_name", populated)).toBe("react_native_expo");
|
|
95
|
-
expect(value("wrapper_version", populated)).toBe("12.0.
|
|
95
|
+
expect(value("wrapper_version", populated)).toBe("12.0.2");
|
|
96
96
|
|
|
97
97
|
const names = new UseSmileIDMetadata(fields())
|
|
98
98
|
.toEntries()
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
vi.mock("react-native", () => ({
|
|
4
|
+
Platform: { OS: "android", Version: 31, constants: { Release: "12" } },
|
|
5
|
+
Dimensions: {
|
|
6
|
+
get: () => ({ width: 1080, height: 2400, scale: 3 }),
|
|
7
|
+
},
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
import { UseSmileIDMetadataFactory } from "../use_smile_id_metadata_factory";
|
|
11
|
+
|
|
12
|
+
describe("device_os on Android", () => {
|
|
13
|
+
it("reports the release version, not the API level", () => {
|
|
14
|
+
const factory = new UseSmileIDMetadataFactory();
|
|
15
|
+
|
|
16
|
+
expect(factory.make().toFields().deviceOs).toBe("Android 12");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Shared cross-SDK golden parity vectors. These metadata keys must serialise to the EXACT same wire value on Android, iOS, Flutter, and React Native for the standard fully-populated golden snapshot. Each SDK's metadata-payload golden test asserts its payload contains every entry below verbatim. Maintained manually — keep the four copies (android/ios/flutter/react-native-expo test dirs) in sync.",
|
|
3
3
|
"expected": {
|
|
4
|
-
"sdk_version": "12.0.
|
|
4
|
+
"sdk_version": "12.0.2",
|
|
5
5
|
"proxy": "true",
|
|
6
6
|
"proximity_sensor": "true",
|
|
7
7
|
"sdk_config_source": "sdk_config",
|
|
@@ -17,7 +17,7 @@ import goldenFixture from "./metadata_golden_fixture.json";
|
|
|
17
17
|
describe("metadata payload (golden, device-context fields)", () => {
|
|
18
18
|
function fullyPopulated(): UseSmileIDMetadataFields {
|
|
19
19
|
return {
|
|
20
|
-
sdkVersion: "12.0.
|
|
20
|
+
sdkVersion: "12.0.2",
|
|
21
21
|
sdk: "react-native-expo",
|
|
22
22
|
deviceOs: "Android 14",
|
|
23
23
|
deviceModel: "Google Pixel 8",
|
|
@@ -56,7 +56,7 @@ describe("metadata payload (golden, device-context fields)", () => {
|
|
|
56
56
|
vpn: false,
|
|
57
57
|
certificateDigest: ["AA:BB", "CC:DD"],
|
|
58
58
|
wrapperName: "react_native_expo",
|
|
59
|
-
wrapperVersion: "12.0.
|
|
59
|
+
wrapperVersion: "12.0.2",
|
|
60
60
|
sdkLaunchCount: 5,
|
|
61
61
|
geolocation: {
|
|
62
62
|
latitude: 1.5,
|
|
@@ -128,7 +128,7 @@ describe("metadata payload (golden, device-context fields)", () => {
|
|
|
128
128
|
|
|
129
129
|
it("emits scalar + meaningful-falsey + JSON-shaped values correctly", () => {
|
|
130
130
|
const map = entriesOf(fullyPopulated());
|
|
131
|
-
expect(map.get("sdk_version")).toBe("12.0.
|
|
131
|
+
expect(map.get("sdk_version")).toBe("12.0.2");
|
|
132
132
|
expect(map.get("proxy")).toBe("true");
|
|
133
133
|
expect(map.get("battery_status")).toBe("0"); // 0 is meaningful
|
|
134
134
|
expect(map.get("sdk_config_source")).toBe("sdk_config");
|
|
@@ -153,7 +153,7 @@ describe("metadata payload (golden, device-context fields)", () => {
|
|
|
153
153
|
|
|
154
154
|
it("default snapshot emits only the always-present keys", () => {
|
|
155
155
|
const minimal: UseSmileIDMetadataFields = {
|
|
156
|
-
sdkVersion: "12.0.
|
|
156
|
+
sdkVersion: "12.0.2",
|
|
157
157
|
sdk: "react-native-expo",
|
|
158
158
|
deviceOs: "Android 14",
|
|
159
159
|
deviceModel: "",
|