@smileid/usesmileid 12.0.0-beta01 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +701 -89
- package/dist/camera/camera_defaults.d.ts +14 -9
- package/dist/camera/camera_defaults.d.ts.map +1 -1
- package/dist/camera/camera_defaults.js +11 -9
- package/dist/camera/camera_defaults.js.map +1 -1
- package/dist/camera/orientation_degrees.d.ts +5 -6
- package/dist/camera/orientation_degrees.d.ts.map +1 -1
- package/dist/camera/orientation_degrees.js +5 -6
- package/dist/camera/orientation_degrees.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/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/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_capture_mode.d.ts +8 -0
- package/dist/core/models/document_capture_mode.d.ts.map +1 -1
- package/dist/core/models/document_capture_mode.js +24 -0
- package/dist/core/models/document_capture_mode.js.map +1 -1
- package/dist/core/models/document_type.d.ts +2 -2
- package/dist/core/models/document_type.d.ts.map +1 -1
- package/dist/core/models/document_type.js +7 -5
- 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/core/models/result.d.ts +9 -8
- package/dist/core/models/result.d.ts.map +1 -1
- package/dist/core/models/result.js +5 -6
- package/dist/core/models/result.js.map +1 -1
- 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/interceptors/smile_integrity_interceptor.d.ts +11 -0
- package/dist/data/api/interceptors/smile_integrity_interceptor.d.ts.map +1 -1
- package/dist/data/api/interceptors/smile_integrity_interceptor.js +13 -0
- package/dist/data/api/interceptors/smile_integrity_interceptor.js.map +1 -1
- package/dist/data/api/interceptors/smile_request_mac_interceptor.d.ts +8 -0
- package/dist/data/api/interceptors/smile_request_mac_interceptor.d.ts.map +1 -1
- package/dist/data/api/interceptors/smile_request_mac_interceptor.js +11 -0
- package/dist/data/api/interceptors/smile_request_mac_interceptor.js.map +1 -1
- package/dist/data/api/smile_id_api.d.ts +1 -1
- package/dist/data/api/smile_id_api.d.ts.map +1 -1
- package/dist/data/compression/compressible_asset.d.ts +41 -0
- package/dist/data/compression/compressible_asset.d.ts.map +1 -0
- package/dist/data/compression/compressible_asset.js +34 -0
- package/dist/data/compression/compressible_asset.js.map +1 -0
- package/dist/data/compression/payload_compression_config.d.ts +36 -0
- package/dist/data/compression/payload_compression_config.d.ts.map +1 -0
- package/dist/data/compression/payload_compression_config.js +52 -0
- package/dist/data/compression/payload_compression_config.js.map +1 -0
- package/dist/data/compression/payload_compression_runner.d.ts +29 -0
- package/dist/data/compression/payload_compression_runner.d.ts.map +1 -0
- package/dist/data/compression/payload_compression_runner.js +55 -0
- package/dist/data/compression/payload_compression_runner.js.map +1 -0
- package/dist/data/compression/payload_compressor.d.ts +40 -0
- package/dist/data/compression/payload_compressor.d.ts.map +1 -0
- package/dist/data/compression/payload_compressor.js +126 -0
- package/dist/data/compression/payload_compressor.js.map +1 -0
- package/dist/data/compression/uri_compressible_asset.d.ts +23 -0
- package/dist/data/compression/uri_compressible_asset.d.ts.map +1 -0
- package/dist/data/compression/uri_compressible_asset.js +77 -0
- package/dist/data/compression/uri_compressible_asset.js.map +1 -0
- package/dist/data/dsl/builder/cache_config_builder.d.ts +2 -1
- package/dist/data/dsl/builder/cache_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/cache_config_builder.js +2 -1
- package/dist/data/dsl/builder/cache_config_builder.js.map +1 -1
- package/dist/data/dsl/builder/config_builder.d.ts +40 -14
- package/dist/data/dsl/builder/config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/config_builder.js +40 -14
- package/dist/data/dsl/builder/config_builder.js.map +1 -1
- package/dist/data/dsl/builder/interceptor_config_builder.d.ts +9 -7
- package/dist/data/dsl/builder/interceptor_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/interceptor_config_builder.js +9 -7
- package/dist/data/dsl/builder/interceptor_config_builder.js.map +1 -1
- package/dist/data/dsl/builder/retry_config_builder.d.ts +19 -4
- package/dist/data/dsl/builder/retry_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/retry_config_builder.js +21 -6
- package/dist/data/dsl/builder/retry_config_builder.js.map +1 -1
- package/dist/data/dsl/builder/timeout_config_builder.d.ts +4 -0
- package/dist/data/dsl/builder/timeout_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/timeout_config_builder.js +4 -0
- package/dist/data/dsl/builder/timeout_config_builder.js.map +1 -1
- package/dist/data/dsl/use_smile_id_network_builder.d.ts +17 -0
- package/dist/data/dsl/use_smile_id_network_builder.d.ts.map +1 -1
- package/dist/data/dsl/use_smile_id_network_builder.js +17 -0
- package/dist/data/dsl/use_smile_id_network_builder.js.map +1 -1
- package/dist/data/factory/networking_factory.d.ts.map +1 -1
- package/dist/data/factory/networking_factory.js +11 -1
- package/dist/data/factory/networking_factory.js.map +1 -1
- package/dist/data/repository/use_smile_id_repository_impl.d.ts +6 -0
- package/dist/data/repository/use_smile_id_repository_impl.d.ts.map +1 -1
- package/dist/data/repository/use_smile_id_repository_impl.js +82 -8
- package/dist/data/repository/use_smile_id_repository_impl.js.map +1 -1
- package/dist/data/security/request_canonicalizer.d.ts.map +1 -1
- package/dist/data/security/request_canonicalizer.js +14 -2
- package/dist/data/security/request_canonicalizer.js.map +1 -1
- package/dist/data/security/security_policy.d.ts +43 -0
- package/dist/data/security/security_policy.d.ts.map +1 -0
- package/dist/data/security/security_policy.js +61 -0
- package/dist/data/security/security_policy.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 +2 -2
- package/dist/data/util/retry_util.d.ts.map +1 -1
- package/dist/data/util/retry_util.js +7 -1
- package/dist/data/util/retry_util.js.map +1 -1
- package/dist/data/util/use_smile_id_token_decoder.d.ts +22 -0
- package/dist/data/util/use_smile_id_token_decoder.d.ts.map +1 -1
- package/dist/data/util/use_smile_id_token_decoder.js +58 -24
- 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 +2 -1
- package/dist/l10n/strings_en.d.ts.map +1 -1
- package/dist/l10n/strings_en.js +2 -1
- package/dist/l10n/strings_en.js.map +1 -1
- package/dist/l10n/use_smile_id_localizations.d.ts +1 -0
- package/dist/l10n/use_smile_id_localizations.d.ts.map +1 -1
- package/dist/l10n/use_smile_id_localizations.js +3 -0
- package/dist/l10n/use_smile_id_localizations.js.map +1 -1
- package/dist/metadata/builder_configuration.d.ts +44 -0
- package/dist/metadata/builder_configuration.d.ts.map +1 -0
- package/dist/metadata/builder_configuration.js +35 -0
- package/dist/metadata/builder_configuration.js.map +1 -0
- package/dist/metadata/captured_image_properties.d.ts +11 -0
- package/dist/metadata/captured_image_properties.d.ts.map +1 -0
- package/dist/metadata/captured_image_properties.js +11 -0
- package/dist/metadata/captured_image_properties.js.map +1 -0
- package/dist/metadata/device_orientation_collector.d.ts +17 -0
- package/dist/metadata/device_orientation_collector.d.ts.map +1 -0
- package/dist/metadata/device_orientation_collector.js +66 -0
- package/dist/metadata/device_orientation_collector.js.map +1 -0
- package/dist/metadata/geolocation.d.ts +20 -0
- package/dist/metadata/geolocation.d.ts.map +1 -0
- package/dist/metadata/geolocation.js +40 -0
- package/dist/metadata/geolocation.js.map +1 -0
- package/dist/metadata/metadata_configuration_mappers.d.ts +47 -0
- package/dist/metadata/metadata_configuration_mappers.d.ts.map +1 -0
- package/dist/metadata/metadata_configuration_mappers.js +178 -0
- package/dist/metadata/metadata_configuration_mappers.js.map +1 -0
- package/dist/metadata/model_configuration.d.ts +41 -0
- package/dist/metadata/model_configuration.d.ts.map +1 -0
- package/dist/metadata/model_configuration.js +44 -0
- package/dist/metadata/model_configuration.js.map +1 -0
- package/dist/metadata/optional_native_modules.d.ts +79 -3
- package/dist/metadata/optional_native_modules.d.ts.map +1 -1
- package/dist/metadata/optional_native_modules.js +108 -3
- package/dist/metadata/optional_native_modules.js.map +1 -1
- package/dist/metadata/use_smile_id_metadata.d.ts +45 -7
- package/dist/metadata/use_smile_id_metadata.d.ts.map +1 -1
- package/dist/metadata/use_smile_id_metadata.js +85 -13
- package/dist/metadata/use_smile_id_metadata.js.map +1 -1
- package/dist/metadata/use_smile_id_metadata_factory.d.ts +37 -0
- package/dist/metadata/use_smile_id_metadata_factory.d.ts.map +1 -1
- package/dist/metadata/use_smile_id_metadata_factory.js +197 -16
- package/dist/metadata/use_smile_id_metadata_factory.js.map +1 -1
- package/dist/presentation/assets/svg/document_shimmer_strings.d.ts +14 -0
- package/dist/presentation/assets/svg/document_shimmer_strings.d.ts.map +1 -0
- package/dist/presentation/assets/svg/document_shimmer_strings.js +14 -0
- package/dist/presentation/assets/svg/document_shimmer_strings.js.map +1 -0
- package/dist/presentation/assets/svg/instruction_svg_strings.d.ts +12 -4
- package/dist/presentation/assets/svg/instruction_svg_strings.d.ts.map +1 -1
- package/dist/presentation/assets/svg/instruction_svg_strings.js +19 -8
- package/dist/presentation/assets/svg/instruction_svg_strings.js.map +1 -1
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.d.ts +0 -5
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.d.ts.map +1 -1
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.js +0 -5
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.js.map +1 -1
- package/dist/presentation/components/icons/index.d.ts +24 -8
- package/dist/presentation/components/icons/index.d.ts.map +1 -1
- package/dist/presentation/components/icons/index.js +31 -11
- package/dist/presentation/components/icons/index.js.map +1 -1
- package/dist/presentation/components/use_smile_id_attribution.d.ts +1 -1
- package/dist/presentation/components/use_smile_id_button.d.ts +2 -2
- package/dist/presentation/components/use_smile_id_button.js +4 -4
- package/dist/presentation/components/use_smile_id_button.js.map +1 -1
- package/dist/presentation/components/use_smile_id_capture_content.d.ts +13 -0
- package/dist/presentation/components/use_smile_id_capture_content.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_capture_content.js +15 -9
- package/dist/presentation/components/use_smile_id_capture_content.js.map +1 -1
- package/dist/presentation/components/use_smile_id_captured_document_image.d.ts +2 -3
- package/dist/presentation/components/use_smile_id_captured_document_image.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_captured_document_image.js +1 -3
- package/dist/presentation/components/use_smile_id_captured_document_image.js.map +1 -1
- package/dist/presentation/components/use_smile_id_document_capture_controls.d.ts +12 -6
- package/dist/presentation/components/use_smile_id_document_capture_controls.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_document_capture_controls.js +59 -16
- package/dist/presentation/components/use_smile_id_document_capture_controls.js.map +1 -1
- package/dist/presentation/components/use_smile_id_document_overlay.d.ts +22 -5
- package/dist/presentation/components/use_smile_id_document_overlay.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_document_overlay.js +80 -40
- package/dist/presentation/components/use_smile_id_document_overlay.js.map +1 -1
- package/dist/presentation/components/use_smile_id_document_shimmer.d.ts +15 -0
- package/dist/presentation/components/use_smile_id_document_shimmer.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_document_shimmer.js +23 -0
- package/dist/presentation/components/use_smile_id_document_shimmer.js.map +1 -0
- 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 +9 -6
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js.map +1 -1
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.js +84 -1
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.js.map +1 -1
- package/dist/presentation/components/use_smile_id_instructions_hero.d.ts +3 -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 +25 -5
- package/dist/presentation/components/use_smile_id_instructions_hero.js.map +1 -1
- package/dist/presentation/components/use_smile_id_oval_border_palette.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_oval_border_palette.js +7 -3
- package/dist/presentation/components/use_smile_id_oval_border_palette.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts +28 -0
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/config_builder.js +30 -0
- package/dist/presentation/flow/dsl/builder/config_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/ml_builder.d.ts +13 -4
- package/dist/presentation/flow/dsl/builder/ml_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/ml_builder.js +3 -2
- package/dist/presentation/flow/dsl/builder/ml_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts +110 -12
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.js +110 -12
- package/dist/presentation/flow/dsl/builder/screens_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/theme_builder.d.ts +15 -2
- package/dist/presentation/flow/dsl/builder/theme_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/theme_builder.js +15 -2
- package/dist/presentation/flow/dsl/builder/theme_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/use_smile_id_builder.d.ts +6 -4
- package/dist/presentation/flow/dsl/use_smile_id_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/use_smile_id_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.d.ts +62 -36
- 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 +62 -36
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js.map +1 -1
- package/dist/presentation/flow/flow_navigation_manager.d.ts +44 -5
- package/dist/presentation/flow/flow_navigation_manager.d.ts.map +1 -1
- package/dist/presentation/flow/flow_navigation_manager.js +148 -11
- package/dist/presentation/flow/flow_navigation_manager.js.map +1 -1
- package/dist/presentation/flow/model/instruction_guideline.d.ts +9 -0
- package/dist/presentation/flow/model/instruction_guideline.d.ts.map +1 -1
- package/dist/presentation/flow/model/instructions_defaults.d.ts +11 -2
- package/dist/presentation/flow/model/instructions_defaults.d.ts.map +1 -1
- package/dist/presentation/flow/model/instructions_defaults.js +74 -26
- 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 +48 -14
- 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_instructions_screen.js +1 -1
- package/dist/presentation/flow/screen/orchestrated_instructions_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 +3 -9
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_processing_screen.js +3 -3
- 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 +10 -4
- package/dist/presentation/flow/use_smile_id_flow.js.map +1 -1
- package/dist/presentation/flow/validation/flow_validator.d.ts.map +1 -1
- package/dist/presentation/flow/validation/flow_validator.js +42 -20
- package/dist/presentation/flow/validation/flow_validator.js.map +1 -1
- package/dist/presentation/flow/validation/job_type_validator.d.ts.map +1 -1
- package/dist/presentation/flow/validation/job_type_validator.js +14 -0
- package/dist/presentation/flow/validation/job_type_validator.js.map +1 -1
- 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/instructions_screen_helpers.d.ts +1 -0
- package/dist/presentation/screen/helpers/instructions_screen_helpers.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/instructions_screen_helpers.js +6 -2
- package/dist/presentation/screen/helpers/instructions_screen_helpers.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 +14 -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 +21 -3
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.js +188 -32
- 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.d.ts +2 -3
- package/dist/presentation/screen/use_smile_id_document_preview_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js +17 -12
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_instructions_screen.d.ts +2 -0
- package/dist/presentation/screen/use_smile_id_instructions_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_instructions_screen.js +2 -1
- package/dist/presentation/screen/use_smile_id_instructions_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts +7 -26
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.js +10 -20
- package/dist/presentation/screen/use_smile_id_preview_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.d.ts +2 -3
- package/dist/presentation/screen/use_smile_id_processing_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.js +4 -3
- package/dist/presentation/screen/use_smile_id_processing_screen.js.map +1 -1
- package/dist/presentation/theme/theme.d.ts +1 -1
- package/dist/presentation/theme/theme.d.ts.map +1 -1
- package/dist/presentation/theme/theme.js +20 -18
- package/dist/presentation/theme/theme.js.map +1 -1
- package/dist/presentation/utils/force_max_brightness.d.ts +4 -4
- 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 +34 -7
- package/src/__tests__/dsl.test.ts +51 -1
- package/src/__tests__/react_native_mock.tsx +8 -0
- package/src/__tests__/setup_react_native.ts +17 -2
- package/src/__tests__/snapshots/__snapshots__/screens_structural.test.tsx.snap +5261 -0
- package/src/__tests__/snapshots/screens_structural.test.tsx +230 -0
- package/src/camera/__tests__/use_smile_id_camera_system.test.ts +103 -0
- package/src/camera/camera_defaults.ts +11 -9
- package/src/camera/orientation_degrees.ts +5 -6
- package/src/core/exception/__tests__/builder_validation_exceptions.test.ts +67 -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/index.ts +1 -0
- package/src/core/exception/use_smile_id_error_code.ts +1 -0
- package/src/core/models/__tests__/document_type.test.ts +7 -5
- package/src/core/models/__tests__/flow_models.test.ts +26 -0
- package/src/core/models/config.ts +22 -0
- package/src/core/models/document_capture_mode.ts +27 -0
- package/src/core/models/document_type.ts +7 -5
- package/src/core/models/global_privacy_control.ts +45 -0
- package/src/core/models/network_config.ts +2 -2
- package/src/core/models/result.ts +9 -8
- package/src/data/api/__tests__/smile_id_api.test.ts +1 -1
- package/src/data/api/interceptors/__tests__/gzip_interceptor.test.ts +83 -0
- package/src/data/api/interceptors/__tests__/smile_integrity_interceptor.test.ts +37 -1
- package/src/data/api/interceptors/__tests__/smile_request_mac_interceptor.test.ts +59 -1
- package/src/data/api/interceptors/smile_auth_interceptor.ts +3 -18
- package/src/data/api/interceptors/smile_integrity_interceptor.ts +20 -0
- package/src/data/api/interceptors/smile_request_mac_interceptor.ts +13 -0
- package/src/data/compression/__tests__/payload_compressor.test.ts +200 -0
- package/src/data/compression/__tests__/payload_compressor_real_jpeg.test.ts +226 -0
- package/src/data/compression/compressible_asset.ts +62 -0
- package/src/data/compression/payload_compression_config.ts +53 -0
- package/src/data/compression/payload_compression_runner.ts +102 -0
- package/src/data/compression/payload_compressor.ts +164 -0
- package/src/data/compression/uri_compressible_asset.ts +85 -0
- package/src/data/dsl/builder/__tests__/config_builders.test.ts +62 -0
- package/src/data/dsl/builder/cache_config_builder.ts +3 -1
- package/src/data/dsl/builder/config_builder.ts +45 -14
- package/src/data/dsl/builder/interceptor_config_builder.ts +9 -7
- package/src/data/dsl/builder/retry_config_builder.ts +27 -6
- package/src/data/dsl/builder/timeout_config_builder.ts +7 -0
- package/src/data/dsl/use_smile_id_network_builder.ts +17 -0
- 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/factory/networking_factory.ts +14 -1
- package/src/data/repository/__tests__/network_retries.test.ts +117 -0
- package/src/data/repository/__tests__/use_smile_id_repository.test.ts +1 -1
- package/src/data/repository/use_smile_id_repository_impl.ts +96 -9
- package/src/data/security/__tests__/request_canonicalizer.test.ts +132 -0
- package/src/data/security/__tests__/security_policy.test.ts +96 -0
- package/src/data/security/__tests__/smile_id_crypto_manager.test.ts +18 -0
- package/src/data/security/request_canonicalizer.ts +15 -2
- package/src/data/security/security_policy.ts +70 -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 +57 -1
- package/src/data/util/retry_util.ts +12 -3
- package/src/data/util/use_smile_id_token_decoder.ts +76 -28
- package/src/index.ts +6 -4
- package/src/l10n/strings_en.ts +2 -1
- package/src/l10n/use_smile_id_localizations.ts +3 -0
- package/src/metadata/__tests__/device_orientation_collector.test.ts +15 -0
- package/src/metadata/__tests__/metadata_configuration_mappers.test.ts +254 -0
- package/src/metadata/__tests__/metadata_configuration_objects.test.ts +86 -0
- package/src/metadata/__tests__/metadata_device_context.test.ts +147 -0
- package/src/metadata/__tests__/metadata_device_os_android.test.ts +18 -0
- package/src/metadata/__tests__/metadata_golden_fixture.json +13 -0
- package/src/metadata/__tests__/metadata_payload_golden.test.ts +193 -0
- package/src/metadata/__tests__/use_smile_id_metadata.test.ts +19 -25
- package/src/metadata/builder_configuration.ts +69 -0
- package/src/metadata/captured_image_properties.ts +10 -0
- package/src/metadata/device_orientation_collector.ts +75 -0
- package/src/metadata/geolocation.ts +46 -0
- package/src/metadata/metadata_configuration_mappers.ts +248 -0
- package/src/metadata/model_configuration.ts +68 -0
- package/src/metadata/optional_native_modules.ts +157 -3
- package/src/metadata/use_smile_id_metadata.ts +140 -17
- package/src/metadata/use_smile_id_metadata_factory.ts +211 -16
- 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 -5575
- 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/assets/svg/document_shimmer_strings.ts +17 -0
- package/src/presentation/assets/svg/instruction_svg_strings.ts +34 -12
- package/src/presentation/components/__tests__/enhanced_smart_selfie_animation_frames.test.ts +1 -3
- package/src/presentation/components/__tests__/use_smile_id_enhanced_smart_selfie_clip.test.tsx +12 -8
- package/src/presentation/components/__tests__/use_smile_id_guideline_thumbnail.test.tsx +34 -1
- package/src/presentation/components/__tests__/use_smile_id_instructions_hero.test.tsx +71 -0
- package/src/presentation/components/__tests__/use_smile_id_oval_border_palette.test.ts +7 -5
- package/src/presentation/components/helpers/enhanced_smart_selfie_animation_frames.ts +0 -6
- package/src/presentation/components/icons/index.tsx +65 -18
- package/src/presentation/components/use_smile_id_attribution.tsx +1 -1
- package/src/presentation/components/use_smile_id_button.tsx +4 -4
- package/src/presentation/components/use_smile_id_capture_content.tsx +36 -12
- package/src/presentation/components/use_smile_id_captured_document_image.tsx +3 -8
- package/src/presentation/components/use_smile_id_document_capture_controls.tsx +103 -39
- package/src/presentation/components/use_smile_id_document_overlay.tsx +134 -44
- package/src/presentation/components/use_smile_id_document_shimmer.tsx +51 -0
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_clip.tsx +9 -6
- package/src/presentation/components/use_smile_id_guideline_thumbnail.tsx +131 -2
- package/src/presentation/components/use_smile_id_instructions_hero.tsx +111 -60
- package/src/presentation/components/use_smile_id_oval_border_palette.ts +7 -3
- package/src/presentation/flow/__tests__/document_flow_navigation.test.ts +203 -4
- package/src/presentation/flow/__tests__/flow_navigation_manager.test.ts +49 -0
- package/src/presentation/flow/dsl/builder/__tests__/config_builder.test.ts +25 -0
- package/src/presentation/flow/dsl/builder/config_builder.ts +35 -0
- package/src/presentation/flow/dsl/builder/ml_builder.ts +13 -4
- package/src/presentation/flow/dsl/builder/screens_builder.ts +110 -12
- package/src/presentation/flow/dsl/builder/theme_builder.ts +19 -2
- package/src/presentation/flow/dsl/use_smile_id_builder.tsx +6 -4
- package/src/presentation/flow/dsl/use_smile_id_flow_builder.ts +62 -36
- package/src/presentation/flow/flow_navigation_manager.ts +185 -14
- package/src/presentation/flow/model/instruction_guideline.ts +6 -0
- package/src/presentation/flow/model/instructions_defaults.ts +104 -26
- package/src/presentation/flow/screen/orchestrated_capture_screen.tsx +60 -12
- package/src/presentation/flow/screen/orchestrated_consent_screen.tsx +5 -0
- package/src/presentation/flow/screen/orchestrated_instructions_screen.tsx +1 -0
- package/src/presentation/flow/screen/orchestrated_preview_screen.tsx +4 -14
- package/src/presentation/flow/screen/orchestrated_processing_screen.tsx +3 -3
- package/src/presentation/flow/use_smile_id_flow.tsx +11 -4
- package/src/presentation/flow/validation/__tests__/flow_validator.test.ts +61 -1
- package/src/presentation/flow/validation/__tests__/job_type_validator.test.ts +64 -0
- package/src/presentation/flow/validation/flow_validator.ts +55 -26
- package/src/presentation/flow/validation/job_type_validator.ts +24 -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__/instructions_screen_helpers.test.ts +15 -3
- 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 +182 -18
- package/src/presentation/screen/__tests__/use_smile_id_document_back_instructions.test.tsx +1 -1
- 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/instructions_screen_helpers.ts +7 -2
- package/src/presentation/screen/helpers/scan_state_to_overlay_state.ts +16 -13
- package/src/presentation/screen/helpers/use_capture_orientation_lock.ts +69 -7
- package/src/presentation/screen/use_smile_id_capture_screen.tsx +280 -54
- 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 +33 -23
- package/src/presentation/screen/use_smile_id_instructions_screen.tsx +4 -0
- package/src/presentation/screen/use_smile_id_preview_screen.tsx +21 -53
- package/src/presentation/screen/use_smile_id_processing_screen.tsx +8 -8
- package/src/presentation/theme/theme.ts +21 -19
- package/src/presentation/utils/__tests__/locale_utils.test.ts +46 -5
- package/src/presentation/utils/force_max_brightness.tsx +4 -4
- 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/camera/frame_processor_plugin.d.ts +0 -28
- package/dist/camera/frame_processor_plugin.d.ts.map +0 -1
- package/dist/camera/frame_processor_plugin.js +0 -21
- package/dist/camera/frame_processor_plugin.js.map +0 -1
- package/dist/camera/use_smile_id_frame_processor.d.ts +0 -38
- package/dist/camera/use_smile_id_frame_processor.d.ts.map +0 -1
- package/dist/camera/use_smile_id_frame_processor.js +0 -2
- package/dist/camera/use_smile_id_frame_processor.js.map +0 -1
- package/dist/presentation/components/use_smile_id_document_frame_glyph.d.ts +0 -17
- package/dist/presentation/components/use_smile_id_document_frame_glyph.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_document_frame_glyph.js +0 -17
- package/dist/presentation/components/use_smile_id_document_frame_glyph.js.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.d.ts +0 -24
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.js +0 -91
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.js.map +0 -1
- 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/dist/presentation/components/use_smile_id_instruction_card.d.ts +0 -31
- package/dist/presentation/components/use_smile_id_instruction_card.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_instruction_card.js +0 -43
- package/dist/presentation/components/use_smile_id_instruction_card.js.map +0 -1
- package/dist/presentation/screen/helpers/use_document_orientation_lock.d.ts +0 -24
- package/dist/presentation/screen/helpers/use_document_orientation_lock.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/use_document_orientation_lock.js +0 -47
- package/dist/presentation/screen/helpers/use_document_orientation_lock.js.map +0 -1
- package/src/presentation/components/use_smile_id_document_frame_glyph.tsx +0 -162
- package/src/presentation/components/use_smile_id_face_silhouette_overlay.tsx +0 -27
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
* server and partner dashboards parse it positionally; `toEntries()` produces it.
|
|
6
6
|
*
|
|
7
7
|
* Omission rules: always-present (`sdk_version`, `sdk`, `device_os`,
|
|
8
|
-
* `device_model`, `app_name`, `session_id`, `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* `device_model`, `app_name`, `session_id`, `security_policy_version`);
|
|
9
|
+
* conditional strings dropped when empty; conditional integers dropped when
|
|
10
|
+
* zero; `proxy` / `proximity_sensor` emitted only when actually measured
|
|
11
|
+
* (undefined = unknown, dropped) — a measured `false` is kept.
|
|
11
12
|
*/
|
|
12
13
|
|
|
14
|
+
import type { Geolocation } from "./geolocation";
|
|
15
|
+
|
|
13
16
|
export type MetadataEntry = {
|
|
14
17
|
readonly name: string;
|
|
15
18
|
readonly value: string;
|
|
@@ -25,7 +28,8 @@ export type UseSmileIDMetadataFields = {
|
|
|
25
28
|
readonly clientIp: string;
|
|
26
29
|
readonly networkConnection: string;
|
|
27
30
|
readonly carrierInfo: string;
|
|
28
|
-
|
|
31
|
+
/** Proxy detection result → `proxy`. Undefined when never measured (omitted); a measured `false` is emitted. */
|
|
32
|
+
readonly proxy?: boolean;
|
|
29
33
|
readonly timezone: string;
|
|
30
34
|
readonly locale: string;
|
|
31
35
|
readonly screenResolution: string;
|
|
@@ -34,7 +38,8 @@ export type UseSmileIDMetadataFields = {
|
|
|
34
38
|
readonly systemArchitecture: string;
|
|
35
39
|
readonly numberOfCameras: number;
|
|
36
40
|
readonly hostApplication: string;
|
|
37
|
-
|
|
41
|
+
/** Proximity-sensor availability → `proximity_sensor`. Undefined when never measured (omitted); a measured `false` is emitted. */
|
|
42
|
+
readonly proximitySensor?: boolean;
|
|
38
43
|
readonly securityPolicyVersion: string;
|
|
39
44
|
/** Android Keystore security level (`KeyInfo.getSecurityLevel()`, `-2`…`2`) → `supports_hardware_attestation`. Undefined on iOS and before warm-up resolves. */
|
|
40
45
|
readonly hardwareAttestationSecurityLevel?: number;
|
|
@@ -44,10 +49,44 @@ export type UseSmileIDMetadataFields = {
|
|
|
44
49
|
readonly supportsAppAttest?: boolean;
|
|
45
50
|
/** Capture-param provenance → `sdk_config_source`: `"sdk_config"` when a valid JWT claim was decoded, else `"default"`. */
|
|
46
51
|
readonly sdkConfigSource: string;
|
|
47
|
-
/** Resolved selfie
|
|
52
|
+
/** Resolved selfie capture target dimensions → `selfie_image_dimensions` `"WxH"`: `sdk_config.selfie` override or SDK default (480x640). Dropped when a side is 0. */
|
|
48
53
|
readonly imageWidth: number;
|
|
49
|
-
/** Resolved selfie height (px) → `image_height`: `sdk_config.selfie.height` override (when width+height > 0) or SDK default (640). Omitted when zero. */
|
|
50
54
|
readonly imageHeight: number;
|
|
55
|
+
/** Resolved liveness capture target dimensions → `liveness_image_dimensions` `"WxH"`. Dropped when a side is 0. */
|
|
56
|
+
readonly livenessImageWidth: number;
|
|
57
|
+
readonly livenessImageHeight: number;
|
|
58
|
+
/** Device UTC offset in minutes (may be negative or 0) → `timezone_offset`. Undefined omits. */
|
|
59
|
+
readonly timezoneOffsetMinutes?: number;
|
|
60
|
+
/** `android.os.Build.*` device-context strings; empty on iOS except `buildDevice` (iOS hardware id). Omitted when empty. */
|
|
61
|
+
readonly buildBrand?: string;
|
|
62
|
+
readonly buildDevice?: string;
|
|
63
|
+
readonly buildFingerprint?: string;
|
|
64
|
+
readonly buildProduct?: string;
|
|
65
|
+
/** `Build.HARDWARE` (Android) → `build_hardware`; empty on iOS. Omitted when empty. */
|
|
66
|
+
readonly buildHardware?: string;
|
|
67
|
+
/** Install source / store (Android `PackageManager` install source) → `build_source`. Omitted when empty. */
|
|
68
|
+
readonly buildSource?: string;
|
|
69
|
+
/** Host app package id (Android) / bundle id (iOS), computed natively → `package_name`. Omitted when empty. */
|
|
70
|
+
readonly packageName?: string;
|
|
71
|
+
/** Stable per-device fingerprint (Android `ANDROID_ID` / iOS `identifierForVendor`) → `fingerprint`. Omitted when empty. */
|
|
72
|
+
readonly fingerprint?: string;
|
|
73
|
+
/** Whether an active VPN is present → `vpn`. Omitted when undefined. */
|
|
74
|
+
readonly vpn?: boolean;
|
|
75
|
+
/** App-signing certificate SHA-256 digests (Android only) → `certificate_digest` (JSON-array string). Omitted when empty. */
|
|
76
|
+
readonly certificateDigest?: readonly string[];
|
|
77
|
+
/** ISO-8601 local timestamp captured at request build time → `local_time_of_enrolment`. */
|
|
78
|
+
readonly localTimeOfEnrolment?: string;
|
|
79
|
+
/** Charging plug status → `battery_status` (`-1` unknown, `0` on-battery, `1` plugged in). Omitted when undefined. */
|
|
80
|
+
readonly batteryStatus?: number;
|
|
81
|
+
/** Wrapper SDK identity → `wrapper_name` / `wrapper_version` (`react_native_expo` + SDK version). Omitted when empty. */
|
|
82
|
+
readonly wrapperName?: string;
|
|
83
|
+
readonly wrapperVersion?: string;
|
|
84
|
+
/** Persisted SDK launch count → `sdk_launch_count`. Omitted when undefined or zero. */
|
|
85
|
+
readonly sdkLaunchCount?: number;
|
|
86
|
+
/** Last-known location → `geolocation` (JSON-object string). Omitted when undefined. */
|
|
87
|
+
readonly geolocation?: Geolocation;
|
|
88
|
+
/** Obfuscated device security-state signal (computed natively) → `privileges`. Omitted when undefined/blank. */
|
|
89
|
+
readonly privileges?: string;
|
|
51
90
|
};
|
|
52
91
|
|
|
53
92
|
export class UseSmileIDMetadata {
|
|
@@ -88,7 +127,7 @@ export class UseSmileIDMetadata {
|
|
|
88
127
|
const fields = this._fields;
|
|
89
128
|
const entries: MetadataEntry[] = [];
|
|
90
129
|
|
|
91
|
-
// Always-present: SDK constants,
|
|
130
|
+
// Always-present: SDK constants, sessionId (UUID), and
|
|
92
131
|
// device_os/device_model/app_name (emitted even when empty). The rest
|
|
93
132
|
// below use the drop-when-empty rule.
|
|
94
133
|
entries.push({ name: "sdk_version", value: fields.sdkVersion });
|
|
@@ -98,12 +137,16 @@ export class UseSmileIDMetadata {
|
|
|
98
137
|
entries.push({ name: "app_name", value: fields.appName });
|
|
99
138
|
entries.push({ name: "session_id", value: fields.sessionId });
|
|
100
139
|
|
|
101
|
-
//
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
140
|
+
// Measured booleans — omitted when never measured; a measured false is kept.
|
|
141
|
+
if (fields.proxy !== undefined) {
|
|
142
|
+
entries.push({ name: "proxy", value: String(fields.proxy) });
|
|
143
|
+
}
|
|
144
|
+
if (fields.proximitySensor !== undefined) {
|
|
145
|
+
entries.push({
|
|
146
|
+
name: "proximity_sensor",
|
|
147
|
+
value: String(fields.proximitySensor),
|
|
148
|
+
});
|
|
149
|
+
}
|
|
107
150
|
|
|
108
151
|
// Conditional strings — omitted when empty
|
|
109
152
|
pushIfNonEmpty(entries, "client_ip", fields.clientIp);
|
|
@@ -150,9 +193,89 @@ export class UseSmileIDMetadata {
|
|
|
150
193
|
|
|
151
194
|
// sdk_config provenance — always-present string, never empty.
|
|
152
195
|
entries.push({ name: "sdk_config_source", value: fields.sdkConfigSource });
|
|
153
|
-
// Resolved selfie dimensions
|
|
154
|
-
|
|
155
|
-
|
|
196
|
+
// Resolved selfie / liveness capture target dimensions as "WxH"; each dropped when a side is 0.
|
|
197
|
+
if (fields.imageWidth > 0 && fields.imageHeight > 0) {
|
|
198
|
+
entries.push({
|
|
199
|
+
name: "selfie_image_dimensions",
|
|
200
|
+
value: `${fields.imageWidth}x${fields.imageHeight}`,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
if (fields.livenessImageWidth > 0 && fields.livenessImageHeight > 0) {
|
|
204
|
+
entries.push({
|
|
205
|
+
name: "liveness_image_dimensions",
|
|
206
|
+
value: `${fields.livenessImageWidth}x${fields.livenessImageHeight}`,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
// UTC offset in minutes (may be negative or 0); emitted whenever resolved.
|
|
210
|
+
if (fields.timezoneOffsetMinutes !== undefined) {
|
|
211
|
+
entries.push({
|
|
212
|
+
name: "timezone_offset",
|
|
213
|
+
value: String(fields.timezoneOffsetMinutes),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Build / device-context strings — omitted when empty.
|
|
218
|
+
pushIfNonEmpty(entries, "build_brand", fields.buildBrand ?? "");
|
|
219
|
+
pushIfNonEmpty(entries, "build_device", fields.buildDevice ?? "");
|
|
220
|
+
pushIfNonEmpty(entries, "build_fingerprint", fields.buildFingerprint ?? "");
|
|
221
|
+
pushIfNonEmpty(entries, "build_product", fields.buildProduct ?? "");
|
|
222
|
+
pushIfNonEmpty(entries, "build_hardware", fields.buildHardware ?? "");
|
|
223
|
+
pushIfNonEmpty(entries, "build_source", fields.buildSource ?? "");
|
|
224
|
+
pushIfNonEmpty(entries, "package_name", fields.packageName ?? "");
|
|
225
|
+
pushIfNonEmpty(entries, "fingerprint", fields.fingerprint ?? "");
|
|
226
|
+
pushIfNonEmpty(
|
|
227
|
+
entries,
|
|
228
|
+
"local_time_of_enrolment",
|
|
229
|
+
fields.localTimeOfEnrolment ?? "",
|
|
230
|
+
);
|
|
231
|
+
// Charging status — omitted until resolved. `0` (on battery) is meaningful.
|
|
232
|
+
if (fields.batteryStatus !== undefined) {
|
|
233
|
+
entries.push({
|
|
234
|
+
name: "battery_status",
|
|
235
|
+
value: String(fields.batteryStatus),
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// VPN presence — omitted until resolved; `false` is meaningful.
|
|
240
|
+
if (fields.vpn !== undefined) {
|
|
241
|
+
entries.push({ name: "vpn", value: String(fields.vpn) });
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// App-signing certificate digests (Android) — JSON-array string, omitted when empty.
|
|
245
|
+
if (
|
|
246
|
+
fields.certificateDigest !== undefined &&
|
|
247
|
+
fields.certificateDigest.length > 0
|
|
248
|
+
) {
|
|
249
|
+
entries.push({
|
|
250
|
+
name: "certificate_digest",
|
|
251
|
+
value: JSON.stringify(fields.certificateDigest),
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Wrapper SDK identity — omitted when empty.
|
|
256
|
+
pushIfNonEmpty(entries, "wrapper_name", fields.wrapperName ?? "");
|
|
257
|
+
pushIfNonEmpty(entries, "wrapper_version", fields.wrapperVersion ?? "");
|
|
258
|
+
|
|
259
|
+
// Persisted launch count — omitted until resolved or when zero.
|
|
260
|
+
if (fields.sdkLaunchCount !== undefined && fields.sdkLaunchCount > 0) {
|
|
261
|
+
entries.push({
|
|
262
|
+
name: "sdk_launch_count",
|
|
263
|
+
value: String(fields.sdkLaunchCount),
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Last-known location — JSON-object string, omitted when unresolved.
|
|
268
|
+
if (fields.geolocation !== undefined) {
|
|
269
|
+
entries.push({
|
|
270
|
+
name: "geolocation",
|
|
271
|
+
value: JSON.stringify(fields.geolocation),
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Obfuscated device privileges signal — emitted verbatim, omitted when blank.
|
|
276
|
+
if (fields.privileges !== undefined && fields.privileges.length > 0) {
|
|
277
|
+
entries.push({ name: "privileges", value: fields.privileges });
|
|
278
|
+
}
|
|
156
279
|
|
|
157
280
|
// Flow-state entries appended after the device-metadata fields.
|
|
158
281
|
entries.push(...this._extraEntries);
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { Dimensions, Platform } from "react-native";
|
|
2
2
|
import {
|
|
3
3
|
Attestation,
|
|
4
|
+
type DeviceIntegritySignals,
|
|
5
|
+
DeviceIntegrityProvider,
|
|
4
6
|
type HardwareAttestation,
|
|
7
|
+
PrivilegesProvider,
|
|
5
8
|
} from "@smileid/usesmileid_bridge";
|
|
6
9
|
import {
|
|
7
10
|
UseSmileIDMetadata,
|
|
8
11
|
type UseSmileIDMetadataFields,
|
|
9
12
|
} from "./use_smile_id_metadata";
|
|
10
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
loadAsyncStorage,
|
|
15
|
+
loadExpoBattery,
|
|
16
|
+
loadExpoCellular,
|
|
17
|
+
loadExpoDevice,
|
|
18
|
+
loadExpoNetwork,
|
|
19
|
+
} from "./optional_native_modules";
|
|
20
|
+
import { type Geolocation, resolveGeolocation } from "./geolocation";
|
|
11
21
|
import type { SdkConfig } from "../data/model/sdk_config";
|
|
12
22
|
import { resolveDimensions } from "../data/model/sdk_config_capture";
|
|
13
23
|
import { SdkConfigSource } from "../data/model/sdk_config_source";
|
|
@@ -41,19 +51,22 @@ import { CameraDefaults } from "../camera/camera_defaults";
|
|
|
41
51
|
* before the first submission so the race is benign in practice.
|
|
42
52
|
* - Partner-supplied via [MetadataFactoryOptions]: `app_name`,
|
|
43
53
|
* `host_application`.
|
|
44
|
-
* -
|
|
45
|
-
* `carrier_info
|
|
46
|
-
*
|
|
54
|
+
* - Not measurable until a richer native bridge lands:
|
|
55
|
+
* `carrier_info` and `number_of_cameras` stay empty / zero (dropped
|
|
56
|
+
* from the wire), and `proximity_sensor` / `proxy` stay undefined
|
|
57
|
+
* (dropped from the wire) rather than reporting an inaccurate
|
|
58
|
+
* `false`. Partners who want these pass a custom
|
|
47
59
|
* `MetadataProvider` to the repository.
|
|
48
60
|
*/
|
|
49
61
|
|
|
50
62
|
// Beta release version reported to the backend as `sdk_version`. Keep in sync
|
|
51
63
|
// with the `version` field across the published package.json files.
|
|
52
|
-
const SDK_VERSION = "12.0.
|
|
64
|
+
const SDK_VERSION = "12.0.1";
|
|
53
65
|
// The security-policy axis is versioned independently of the SDK release tag,
|
|
54
66
|
// so it stays at the base `12.0.0` (not the prerelease tag).
|
|
55
67
|
const SECURITY_POLICY_VERSION = "12.0.0";
|
|
56
68
|
const SDK_IDENTIFIER = "react-native-expo";
|
|
69
|
+
const LAUNCH_COUNT_KEY = "com.usesmileid.metadata.sdk_launch_count";
|
|
57
70
|
|
|
58
71
|
export interface MetadataProvider {
|
|
59
72
|
/**
|
|
@@ -102,6 +115,30 @@ export class UseSmileIDMetadataFactory implements MetadataProvider {
|
|
|
102
115
|
private readonly _hostApplication: string;
|
|
103
116
|
private readonly _systemArchitecture: string;
|
|
104
117
|
private readonly _memoryInfoMb: number;
|
|
118
|
+
// Build / device-context strings + carrier, resolved once at construction
|
|
119
|
+
// from expo-device / expo-cellular sync constants. Empty when the module is
|
|
120
|
+
// absent or the platform has no analog.
|
|
121
|
+
private readonly _buildBrand: string;
|
|
122
|
+
private readonly _buildDevice: string;
|
|
123
|
+
private readonly _buildFingerprint: string;
|
|
124
|
+
private readonly _buildProduct: string;
|
|
125
|
+
private readonly _carrierInfo: string;
|
|
126
|
+
// Resolved by the async warmup (expo-battery). Undefined until it settles —
|
|
127
|
+
// make() omits battery_status until then.
|
|
128
|
+
private _batteryStatus?: number;
|
|
129
|
+
// Persisted launch counter, resolved by the async warmup (async-storage).
|
|
130
|
+
// Undefined until it settles — make() omits sdk_launch_count until then.
|
|
131
|
+
private _sdkLaunchCount?: number;
|
|
132
|
+
// Last-known location, resolved by the async warmup (expo-location), only when a
|
|
133
|
+
// permission is already granted. Undefined until it settles / when denied.
|
|
134
|
+
private _geolocation?: Geolocation;
|
|
135
|
+
// Obfuscated device privileges JSON, resolved by the async warmup (native bridge).
|
|
136
|
+
// Undefined until it settles — make() omits the privileges field until then.
|
|
137
|
+
private _privileges?: string;
|
|
138
|
+
// Native device-integrity signals (fingerprint, package name, vpn, build hardware,
|
|
139
|
+
// install source, cert digests), resolved by the async warmup (native bridge).
|
|
140
|
+
// Undefined until it settles — make() omits the corresponding fields until then.
|
|
141
|
+
private _deviceIntegrity?: DeviceIntegritySignals;
|
|
105
142
|
// Mutated by [warmup] once the async expo-network calls settle.
|
|
106
143
|
// Mutable on purpose — the constructor cannot block on the
|
|
107
144
|
// async API, and reading stale `""` is preferable to forcing the
|
|
@@ -142,12 +179,26 @@ export class UseSmileIDMetadataFactory implements MetadataProvider {
|
|
|
142
179
|
typeof device.totalMemory === "number" && device.totalMemory > 0
|
|
143
180
|
? Math.round(device.totalMemory / (1024 * 1024))
|
|
144
181
|
: 0;
|
|
182
|
+
this._buildBrand = device.brand?.trim() ?? "";
|
|
183
|
+
// Android `Build.DEVICE` vs iOS hardware identifier (e.g. iPhone16,2).
|
|
184
|
+
this._buildDevice =
|
|
185
|
+
(Platform.OS === "ios" ? device.modelId : device.designName)?.trim() ??
|
|
186
|
+
"";
|
|
187
|
+
this._buildFingerprint = device.osBuildFingerprint?.trim() ?? "";
|
|
188
|
+
this._buildProduct = device.productName?.trim() ?? "";
|
|
145
189
|
} else {
|
|
146
190
|
this._deviceModel = "";
|
|
147
191
|
this._systemArchitecture = "";
|
|
148
192
|
this._memoryInfoMb = 0;
|
|
193
|
+
this._buildBrand = "";
|
|
194
|
+
this._buildDevice = "";
|
|
195
|
+
this._buildFingerprint = "";
|
|
196
|
+
this._buildProduct = "";
|
|
149
197
|
}
|
|
150
198
|
|
|
199
|
+
// Carrier name from expo-cellular's sync constant (empty when absent).
|
|
200
|
+
this._carrierInfo = loadExpoCellular()?.carrier?.trim() ?? "";
|
|
201
|
+
|
|
151
202
|
// Fire-and-forget warmup of the async network fields. The
|
|
152
203
|
// promise is intentionally unawaited — capture flows take
|
|
153
204
|
// several seconds before the first `make()`, by which time
|
|
@@ -206,7 +257,86 @@ export class UseSmileIDMetadataFactory implements MetadataProvider {
|
|
|
206
257
|
/* leave the cached empty string */
|
|
207
258
|
})
|
|
208
259
|
: Promise.resolve();
|
|
209
|
-
await Promise.all([
|
|
260
|
+
await Promise.all([
|
|
261
|
+
stateResult,
|
|
262
|
+
ipResult,
|
|
263
|
+
this._warmUpBatteryStatus(),
|
|
264
|
+
this._warmUpLaunchCount(),
|
|
265
|
+
this._warmUpGeolocation(),
|
|
266
|
+
this._warmUpPrivileges(),
|
|
267
|
+
this._warmUpDeviceIntegrity(),
|
|
268
|
+
]);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Resolve the last-known location (expo-location) into the cache — only when a permission
|
|
273
|
+
* is already granted (never prompts). Fail-open: leaves `_geolocation` unset otherwise.
|
|
274
|
+
*/
|
|
275
|
+
private async _warmUpGeolocation(): Promise<void> {
|
|
276
|
+
const geolocation = await resolveGeolocation();
|
|
277
|
+
if (geolocation) this._geolocation = geolocation;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Resolve the obfuscated device privileges signal from the native bridge into the cache.
|
|
282
|
+
* Fail-open: `PrivilegesProvider` returns `"{}"` when the native module is unavailable.
|
|
283
|
+
*/
|
|
284
|
+
private async _warmUpPrivileges(): Promise<void> {
|
|
285
|
+
const privileges = await PrivilegesProvider.privileges();
|
|
286
|
+
if (privileges.length > 0) this._privileges = privileges;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Resolve the native device-integrity signals (fingerprint, package name, vpn, build
|
|
291
|
+
* hardware, install source, cert digests) from the bridge into the cache. Fail-open:
|
|
292
|
+
* `DeviceIntegrityProvider` returns empty/undefined values when the native module is absent.
|
|
293
|
+
*/
|
|
294
|
+
private async _warmUpDeviceIntegrity(): Promise<void> {
|
|
295
|
+
this._deviceIntegrity = await DeviceIntegrityProvider.signals();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Read, increment, and persist the SDK launch counter via async-storage.
|
|
300
|
+
* Fail-open: leaves `_sdkLaunchCount` unset when the package is absent.
|
|
301
|
+
*/
|
|
302
|
+
private async _warmUpLaunchCount(): Promise<void> {
|
|
303
|
+
const store = loadAsyncStorage();
|
|
304
|
+
if (!store) return;
|
|
305
|
+
try {
|
|
306
|
+
const current = Number(await store.getItem(LAUNCH_COUNT_KEY)) || 0;
|
|
307
|
+
const next = current + 1;
|
|
308
|
+
await store.setItem(LAUNCH_COUNT_KEY, String(next));
|
|
309
|
+
this._sdkLaunchCount = next;
|
|
310
|
+
} catch {
|
|
311
|
+
/* leave _sdkLaunchCount unset */
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Resolve the charging state (expo-battery) into the cache, mapped to the
|
|
317
|
+
* cross-platform plug status: `-1` unknown, `0` on battery, `1` plugged in.
|
|
318
|
+
* Fail-open: leaves `_batteryStatus` unset when the module is absent.
|
|
319
|
+
*/
|
|
320
|
+
private async _warmUpBatteryStatus(): Promise<void> {
|
|
321
|
+
const battery = loadExpoBattery();
|
|
322
|
+
if (!battery) return;
|
|
323
|
+
try {
|
|
324
|
+
// expo-battery BatteryState: 0 unknown, 1 unplugged, 2 charging, 3 full.
|
|
325
|
+
const state = await battery.getBatteryStateAsync();
|
|
326
|
+
switch (state) {
|
|
327
|
+
case 1:
|
|
328
|
+
this._batteryStatus = 0;
|
|
329
|
+
break;
|
|
330
|
+
case 2:
|
|
331
|
+
case 3:
|
|
332
|
+
this._batteryStatus = 1;
|
|
333
|
+
break;
|
|
334
|
+
default:
|
|
335
|
+
this._batteryStatus = -1;
|
|
336
|
+
}
|
|
337
|
+
} catch {
|
|
338
|
+
/* leave _batteryStatus unset */
|
|
339
|
+
}
|
|
210
340
|
}
|
|
211
341
|
|
|
212
342
|
/**
|
|
@@ -261,6 +391,13 @@ export class UseSmileIDMetadataFactory implements MetadataProvider {
|
|
|
261
391
|
selfieDims?.width ?? CameraDefaults.selfieJpegTargetWidth;
|
|
262
392
|
const imageHeight =
|
|
263
393
|
selfieDims?.height ?? CameraDefaults.selfieJpegTargetHeight;
|
|
394
|
+
// Liveness frames use the same capture target as the selfie (480x640); the sdk_config
|
|
395
|
+
// liveness group overrides it when present.
|
|
396
|
+
const livenessDims = resolveDimensions(sdkConfig?.liveness);
|
|
397
|
+
const livenessImageWidth =
|
|
398
|
+
livenessDims?.width ?? CameraDefaults.selfieJpegTargetWidth;
|
|
399
|
+
const livenessImageHeight =
|
|
400
|
+
livenessDims?.height ?? CameraDefaults.selfieJpegTargetHeight;
|
|
264
401
|
|
|
265
402
|
const fields: UseSmileIDMetadataFields = {
|
|
266
403
|
sdkVersion: SDK_VERSION,
|
|
@@ -271,13 +408,14 @@ export class UseSmileIDMetadataFactory implements MetadataProvider {
|
|
|
271
408
|
sessionId: this._sessionId,
|
|
272
409
|
clientIp: this._clientIp,
|
|
273
410
|
networkConnection: this._networkConnection,
|
|
274
|
-
|
|
275
|
-
//
|
|
276
|
-
|
|
277
|
-
|
|
411
|
+
carrierInfo: this._carrierInfo,
|
|
412
|
+
// proxy / proximitySensor are not measurable without a native bridge;
|
|
413
|
+
// leaving them undefined keeps the keys off the wire rather than
|
|
414
|
+
// reporting an inaccurate false.
|
|
278
415
|
// Dynamic — re-resolved per submission so mid-flow changes
|
|
279
416
|
// (rotation, locale switch) are captured.
|
|
280
417
|
timezone: resolveTimezone(),
|
|
418
|
+
timezoneOffsetMinutes: resolveTimezoneOffsetMinutes(),
|
|
281
419
|
locale: resolveLocale(),
|
|
282
420
|
screenResolution: resolveScreenResolution(),
|
|
283
421
|
memoryInfoMb: this._memoryInfoMb,
|
|
@@ -285,13 +423,43 @@ export class UseSmileIDMetadataFactory implements MetadataProvider {
|
|
|
285
423
|
systemArchitecture: this._systemArchitecture,
|
|
286
424
|
numberOfCameras: 0,
|
|
287
425
|
hostApplication: this._hostApplication,
|
|
288
|
-
proximitySensor: false,
|
|
289
426
|
securityPolicyVersion: SECURITY_POLICY_VERSION,
|
|
290
427
|
...androidAttestation,
|
|
291
428
|
...iosAttestation,
|
|
292
429
|
sdkConfigSource,
|
|
293
430
|
imageWidth,
|
|
294
431
|
imageHeight,
|
|
432
|
+
livenessImageWidth,
|
|
433
|
+
livenessImageHeight,
|
|
434
|
+
buildBrand: this._buildBrand,
|
|
435
|
+
buildDevice: this._buildDevice,
|
|
436
|
+
buildFingerprint: this._buildFingerprint,
|
|
437
|
+
buildProduct: this._buildProduct,
|
|
438
|
+
buildHardware: this._deviceIntegrity?.buildHardware ?? "",
|
|
439
|
+
buildSource: this._deviceIntegrity?.buildSource ?? "",
|
|
440
|
+
packageName: this._deviceIntegrity?.packageName ?? "",
|
|
441
|
+
fingerprint: this._deviceIntegrity?.fingerprint ?? "",
|
|
442
|
+
localTimeOfEnrolment: resolveLocalTimeOfEnrolment(),
|
|
443
|
+
wrapperName: "react_native_expo",
|
|
444
|
+
wrapperVersion: SDK_VERSION,
|
|
445
|
+
...(this._deviceIntegrity?.vpn !== undefined
|
|
446
|
+
? { vpn: this._deviceIntegrity.vpn }
|
|
447
|
+
: {}),
|
|
448
|
+
...(this._deviceIntegrity?.certificateDigest !== undefined
|
|
449
|
+
? { certificateDigest: this._deviceIntegrity.certificateDigest }
|
|
450
|
+
: {}),
|
|
451
|
+
...(this._batteryStatus !== undefined
|
|
452
|
+
? { batteryStatus: this._batteryStatus }
|
|
453
|
+
: {}),
|
|
454
|
+
...(this._sdkLaunchCount !== undefined
|
|
455
|
+
? { sdkLaunchCount: this._sdkLaunchCount }
|
|
456
|
+
: {}),
|
|
457
|
+
...(this._geolocation !== undefined
|
|
458
|
+
? { geolocation: this._geolocation }
|
|
459
|
+
: {}),
|
|
460
|
+
...(this._privileges !== undefined
|
|
461
|
+
? { privileges: this._privileges }
|
|
462
|
+
: {}),
|
|
295
463
|
};
|
|
296
464
|
return new UseSmileIDMetadata(fields);
|
|
297
465
|
}
|
|
@@ -300,20 +468,39 @@ export class UseSmileIDMetadataFactory implements MetadataProvider {
|
|
|
300
468
|
// --- field resolvers --------------------------------------------------------
|
|
301
469
|
|
|
302
470
|
function resolveDeviceOs(): string {
|
|
303
|
-
//
|
|
304
|
-
// "iOS 17.4"
|
|
305
|
-
// "Android 14"
|
|
471
|
+
// `"iOS 17.4"` / `"Android 12"` — the shape the native EXIF tagger stamps.
|
|
306
472
|
const platform =
|
|
307
473
|
Platform.OS === "ios"
|
|
308
474
|
? "iOS"
|
|
309
475
|
: Platform.OS === "android"
|
|
310
476
|
? "Android"
|
|
311
477
|
: Platform.OS;
|
|
312
|
-
const version =
|
|
313
|
-
typeof Platform.Version !== "undefined" ? String(Platform.Version) : "";
|
|
478
|
+
const version = resolveOsVersion();
|
|
314
479
|
return version ? `${platform} ${version}` : platform;
|
|
315
480
|
}
|
|
316
481
|
|
|
482
|
+
function resolveOsVersion(): string {
|
|
483
|
+
if (Platform.OS === "android") {
|
|
484
|
+
const release = (
|
|
485
|
+
Platform.constants as { Release?: string | number } | undefined
|
|
486
|
+
)?.Release;
|
|
487
|
+
if (release !== undefined && release !== null && `${release}` !== "") {
|
|
488
|
+
return `${release}`;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
return typeof Platform.Version !== "undefined"
|
|
492
|
+
? String(Platform.Version)
|
|
493
|
+
: "";
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function resolveLocalTimeOfEnrolment(): string {
|
|
497
|
+
try {
|
|
498
|
+
return new Date().toISOString();
|
|
499
|
+
} catch {
|
|
500
|
+
return "";
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
317
504
|
function resolveTimezone(): string {
|
|
318
505
|
try {
|
|
319
506
|
return Intl.DateTimeFormat().resolvedOptions().timeZone ?? "";
|
|
@@ -322,6 +509,14 @@ function resolveTimezone(): string {
|
|
|
322
509
|
}
|
|
323
510
|
}
|
|
324
511
|
|
|
512
|
+
/**
|
|
513
|
+
* Current device offset from UTC in minutes (negative west of UTC). `Date.getTimezoneOffset`
|
|
514
|
+
* returns minutes *behind* UTC (positive west), so negate it to report the UTC offset.
|
|
515
|
+
*/
|
|
516
|
+
function resolveTimezoneOffsetMinutes(): number {
|
|
517
|
+
return -new Date().getTimezoneOffset();
|
|
518
|
+
}
|
|
519
|
+
|
|
325
520
|
function resolveLocale(): string {
|
|
326
521
|
try {
|
|
327
522
|
return Intl.DateTimeFormat().resolvedOptions().locale ?? "";
|