@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
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { GlobalPrivacyControl } from "../core/models/global_privacy_control";
|
|
2
|
+
import { AnalyzerFactoryKey } from "@smileid/usesmileid_bridge";
|
|
3
|
+
|
|
4
|
+
import { CaptureType } from "../core/models/ml_config";
|
|
5
|
+
import { autoCaptureWireValue } from "../core/models/document_capture_mode";
|
|
6
|
+
import type { FlowConfiguration } from "../presentation/flow/config/flow_configuration";
|
|
7
|
+
import type {
|
|
8
|
+
CaptureConfigBuilder,
|
|
9
|
+
ConsentConfigBuilder,
|
|
10
|
+
} from "../presentation/flow/dsl/builder/screens_builder";
|
|
11
|
+
import {
|
|
12
|
+
type BuilderConfiguration,
|
|
13
|
+
builderConfigurationToJson,
|
|
14
|
+
} from "./builder_configuration";
|
|
15
|
+
import {
|
|
16
|
+
MODEL_DESCRIPTOR_UNKNOWN,
|
|
17
|
+
type ModelConfiguration,
|
|
18
|
+
type ModelDescriptor,
|
|
19
|
+
ModelProvider,
|
|
20
|
+
modelConfigurationToJson,
|
|
21
|
+
} from "./model_configuration";
|
|
22
|
+
import type { MetadataEntry } from "./use_smile_id_metadata";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Projects the resolved [FlowConfiguration] into the request-metadata
|
|
26
|
+
* configuration objects, so the telemetry layer never needs a parallel copy of
|
|
27
|
+
* the partner's choices.
|
|
28
|
+
*
|
|
29
|
+
* Fields that do not apply to the assembled flow report their accurate "absent"
|
|
30
|
+
* value (`false`, or `autocapture_default` for the capture mode) rather than
|
|
31
|
+
* being omitted, so the object always carries the full schema.
|
|
32
|
+
* `consent_icon_dimensions` is always `null`: the consent icon is a `ReactNode`
|
|
33
|
+
* with no measurable pixel size at configuration time.
|
|
34
|
+
*/
|
|
35
|
+
export function flowConfigurationToBuilderConfiguration(
|
|
36
|
+
configuration: FlowConfiguration,
|
|
37
|
+
): BuilderConfiguration {
|
|
38
|
+
const steps = configuration.screens.steps;
|
|
39
|
+
|
|
40
|
+
let consent: ConsentConfigBuilder | undefined;
|
|
41
|
+
const captures: CaptureConfigBuilder[] = [];
|
|
42
|
+
let instructionsUsed = false;
|
|
43
|
+
let previewUsed = false;
|
|
44
|
+
let processingUsed = false;
|
|
45
|
+
for (const step of steps) {
|
|
46
|
+
switch (step.kind) {
|
|
47
|
+
case "consent":
|
|
48
|
+
consent = step.config;
|
|
49
|
+
break;
|
|
50
|
+
case "instructions":
|
|
51
|
+
instructionsUsed = true;
|
|
52
|
+
break;
|
|
53
|
+
case "capture":
|
|
54
|
+
captures.push(step.config);
|
|
55
|
+
break;
|
|
56
|
+
case "preview":
|
|
57
|
+
previewUsed = true;
|
|
58
|
+
break;
|
|
59
|
+
case "processing":
|
|
60
|
+
processingUsed = true;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const selfie = captures.find((capture) => capture.selfieConfig)?.selfieConfig;
|
|
66
|
+
const document = captures.find(
|
|
67
|
+
(capture) => capture.documentConfig,
|
|
68
|
+
)?.documentConfig;
|
|
69
|
+
const hasSelfieCapture =
|
|
70
|
+
selfie !== undefined ||
|
|
71
|
+
captures.some((capture) => capture.captureType === CaptureType.selfie);
|
|
72
|
+
const hasDocumentCapture =
|
|
73
|
+
document !== undefined ||
|
|
74
|
+
captures.some((capture) => capture.captureType === CaptureType.document);
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
consentScreenUsed: consent !== undefined,
|
|
78
|
+
consentIconProvided: consent?.partnerIcon != null,
|
|
79
|
+
// A React Native consent icon is a ReactNode with no measurable pixel size.
|
|
80
|
+
consentIconDimensions: null,
|
|
81
|
+
consentAttributionShown: consent?.showAttribution ?? false,
|
|
82
|
+
instructionsScreenUsed: instructionsUsed,
|
|
83
|
+
selfiePreviewEnabled: previewUsed && hasSelfieCapture,
|
|
84
|
+
documentPreviewEnabled: previewUsed && hasDocumentCapture,
|
|
85
|
+
// No processing screen means the flow captures without submitting to the API.
|
|
86
|
+
submissionSkipped: !processingUsed,
|
|
87
|
+
allowAgentMode: selfie?.allowAgentMode ?? false,
|
|
88
|
+
enhancedLivenessEnabled: selfie?.enableEnhancedLiveness ?? false,
|
|
89
|
+
autoCaptureEnabled: autoCaptureWireValue(document?.captureMode),
|
|
90
|
+
allowGalleryUpload: document?.allowGalleryUpload ?? false,
|
|
91
|
+
captureBothSides: document?.captureBothSides ?? false,
|
|
92
|
+
allowSkipBack: document?.allowSkipBack ?? false,
|
|
93
|
+
globalPrivacyControl:
|
|
94
|
+
configuration.config?.globalPrivacyControl ?? GlobalPrivacyControl.OptOut,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Describes the face and document models backing this flow.
|
|
100
|
+
*
|
|
101
|
+
* The face model is resolved from the registered selfie analyzer factory key;
|
|
102
|
+
* the document model reports the native no-op fallback, since the React Native
|
|
103
|
+
* document detector is not selectable from JS.
|
|
104
|
+
*/
|
|
105
|
+
export function flowConfigurationToModelConfiguration(
|
|
106
|
+
configuration: FlowConfiguration,
|
|
107
|
+
): ModelConfiguration {
|
|
108
|
+
const faceKey = configuration.ml?.analyzers.selfieConfig?.analyzerFactoryKey;
|
|
109
|
+
return {
|
|
110
|
+
faceModel: faceDescriptorOf(faceKey),
|
|
111
|
+
documentModel: NOOP_DOCUMENT_DESCRIPTOR,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The `builder_configuration_object` + `model_configuration_object` wire
|
|
117
|
+
* entries, encoded as JSON-string values so the metadata payload stays a flat
|
|
118
|
+
* `{name, value}` array.
|
|
119
|
+
*/
|
|
120
|
+
export function configurationMetadataEntries(
|
|
121
|
+
configuration: FlowConfiguration,
|
|
122
|
+
): MetadataEntry[] {
|
|
123
|
+
const entries: MetadataEntry[] = [
|
|
124
|
+
{
|
|
125
|
+
name: "builder_configuration_object",
|
|
126
|
+
value: JSON.stringify(
|
|
127
|
+
builderConfigurationToJson(
|
|
128
|
+
flowConfigurationToBuilderConfiguration(configuration),
|
|
129
|
+
),
|
|
130
|
+
),
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "model_configuration_object",
|
|
134
|
+
value: JSON.stringify(
|
|
135
|
+
modelConfigurationToJson(
|
|
136
|
+
flowConfigurationToModelConfiguration(configuration),
|
|
137
|
+
),
|
|
138
|
+
),
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
// Flow-derived selfie liveness telemetry — appended only for selfie flows.
|
|
143
|
+
const liveness = flowConfigurationToSelfieLivenessTelemetry(configuration);
|
|
144
|
+
if (liveness.activeLivenessType !== null) {
|
|
145
|
+
entries.push(
|
|
146
|
+
{ name: "active_liveness_type", value: liveness.activeLivenessType },
|
|
147
|
+
{
|
|
148
|
+
name: "active_liveness_version",
|
|
149
|
+
value: liveness.activeLivenessVersion,
|
|
150
|
+
},
|
|
151
|
+
{ name: "selfie_image_origin", value: liveness.selfieImageOrigin },
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
return entries;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
type SelfieLivenessTelemetry =
|
|
158
|
+
| {
|
|
159
|
+
readonly activeLivenessType: string;
|
|
160
|
+
readonly activeLivenessVersion: string;
|
|
161
|
+
readonly selfieImageOrigin: string;
|
|
162
|
+
}
|
|
163
|
+
| {
|
|
164
|
+
readonly activeLivenessType: null;
|
|
165
|
+
readonly activeLivenessVersion: null;
|
|
166
|
+
readonly selfieImageOrigin: null;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Flow-derived selfie liveness telemetry. All-`null` for flows without a selfie
|
|
171
|
+
* capture; otherwise the active-liveness check, the version, and the lens the
|
|
172
|
+
* selfie came from (the selfie SDK has no gallery path).
|
|
173
|
+
*/
|
|
174
|
+
export function flowConfigurationToSelfieLivenessTelemetry(
|
|
175
|
+
configuration: FlowConfiguration,
|
|
176
|
+
): SelfieLivenessTelemetry {
|
|
177
|
+
let selfie: SelfieLivenessSource;
|
|
178
|
+
let hasSelfieCapture = false;
|
|
179
|
+
for (const step of configuration.screens.steps) {
|
|
180
|
+
if (step.kind === "capture") {
|
|
181
|
+
selfie ??= step.config.selfieConfig;
|
|
182
|
+
if (step.config.captureType === CaptureType.selfie) {
|
|
183
|
+
hasSelfieCapture = true;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (!hasSelfieCapture && selfie === undefined) {
|
|
188
|
+
return {
|
|
189
|
+
activeLivenessType: null,
|
|
190
|
+
activeLivenessVersion: null,
|
|
191
|
+
selfieImageOrigin: null,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
activeLivenessType: activeLivenessTypeOf(selfie),
|
|
196
|
+
activeLivenessVersion: "2.0.0",
|
|
197
|
+
selfieImageOrigin: selfieImageOriginOf(selfie),
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
type SelfieLivenessSource =
|
|
202
|
+
| { enableEnhancedLiveness: boolean; allowAgentMode?: boolean }
|
|
203
|
+
| undefined;
|
|
204
|
+
|
|
205
|
+
function activeLivenessTypeOf(selfie: SelfieLivenessSource): string {
|
|
206
|
+
return selfie?.enableEnhancedLiveness ? "head_pose" : "smile";
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function selfieImageOriginOf(selfie: SelfieLivenessSource): string {
|
|
210
|
+
return selfie?.allowAgentMode ? "back_camera" : "front_camera";
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function faceDescriptorOf(
|
|
214
|
+
key: AnalyzerFactoryKey | undefined,
|
|
215
|
+
): ModelDescriptor {
|
|
216
|
+
switch (key) {
|
|
217
|
+
case AnalyzerFactoryKey.MLKitFace:
|
|
218
|
+
return {
|
|
219
|
+
provider: ModelProvider.Google,
|
|
220
|
+
name: "play-services-mlkit-face-detection",
|
|
221
|
+
version: "17.1.0",
|
|
222
|
+
bundled: false,
|
|
223
|
+
};
|
|
224
|
+
case AnalyzerFactoryKey.HuaweiFace:
|
|
225
|
+
return {
|
|
226
|
+
provider: ModelProvider.Huawei,
|
|
227
|
+
name: "ml-computer-vision-face",
|
|
228
|
+
version: "3.18.1.300",
|
|
229
|
+
bundled: false,
|
|
230
|
+
};
|
|
231
|
+
case AnalyzerFactoryKey.VisionFace:
|
|
232
|
+
return {
|
|
233
|
+
provider: ModelProvider.Apple,
|
|
234
|
+
name: "vision_face_detector",
|
|
235
|
+
version: "system",
|
|
236
|
+
bundled: true,
|
|
237
|
+
};
|
|
238
|
+
default:
|
|
239
|
+
return MODEL_DESCRIPTOR_UNKNOWN;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const NOOP_DOCUMENT_DESCRIPTOR: ModelDescriptor = {
|
|
244
|
+
provider: ModelProvider.Smile,
|
|
245
|
+
name: "noop_document_detector",
|
|
246
|
+
version: "12.0.1",
|
|
247
|
+
bundled: true,
|
|
248
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side detection-model metadata appended to a job request as the
|
|
3
|
+
* `model_configuration_object` entry, so the server can attribute face /
|
|
4
|
+
* document detection behaviour to a concrete component and version during
|
|
5
|
+
* fraud analysis.
|
|
6
|
+
*
|
|
7
|
+
* `ModelProvider` is a stable lowercase wire token; `apple` covers detectors
|
|
8
|
+
* backed by Apple's Vision framework on iOS. New providers are additive.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const ModelProvider = {
|
|
12
|
+
Google: "google",
|
|
13
|
+
Huawei: "huawei",
|
|
14
|
+
Smile: "smile",
|
|
15
|
+
Apple: "apple",
|
|
16
|
+
Custom: "custom",
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export type ModelProvider = (typeof ModelProvider)[keyof typeof ModelProvider];
|
|
20
|
+
|
|
21
|
+
export type ModelDescriptor = {
|
|
22
|
+
readonly provider: ModelProvider;
|
|
23
|
+
/** Human-readable model identifier (e.g. the native artefact id). */
|
|
24
|
+
readonly name: string;
|
|
25
|
+
/** The model / framework version in use on the device. */
|
|
26
|
+
readonly version: string;
|
|
27
|
+
/** `true` when the model ships with the app / OS, `false` when downloaded on demand. */
|
|
28
|
+
readonly bundled: boolean;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Placeholder used when the active model for a capture type cannot be
|
|
33
|
+
* resolved, so the `model_configuration_object` always carries both
|
|
34
|
+
* `face_model` and `document_model` rather than omitting a side.
|
|
35
|
+
*/
|
|
36
|
+
export const MODEL_DESCRIPTOR_UNKNOWN: ModelDescriptor = Object.freeze({
|
|
37
|
+
provider: ModelProvider.Custom,
|
|
38
|
+
name: "unknown",
|
|
39
|
+
version: "unknown",
|
|
40
|
+
bundled: false,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export type ModelConfiguration = {
|
|
44
|
+
readonly faceModel: ModelDescriptor;
|
|
45
|
+
readonly documentModel: ModelDescriptor;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** Serialises a [ModelDescriptor] to its snake_case wire object. */
|
|
49
|
+
export function modelDescriptorToJson(
|
|
50
|
+
descriptor: ModelDescriptor,
|
|
51
|
+
): Record<string, unknown> {
|
|
52
|
+
return {
|
|
53
|
+
provider: descriptor.provider,
|
|
54
|
+
name: descriptor.name,
|
|
55
|
+
version: descriptor.version,
|
|
56
|
+
bundled: descriptor.bundled,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Serialises a [ModelConfiguration] to its snake_case wire object. */
|
|
61
|
+
export function modelConfigurationToJson(
|
|
62
|
+
configuration: ModelConfiguration,
|
|
63
|
+
): Record<string, unknown> {
|
|
64
|
+
return {
|
|
65
|
+
face_model: modelDescriptorToJson(configuration.faceModel),
|
|
66
|
+
document_model: modelDescriptorToJson(configuration.documentModel),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Lazy bridges to optional `expo-device` / `expo-network`
|
|
3
|
-
*
|
|
4
|
-
* partners who don't need richer metadata don't pay
|
|
2
|
+
* Lazy bridges to optional `expo-device` / `expo-network` / `expo-battery` /
|
|
3
|
+
* `expo-cellular` peer deps. All are declared `optional: true` in
|
|
4
|
+
* `peerDependenciesMeta` so partners who don't need richer metadata don't pay
|
|
5
|
+
* the install cost.
|
|
5
6
|
*
|
|
6
7
|
* **Pattern:** dynamic `require()` wrapped in `try/catch`. Metro
|
|
7
8
|
* tolerates the missing-module case without failing the build —
|
|
@@ -19,6 +20,14 @@ type DeviceModule = {
|
|
|
19
20
|
readonly brand?: string | null;
|
|
20
21
|
readonly supportedCpuArchitectures?: readonly string[] | null;
|
|
21
22
|
readonly totalMemory?: number | null;
|
|
23
|
+
// Android `Build.DEVICE`; iOS leaves this null (use `modelId` instead).
|
|
24
|
+
readonly designName?: string | null;
|
|
25
|
+
// Android `Build.PRODUCT`.
|
|
26
|
+
readonly productName?: string | null;
|
|
27
|
+
// Android `Build.FINGERPRINT`.
|
|
28
|
+
readonly osBuildFingerprint?: string | null;
|
|
29
|
+
// iOS hardware identifier (e.g. `iPhone16,2`).
|
|
30
|
+
readonly modelId?: string | null;
|
|
22
31
|
};
|
|
23
32
|
|
|
24
33
|
type NetworkModule = {
|
|
@@ -30,8 +39,53 @@ type NetworkModule = {
|
|
|
30
39
|
getIpAddressAsync?(): Promise<string>;
|
|
31
40
|
};
|
|
32
41
|
|
|
42
|
+
type BatteryModule = {
|
|
43
|
+
// expo-battery `BatteryState`: 0 unknown, 1 unplugged, 2 charging, 3 full.
|
|
44
|
+
getBatteryStateAsync(): Promise<number>;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type CellularModule = {
|
|
48
|
+
// Carrier name constant (may be null on Wi-Fi-only / dual-SIM devices).
|
|
49
|
+
readonly carrier?: string | null;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type AsyncStorageModule = {
|
|
53
|
+
getItem(key: string): Promise<string | null>;
|
|
54
|
+
setItem(key: string, value: string): Promise<void>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** Subscription returned by `Accelerometer.addListener`. */
|
|
58
|
+
export type AccelerometerSubscription = { remove(): void };
|
|
59
|
+
|
|
60
|
+
/** Minimal `expo-sensors` surface used for device_positions / device_movement_detected. */
|
|
61
|
+
type SensorsModule = {
|
|
62
|
+
Accelerometer: {
|
|
63
|
+
setUpdateInterval(intervalMs: number): void;
|
|
64
|
+
addListener(
|
|
65
|
+
listener: (data: { x: number; y: number; z: number }) => void,
|
|
66
|
+
): AccelerometerSubscription;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** Minimal `expo-location` surface used for the geolocation metadata. */
|
|
71
|
+
type LocationModule = {
|
|
72
|
+
getForegroundPermissionsAsync(): Promise<{ granted: boolean }>;
|
|
73
|
+
getLastKnownPositionAsync(): Promise<{
|
|
74
|
+
coords: {
|
|
75
|
+
latitude: number;
|
|
76
|
+
longitude: number;
|
|
77
|
+
accuracy: number | null;
|
|
78
|
+
};
|
|
79
|
+
} | null>;
|
|
80
|
+
};
|
|
81
|
+
|
|
33
82
|
let _device: DeviceModule | null | undefined;
|
|
34
83
|
let _network: NetworkModule | null | undefined;
|
|
84
|
+
let _battery: BatteryModule | null | undefined;
|
|
85
|
+
let _cellular: CellularModule | null | undefined;
|
|
86
|
+
let _asyncStorage: AsyncStorageModule | null | undefined;
|
|
87
|
+
let _sensors: SensorsModule | null | undefined;
|
|
88
|
+
let _location: LocationModule | null | undefined;
|
|
35
89
|
|
|
36
90
|
/**
|
|
37
91
|
* Load `expo-device`'s native module once, cached for the process
|
|
@@ -113,8 +167,108 @@ export function loadExpoNetwork(): NetworkModule | null {
|
|
|
113
167
|
return _network;
|
|
114
168
|
}
|
|
115
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Load `expo-battery`'s native module once, cached for the process lifetime.
|
|
172
|
+
* Returns `null` when the native module isn't linked (graceful degradation).
|
|
173
|
+
* Mirrors [loadExpoDevice] — pulls the raw `ExpoBattery` native module via
|
|
174
|
+
* `expo-modules-core`'s non-throwing `requireOptionalNativeModule`.
|
|
175
|
+
*/
|
|
176
|
+
export function loadExpoBattery(): BatteryModule | null {
|
|
177
|
+
if (_battery !== undefined) return _battery;
|
|
178
|
+
try {
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
180
|
+
const core = require("expo-modules-core") as {
|
|
181
|
+
requireOptionalNativeModule?: <T>(name: string) => T | null;
|
|
182
|
+
};
|
|
183
|
+
_battery =
|
|
184
|
+
core.requireOptionalNativeModule?.<BatteryModule>("ExpoBattery") ?? null;
|
|
185
|
+
} catch {
|
|
186
|
+
_battery = null;
|
|
187
|
+
}
|
|
188
|
+
return _battery;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Load `expo-cellular`'s native module once, cached for the process lifetime.
|
|
193
|
+
* Returns `null` when the native module isn't linked (graceful degradation).
|
|
194
|
+
* The raw `ExpoCellular` module exposes the `carrier` name constant directly.
|
|
195
|
+
*/
|
|
196
|
+
export function loadExpoCellular(): CellularModule | null {
|
|
197
|
+
if (_cellular !== undefined) return _cellular;
|
|
198
|
+
try {
|
|
199
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
200
|
+
const core = require("expo-modules-core") as {
|
|
201
|
+
requireOptionalNativeModule?: <T>(name: string) => T | null;
|
|
202
|
+
};
|
|
203
|
+
_cellular =
|
|
204
|
+
core.requireOptionalNativeModule?.<CellularModule>("ExpoCellular") ??
|
|
205
|
+
null;
|
|
206
|
+
} catch {
|
|
207
|
+
_cellular = null;
|
|
208
|
+
}
|
|
209
|
+
return _cellular;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Load `@react-native-async-storage/async-storage` once, cached for the process
|
|
214
|
+
* lifetime. Returns `null` when the package isn't installed (graceful
|
|
215
|
+
* degradation). Unlike the expo modules, async-storage's JS entry does not throw
|
|
216
|
+
* at import when the native side is missing, so a plain `require` (wrapped in
|
|
217
|
+
* try/catch for the not-installed case) is sufficient; per-call native errors
|
|
218
|
+
* are handled by the caller. Backed by Android `SharedPreferences` /
|
|
219
|
+
* iOS `NSUserDefaults`.
|
|
220
|
+
*/
|
|
221
|
+
export function loadAsyncStorage(): AsyncStorageModule | null {
|
|
222
|
+
if (_asyncStorage !== undefined) return _asyncStorage;
|
|
223
|
+
try {
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
225
|
+
const module = require("@react-native-async-storage/async-storage") as {
|
|
226
|
+
default?: AsyncStorageModule;
|
|
227
|
+
} & AsyncStorageModule;
|
|
228
|
+
_asyncStorage = module.default ?? module;
|
|
229
|
+
} catch {
|
|
230
|
+
_asyncStorage = null;
|
|
231
|
+
}
|
|
232
|
+
return _asyncStorage;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Load `expo-sensors` for accelerometer sampling. Returns `null` when the peer
|
|
237
|
+
* dep isn't installed/linked (graceful degradation — device_positions omitted).
|
|
238
|
+
*/
|
|
239
|
+
export function loadExpoSensors(): SensorsModule | null {
|
|
240
|
+
if (_sensors !== undefined) return _sensors;
|
|
241
|
+
try {
|
|
242
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
243
|
+
_sensors = require("expo-sensors") as SensorsModule;
|
|
244
|
+
} catch {
|
|
245
|
+
_sensors = null;
|
|
246
|
+
}
|
|
247
|
+
return _sensors;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Load `expo-location` for the geolocation metadata. Returns `null` when the
|
|
252
|
+
* peer dep isn't installed/linked (graceful degradation — geolocation omitted).
|
|
253
|
+
*/
|
|
254
|
+
export function loadExpoLocation(): LocationModule | null {
|
|
255
|
+
if (_location !== undefined) return _location;
|
|
256
|
+
try {
|
|
257
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
258
|
+
_location = require("expo-location") as LocationModule;
|
|
259
|
+
} catch {
|
|
260
|
+
_location = null;
|
|
261
|
+
}
|
|
262
|
+
return _location;
|
|
263
|
+
}
|
|
264
|
+
|
|
116
265
|
/** Test-only seam — clears the module cache so tests can re-evaluate. */
|
|
117
266
|
export function _resetOptionalModulesForTesting(): void {
|
|
118
267
|
_device = undefined;
|
|
119
268
|
_network = undefined;
|
|
269
|
+
_battery = undefined;
|
|
270
|
+
_cellular = undefined;
|
|
271
|
+
_asyncStorage = undefined;
|
|
272
|
+
_sensors = undefined;
|
|
273
|
+
_location = undefined;
|
|
120
274
|
}
|