@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GlobalPrivacyControl } from "../../core/models/global_privacy_control";
|
|
1
2
|
const EU_COUNTRY_CODES: ReadonlySet<string> = new Set([
|
|
2
3
|
"AT",
|
|
3
4
|
"BE",
|
|
@@ -59,13 +60,21 @@ export function isDeviceLocaleInEU(
|
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
/**
|
|
62
|
-
* Returns the default consent checkbox state
|
|
63
|
+
* Returns the default consent checkbox state for the partner-declared
|
|
64
|
+
* `GlobalPrivacyControl` posture.
|
|
63
65
|
*
|
|
64
|
-
* -
|
|
65
|
-
* -
|
|
66
|
+
* - `GlobalPrivacyControl.OptOut` (default): ticked (`true`) universally —
|
|
67
|
+
* the opt-out layout is enforced for every session and the device region
|
|
68
|
+
* is never consulted.
|
|
69
|
+
* - `GlobalPrivacyControl.OptIn`: legacy regional mechanics — EU locales
|
|
70
|
+
* start unticked (`false`, explicit opt-in per GDPR), everywhere else
|
|
71
|
+
* starts ticked (`true`).
|
|
66
72
|
*/
|
|
67
73
|
export function getDefaultConsentState(
|
|
74
|
+
globalPrivacyControl: GlobalPrivacyControl = GlobalPrivacyControl.OptOut,
|
|
68
75
|
locale: string = getDeviceLocale(),
|
|
69
76
|
): boolean {
|
|
70
|
-
return
|
|
77
|
+
return globalPrivacyControl === GlobalPrivacyControl.OptOut
|
|
78
|
+
? true
|
|
79
|
+
: !isDeviceLocaleInEU(locale);
|
|
71
80
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { makeFakeFaceAnalyzer } from "../fake_face_analyzer";
|
|
3
|
+
|
|
4
|
+
const scenario = {
|
|
5
|
+
name: "selfie-happy-path",
|
|
6
|
+
captureType: "selfie",
|
|
7
|
+
steps: [
|
|
8
|
+
{ emit: "noFace", holdFrames: 2 },
|
|
9
|
+
{ emit: "faceCentered", holdFrames: 3 },
|
|
10
|
+
{ emit: "satisfied" },
|
|
11
|
+
],
|
|
12
|
+
} as const;
|
|
13
|
+
|
|
14
|
+
describe("FakeFaceAnalyzer", () => {
|
|
15
|
+
it("replays holdFrames per step and repeats the final step indefinitely", () => {
|
|
16
|
+
const fake = makeFakeFaceAnalyzer(scenario);
|
|
17
|
+
const emits = Array.from({ length: 9 }, () => fake.nextEmit());
|
|
18
|
+
expect(emits).toEqual([
|
|
19
|
+
"noFace",
|
|
20
|
+
"noFace",
|
|
21
|
+
"faceCentered",
|
|
22
|
+
"faceCentered",
|
|
23
|
+
"faceCentered",
|
|
24
|
+
"satisfied",
|
|
25
|
+
"satisfied",
|
|
26
|
+
"satisfied",
|
|
27
|
+
"satisfied",
|
|
28
|
+
]);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("records the JS lifecycle calls", async () => {
|
|
32
|
+
const fake = makeFakeFaceAnalyzer(scenario);
|
|
33
|
+
await fake.configure();
|
|
34
|
+
await fake.reset();
|
|
35
|
+
await fake.flush();
|
|
36
|
+
await fake.close();
|
|
37
|
+
expect(fake.configureCallCount).toBe(1);
|
|
38
|
+
expect(fake.resetCallCount).toBe(1);
|
|
39
|
+
expect(fake.flushCallCount).toBe(1);
|
|
40
|
+
expect(fake.closeCallCount).toBe(1);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import {
|
|
6
|
+
expectSubsetInOrder,
|
|
7
|
+
parseScenarioExpectations,
|
|
8
|
+
} from "../scenario_expectations";
|
|
9
|
+
|
|
10
|
+
// Read the canonical shared scenario at run time (see the capture-screen test
|
|
11
|
+
// for the same rationale) so a drift in the shared `expected` block is caught
|
|
12
|
+
// here per-PR rather than silently diverging.
|
|
13
|
+
const scenarioDir = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const selfieScenario = JSON.parse(
|
|
15
|
+
readFileSync(
|
|
16
|
+
join(scenarioDir, "../../../../e2e/scenarios/selfie-happy-path.json"),
|
|
17
|
+
"utf8",
|
|
18
|
+
),
|
|
19
|
+
) as unknown;
|
|
20
|
+
|
|
21
|
+
const agentModeScenario = JSON.parse(
|
|
22
|
+
readFileSync(
|
|
23
|
+
join(scenarioDir, "../../../../e2e/scenarios/selfie-agent-mode.json"),
|
|
24
|
+
"utf8",
|
|
25
|
+
),
|
|
26
|
+
) as unknown;
|
|
27
|
+
|
|
28
|
+
describe("parseScenarioExpectations", () => {
|
|
29
|
+
// Nothing is relaxed for the agent, so the shared script must carry the same
|
|
30
|
+
// terminal contract as the front-camera happy path.
|
|
31
|
+
it("gives the shared agent-mode scenario the same terminal contract as the happy path", () => {
|
|
32
|
+
const agentMode = parseScenarioExpectations(agentModeScenario);
|
|
33
|
+
const happyPath = parseScenarioExpectations(selfieScenario);
|
|
34
|
+
expect(agentMode.screens).toEqual(happyPath.screens);
|
|
35
|
+
expect(agentMode.events).toEqual(happyPath.events);
|
|
36
|
+
expect(agentMode.terminal).toBe("submitted");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("surfaces the shared selfie scenario's expected screens/events/terminal", () => {
|
|
40
|
+
const expected = parseScenarioExpectations(selfieScenario);
|
|
41
|
+
expect(expected.screens).toEqual([
|
|
42
|
+
"consent",
|
|
43
|
+
"instructions",
|
|
44
|
+
"capture",
|
|
45
|
+
"preview",
|
|
46
|
+
"processing",
|
|
47
|
+
]);
|
|
48
|
+
expect(expected.events).toEqual([
|
|
49
|
+
"flow_started",
|
|
50
|
+
"consent_captured",
|
|
51
|
+
"selfie_captured",
|
|
52
|
+
"job_submitted",
|
|
53
|
+
"flow_completed",
|
|
54
|
+
]);
|
|
55
|
+
expect(expected.terminal).toBe("submitted");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("defaults to empty arrays when the block is absent", () => {
|
|
59
|
+
const expected = parseScenarioExpectations({ name: "x" });
|
|
60
|
+
expect(expected.screens).toEqual([]);
|
|
61
|
+
expect(expected.events).toEqual([]);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("rejects a malformed expected block", () => {
|
|
65
|
+
expect(() =>
|
|
66
|
+
parseScenarioExpectations({ expected: { screens: [1, 2] } }),
|
|
67
|
+
).toThrow(/must be an array of strings/);
|
|
68
|
+
expect(() =>
|
|
69
|
+
parseScenarioExpectations({ expected: { terminal: "exploded" } }),
|
|
70
|
+
).toThrow(/terminal must be one of/);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe("expectSubsetInOrder", () => {
|
|
75
|
+
it("passes when every expected item appears in order (interleaving allowed)", () => {
|
|
76
|
+
const { screens, events } = parseScenarioExpectations(selfieScenario);
|
|
77
|
+
// Recorded stream may carry extra, unlisted events between the required
|
|
78
|
+
// ones — the contract is subset-in-order, not exact match.
|
|
79
|
+
const recordedEvents = [
|
|
80
|
+
"flow_started",
|
|
81
|
+
"screen_viewed",
|
|
82
|
+
"consent_captured",
|
|
83
|
+
"screen_viewed",
|
|
84
|
+
"selfie_captured",
|
|
85
|
+
"image_quality_ok",
|
|
86
|
+
"job_submitted",
|
|
87
|
+
"flow_completed",
|
|
88
|
+
];
|
|
89
|
+
expect(() => expectSubsetInOrder(recordedEvents, events)).not.toThrow();
|
|
90
|
+
expect(() => expectSubsetInOrder([...screens], screens)).not.toThrow();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("throws when an expected item is missing", () => {
|
|
94
|
+
expect(() =>
|
|
95
|
+
expectSubsetInOrder(
|
|
96
|
+
["flow_started", "flow_completed"],
|
|
97
|
+
["flow_started", "job_submitted", "flow_completed"],
|
|
98
|
+
),
|
|
99
|
+
).toThrow(/job_submitted/);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("throws when expected items appear out of order", () => {
|
|
103
|
+
expect(() =>
|
|
104
|
+
expectSubsetInOrder(
|
|
105
|
+
["flow_completed", "flow_started"],
|
|
106
|
+
["flow_started", "flow_completed"],
|
|
107
|
+
),
|
|
108
|
+
).toThrow(/to appear in order/);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { parseScriptedScenario } from "../scenario_loader";
|
|
3
|
+
|
|
4
|
+
describe("parseScriptedScenario", () => {
|
|
5
|
+
const valid = {
|
|
6
|
+
name: "selfie-happy-path",
|
|
7
|
+
captureType: "selfie",
|
|
8
|
+
steps: [
|
|
9
|
+
{ emit: "noFace", holdFrames: 10 },
|
|
10
|
+
{ emit: "faceCentered", holdFrames: 20 },
|
|
11
|
+
{ emit: "satisfied" },
|
|
12
|
+
],
|
|
13
|
+
// An `expected` block may ride alongside; the loader ignores extra keys.
|
|
14
|
+
expected: { screens: [], events: [], terminal: "submitted" },
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
it("returns the typed scenario for a valid shape", () => {
|
|
18
|
+
const scenario = parseScriptedScenario(valid);
|
|
19
|
+
expect(scenario.name).toBe("selfie-happy-path");
|
|
20
|
+
expect(scenario.captureType).toBe("selfie");
|
|
21
|
+
expect(scenario.steps).toHaveLength(3);
|
|
22
|
+
expect(scenario.steps[2]).toEqual({ emit: "satisfied" });
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("rejects an unknown emit (vocabulary drift)", () => {
|
|
26
|
+
expect(() =>
|
|
27
|
+
parseScriptedScenario({
|
|
28
|
+
name: "x",
|
|
29
|
+
captureType: "selfie",
|
|
30
|
+
steps: [{ emit: "wink" }],
|
|
31
|
+
}),
|
|
32
|
+
).toThrow(/not a known emission/);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("rejects an unknown captureType", () => {
|
|
36
|
+
expect(() =>
|
|
37
|
+
parseScriptedScenario({
|
|
38
|
+
name: "x",
|
|
39
|
+
captureType: "iris",
|
|
40
|
+
steps: [{ emit: "noFace" }],
|
|
41
|
+
}),
|
|
42
|
+
).toThrow(/captureType/);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("rejects empty steps", () => {
|
|
46
|
+
expect(() =>
|
|
47
|
+
parseScriptedScenario({ name: "x", captureType: "selfie", steps: [] }),
|
|
48
|
+
).toThrow(/non-empty/);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("rejects a non-integer holdFrames", () => {
|
|
52
|
+
expect(() =>
|
|
53
|
+
parseScriptedScenario({
|
|
54
|
+
name: "x",
|
|
55
|
+
captureType: "selfie",
|
|
56
|
+
steps: [{ emit: "noFace", holdFrames: 1.5 }],
|
|
57
|
+
}),
|
|
58
|
+
).toThrow(/holdFrames/);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("rejects a non-object input", () => {
|
|
62
|
+
expect(() => parseScriptedScenario("nope")).toThrow(/JSON object/);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { FaceAnalyzer } from "@smileid/usesmileid_platform_interface";
|
|
2
|
+
import { AnalyzerFactoryKey } from "@smileid/usesmileid_bridge";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Deterministic fake face analyzer for scripted-scenario E2E runs. Exported
|
|
6
|
+
* only behind the `@smileid/usesmileid/testing` subpath so it cannot leak into
|
|
7
|
+
* partner production bundles.
|
|
8
|
+
*
|
|
9
|
+
* Per-frame detection runs in the provider's native frame-processor plugin
|
|
10
|
+
* (pixels never cross into JS), so `frameProcessorPluginName` points at a
|
|
11
|
+
* plugin that does not exist — the capture screen surfaces that as its
|
|
12
|
+
* camera-unavailable state. This fake covers the DSL registration seam and the
|
|
13
|
+
* capture-free flows; capture progression is driven via `onResult` instead.
|
|
14
|
+
*/
|
|
15
|
+
export interface ScriptedScenarioStep {
|
|
16
|
+
readonly emit: string;
|
|
17
|
+
readonly holdFrames?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ScriptedScenario {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly captureType: string;
|
|
23
|
+
readonly steps: readonly ScriptedScenarioStep[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class FakeFaceAnalyzer implements FaceAnalyzer {
|
|
27
|
+
readonly kind = "face" as const;
|
|
28
|
+
readonly key: AnalyzerFactoryKey = AnalyzerFactoryKey.MLKitFace;
|
|
29
|
+
readonly frameProcessorPluginName = "e2e-fake-face";
|
|
30
|
+
|
|
31
|
+
configureCallCount = 0;
|
|
32
|
+
resetCallCount = 0;
|
|
33
|
+
flushCallCount = 0;
|
|
34
|
+
closeCallCount = 0;
|
|
35
|
+
|
|
36
|
+
private stepIndex = 0;
|
|
37
|
+
private framesLeftInStep: number;
|
|
38
|
+
|
|
39
|
+
constructor(private readonly scenario: ScriptedScenario) {
|
|
40
|
+
this.framesLeftInStep = scenario.steps[0]?.holdFrames ?? 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Frame-by-frame cursor; the final step repeats indefinitely. */
|
|
44
|
+
nextEmit(): string {
|
|
45
|
+
const steps = this.scenario.steps;
|
|
46
|
+
const step = steps[this.stepIndex];
|
|
47
|
+
if (step === undefined) return "noFace";
|
|
48
|
+
if (this.stepIndex === steps.length - 1) return step.emit;
|
|
49
|
+
this.framesLeftInStep -= 1;
|
|
50
|
+
if (this.framesLeftInStep <= 0) {
|
|
51
|
+
this.stepIndex += 1;
|
|
52
|
+
this.framesLeftInStep = steps[this.stepIndex]?.holdFrames ?? 1;
|
|
53
|
+
}
|
|
54
|
+
return step.emit;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
configure(): Promise<void> {
|
|
58
|
+
this.configureCallCount += 1;
|
|
59
|
+
return Promise.resolve();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
reset(): Promise<void> {
|
|
63
|
+
this.resetCallCount += 1;
|
|
64
|
+
return Promise.resolve();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
flush(): Promise<void> {
|
|
68
|
+
this.flushCallCount += 1;
|
|
69
|
+
return Promise.resolve();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
close(): Promise<void> {
|
|
73
|
+
this.closeCallCount += 1;
|
|
74
|
+
return Promise.resolve();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function makeFakeFaceAnalyzer(
|
|
79
|
+
scenario: ScriptedScenario,
|
|
80
|
+
): FakeFaceAnalyzer {
|
|
81
|
+
return new FakeFaceAnalyzer(scenario);
|
|
82
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Test-support entry — exported behind the `@smileid/usesmileid/testing`
|
|
2
|
+
// subpath only. Nothing here may be re-exported from the main index.
|
|
3
|
+
export {
|
|
4
|
+
FakeFaceAnalyzer,
|
|
5
|
+
makeFakeFaceAnalyzer,
|
|
6
|
+
type ScriptedScenario,
|
|
7
|
+
type ScriptedScenarioStep,
|
|
8
|
+
} from "./fake_face_analyzer";
|
|
9
|
+
export { scriptedFaceScanResults } from "./scripted_scan_results";
|
|
10
|
+
export { parseScriptedScenario } from "./scenario_loader";
|
|
11
|
+
export {
|
|
12
|
+
type ScenarioExpectations,
|
|
13
|
+
parseScenarioExpectations,
|
|
14
|
+
expectSubsetInOrder,
|
|
15
|
+
} from "./scenario_expectations";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture-scoped expectations from the shared `e2e-scenarios` schema's `expected`
|
|
3
|
+
* block (screen + analytics-event names, terminal state). Framework-agnostic (no
|
|
4
|
+
* vitest/jest import) so a partner app's own e2e runner can reuse it.
|
|
5
|
+
*/
|
|
6
|
+
export interface ScenarioExpectations {
|
|
7
|
+
/** Ordered `screen_viewed` sequence for the canonical consent-first flow. */
|
|
8
|
+
readonly screens: readonly string[];
|
|
9
|
+
/** Ordered analytics event types that must fire (subset-in-order). */
|
|
10
|
+
readonly events: readonly string[];
|
|
11
|
+
/** How the capture session ends. */
|
|
12
|
+
readonly terminal?: "submitted" | "timeout" | "unsatisfied";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const TERMINALS: ReadonlySet<string> = new Set([
|
|
16
|
+
"submitted",
|
|
17
|
+
"timeout",
|
|
18
|
+
"unsatisfied",
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Extracts and validates the `expected` block from an already-parsed shared
|
|
23
|
+
* scenario JSON object. Returns empty screen/event arrays when the block is
|
|
24
|
+
* absent (older scenarios), and throws on a malformed block so drift fails
|
|
25
|
+
* loudly rather than silently weakening the contract.
|
|
26
|
+
*/
|
|
27
|
+
export function parseScenarioExpectations(raw: unknown): ScenarioExpectations {
|
|
28
|
+
if (typeof raw !== "object" || raw === null) {
|
|
29
|
+
throw new Error("scenario must be a JSON object");
|
|
30
|
+
}
|
|
31
|
+
const expected = (raw as Record<string, unknown>).expected;
|
|
32
|
+
if (expected === undefined) {
|
|
33
|
+
return { screens: [], events: [] };
|
|
34
|
+
}
|
|
35
|
+
if (typeof expected !== "object" || expected === null) {
|
|
36
|
+
throw new Error("scenario.expected must be an object when present");
|
|
37
|
+
}
|
|
38
|
+
const record = expected as Record<string, unknown>;
|
|
39
|
+
const screens = readStringArray(record.screens, "scenario.expected.screens");
|
|
40
|
+
const events = readStringArray(record.events, "scenario.expected.events");
|
|
41
|
+
const terminal = record.terminal;
|
|
42
|
+
if (terminal === undefined) {
|
|
43
|
+
return { screens, events };
|
|
44
|
+
}
|
|
45
|
+
if (typeof terminal !== "string" || !TERMINALS.has(terminal)) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`scenario.expected.terminal must be one of ${[...TERMINALS].join(", ")}, got ${String(terminal)}`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
screens,
|
|
52
|
+
events,
|
|
53
|
+
terminal: terminal as "submitted" | "timeout" | "unsatisfied",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function readStringArray(value: unknown, label: string): readonly string[] {
|
|
58
|
+
if (value === undefined) return [];
|
|
59
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) {
|
|
60
|
+
throw new Error(`${label} must be an array of strings`);
|
|
61
|
+
}
|
|
62
|
+
return value as string[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Asserts that every element of [expected] appears in [recorded] in the same
|
|
67
|
+
* relative order (a minimal ordered-subset match — unlisted items may
|
|
68
|
+
* interleave, exact-match is deliberately NOT required). Throws a descriptive
|
|
69
|
+
* Error on failure so it works under any test runner.
|
|
70
|
+
*/
|
|
71
|
+
export function expectSubsetInOrder(
|
|
72
|
+
recorded: readonly string[],
|
|
73
|
+
expected: readonly string[],
|
|
74
|
+
label = "sequence",
|
|
75
|
+
): void {
|
|
76
|
+
let cursor = 0;
|
|
77
|
+
for (const item of recorded) {
|
|
78
|
+
if (cursor < expected.length && item === expected[cursor]) cursor += 1;
|
|
79
|
+
}
|
|
80
|
+
if (cursor !== expected.length) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
`${label}: expected [${expected
|
|
83
|
+
.slice(cursor)
|
|
84
|
+
.join(", ")}] to appear in order within [${recorded.join(", ")}]`,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ScriptedScenario,
|
|
3
|
+
ScriptedScenarioStep,
|
|
4
|
+
} from "./fake_face_analyzer";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Emission vocabulary of the shared `e2e-scenarios` schema (`schema.json` in
|
|
8
|
+
* every repo's scenario folder). A step whose `emit` is outside this set is a
|
|
9
|
+
* drift bug — the loader rejects it rather than letting the fake silently treat
|
|
10
|
+
* it as "no detection".
|
|
11
|
+
*/
|
|
12
|
+
const KNOWN_EMITS: ReadonlySet<string> = new Set([
|
|
13
|
+
"noFace",
|
|
14
|
+
"faceTooFar",
|
|
15
|
+
"faceCentered",
|
|
16
|
+
"headTurnLeft",
|
|
17
|
+
"headTurnRight",
|
|
18
|
+
"headTurnUp",
|
|
19
|
+
"satisfied",
|
|
20
|
+
"noDocument",
|
|
21
|
+
"documentFound",
|
|
22
|
+
"documentUnstable",
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
const CAPTURE_TYPES: ReadonlySet<string> = new Set(["selfie", "document"]);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Validates a parsed shared-scenario JSON object and returns the typed
|
|
29
|
+
* [ScriptedScenario]. Kept I/O-free (takes an already-parsed object) so the
|
|
30
|
+
* `@smileid/usesmileid/testing` subpath stays environment-agnostic — the caller
|
|
31
|
+
* owns how the JSON is read. Throws with a specific message on any shape drift
|
|
32
|
+
* so a malformed or vocabulary-drifted script fails loudly at load time instead
|
|
33
|
+
* of producing a misleading capture sequence.
|
|
34
|
+
*/
|
|
35
|
+
export function parseScriptedScenario(raw: unknown): ScriptedScenario {
|
|
36
|
+
if (typeof raw !== "object" || raw === null) {
|
|
37
|
+
throw new Error("scenario must be a JSON object");
|
|
38
|
+
}
|
|
39
|
+
const record = raw as Record<string, unknown>;
|
|
40
|
+
|
|
41
|
+
const name = record.name;
|
|
42
|
+
if (typeof name !== "string" || name.length === 0) {
|
|
43
|
+
throw new Error("scenario.name must be a non-empty string");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const captureType = record.captureType;
|
|
47
|
+
if (typeof captureType !== "string" || !CAPTURE_TYPES.has(captureType)) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`scenario.captureType must be one of ${[...CAPTURE_TYPES].join(", ")}, got ${String(captureType)}`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!Array.isArray(record.steps) || record.steps.length === 0) {
|
|
54
|
+
throw new Error(`scenario.steps must be a non-empty array in ${name}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const steps: ScriptedScenarioStep[] = record.steps.map((step, index) => {
|
|
58
|
+
if (typeof step !== "object" || step === null) {
|
|
59
|
+
throw new Error(`scenario.steps[${index}] must be an object in ${name}`);
|
|
60
|
+
}
|
|
61
|
+
const stepRecord = step as Record<string, unknown>;
|
|
62
|
+
const emit = stepRecord.emit;
|
|
63
|
+
if (typeof emit !== "string" || !KNOWN_EMITS.has(emit)) {
|
|
64
|
+
throw new Error(
|
|
65
|
+
`scenario.steps[${index}].emit "${String(emit)}" is not a known emission in ${name}`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
const holdFrames = stepRecord.holdFrames;
|
|
69
|
+
if (
|
|
70
|
+
holdFrames !== undefined &&
|
|
71
|
+
(typeof holdFrames !== "number" ||
|
|
72
|
+
!Number.isInteger(holdFrames) ||
|
|
73
|
+
holdFrames < 1)
|
|
74
|
+
) {
|
|
75
|
+
throw new Error(
|
|
76
|
+
`scenario.steps[${index}].holdFrames must be a positive integer in ${name}`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return holdFrames === undefined ? { emit } : { emit, holdFrames };
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return { name, captureType, steps };
|
|
83
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CaptureReadyEventKind,
|
|
3
|
+
UseSmileIDScanStateType,
|
|
4
|
+
} from "@smileid/usesmileid_bridge";
|
|
5
|
+
import type {
|
|
6
|
+
CaptureReadyEvent,
|
|
7
|
+
FaceScanResult,
|
|
8
|
+
} from "@smileid/usesmileid_bridge";
|
|
9
|
+
import type { ScriptedScenario } from "./fake_face_analyzer";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Turns a shared E2E scenario into the `FaceScanResult` sequence a capture
|
|
13
|
+
* screen receives frame-by-frame, so a headless test can replay the shared
|
|
14
|
+
* script through the frame stream's `onResult` seam (per-frame detection is a
|
|
15
|
+
* native frame-processor concern; pixels never reach JS).
|
|
16
|
+
*
|
|
17
|
+
* `noFace` → `initial`; `faceTooFar` / `faceCentered` → `found`; the terminal
|
|
18
|
+
* `satisfied` → one `finished` result carrying a `selfie` event plus
|
|
19
|
+
* [livenessCount] `liveness` events at opaque `file://` URLs the screen never
|
|
20
|
+
* reads. Exported only behind the `@smileid/usesmileid/testing` subpath.
|
|
21
|
+
*/
|
|
22
|
+
export function scriptedFaceScanResults(
|
|
23
|
+
scenario: ScriptedScenario,
|
|
24
|
+
options: { readonly livenessCount?: number } = {},
|
|
25
|
+
): FaceScanResult[] {
|
|
26
|
+
const livenessCount = options.livenessCount ?? 2;
|
|
27
|
+
const output: FaceScanResult["output"] = { faces: [], brightness: 128 };
|
|
28
|
+
const results: FaceScanResult[] = [];
|
|
29
|
+
|
|
30
|
+
for (const step of scenario.steps) {
|
|
31
|
+
if (step.emit === "satisfied") {
|
|
32
|
+
results.push({
|
|
33
|
+
output,
|
|
34
|
+
state: { type: UseSmileIDScanStateType.Finished },
|
|
35
|
+
capturedEvents: captureEvents(livenessCount),
|
|
36
|
+
});
|
|
37
|
+
return results;
|
|
38
|
+
}
|
|
39
|
+
const type =
|
|
40
|
+
step.emit === "noFace"
|
|
41
|
+
? UseSmileIDScanStateType.Initial
|
|
42
|
+
: UseSmileIDScanStateType.Found;
|
|
43
|
+
for (let frame = 0; frame < (step.holdFrames ?? 1); frame++) {
|
|
44
|
+
results.push({ output, state: { type }, capturedEvents: [] });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return results;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function captureEvents(livenessCount: number): CaptureReadyEvent[] {
|
|
51
|
+
const events: CaptureReadyEvent[] = [
|
|
52
|
+
{
|
|
53
|
+
kind: CaptureReadyEventKind.Selfie,
|
|
54
|
+
captureIndex: 0,
|
|
55
|
+
url: "file://selfie-0.jpg",
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
for (let index = 1; index <= livenessCount; index++) {
|
|
59
|
+
events.push({
|
|
60
|
+
kind: CaptureReadyEventKind.Liveness,
|
|
61
|
+
captureIndex: index,
|
|
62
|
+
url: `file://liveness-${index}.jpg`,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return events;
|
|
66
|
+
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from "react-native-nitro-modules";
|
|
2
|
-
import type { Frame } from "react-native-vision-camera";
|
|
3
|
-
/**
|
|
4
|
-
* A provider's frame-processor Nitro HybridObject. Each provider module
|
|
5
|
-
* registers a platform-native implementation (Swift on iOS, Kotlin on
|
|
6
|
-
* Android) under its `frameProcessorPluginName`; the SDK resolves it by
|
|
7
|
-
* that key with {@link resolveFrameProcessorPlugin}.
|
|
8
|
-
*
|
|
9
|
-
* `call` runs the provider's scan session on the frame and returns the
|
|
10
|
-
* scan-result map serialised as a JSON string — pixels never enter JS.
|
|
11
|
-
* Frame-level failures return `{"error":"<reason>"}`; absent optional
|
|
12
|
-
* keys are omitted (never `null`). The worklet must `dispose()` the
|
|
13
|
-
* frame after the call.
|
|
14
|
-
*/
|
|
15
|
-
export interface UseSmileIDFrameProcessorPlugin extends HybridObject<{}> {
|
|
16
|
-
call(frame: Frame, rotation: number): string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Resolve a provider's frame-processor HybridObject by name, or `null`
|
|
20
|
-
* if it isn't registered natively.
|
|
21
|
-
*
|
|
22
|
-
* VisionCamera v5's `NitroModules.createHybridObject(...)` throws when the
|
|
23
|
-
* key is missing (v4's `VisionCameraProxy.initFrameProcessorPlugin`
|
|
24
|
-
* returned `null`). The throw is mapped back to `null` here so callers
|
|
25
|
-
* keep the v4 report-once-then-no-op behaviour for a missing plugin.
|
|
26
|
-
*/
|
|
27
|
-
export declare function resolveFrameProcessorPlugin(name: string): UseSmileIDFrameProcessorPlugin | null;
|
|
28
|
-
//# sourceMappingURL=frame_processor_plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame_processor_plugin.d.ts","sourceRoot":"","sources":["../../src/camera/frame_processor_plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,8BAA+B,SAAQ,YAAY,CAAC,EAAE,CAAC;IACtE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,GACX,8BAA8B,GAAG,IAAI,CAUvC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { NitroModules } from "react-native-nitro-modules";
|
|
2
|
-
/**
|
|
3
|
-
* Resolve a provider's frame-processor HybridObject by name, or `null`
|
|
4
|
-
* if it isn't registered natively.
|
|
5
|
-
*
|
|
6
|
-
* VisionCamera v5's `NitroModules.createHybridObject(...)` throws when the
|
|
7
|
-
* key is missing (v4's `VisionCameraProxy.initFrameProcessorPlugin`
|
|
8
|
-
* returned `null`). The throw is mapped back to `null` here so callers
|
|
9
|
-
* keep the v4 report-once-then-no-op behaviour for a missing plugin.
|
|
10
|
-
*/
|
|
11
|
-
export function resolveFrameProcessorPlugin(name) {
|
|
12
|
-
try {
|
|
13
|
-
return NitroModules.createHybridObject(name);
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
// Not registered natively — the caller surfaces a typed
|
|
17
|
-
// FrameProcessorPluginNotRegisteredException once on its own.
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=frame_processor_plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame_processor_plugin.js","sourceRoot":"","sources":["../../src/camera/frame_processor_plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAoB1D;;;;;;;;GAQG;AACH,MAAM,UAAU,2BAA2B,CACzC,IAAY;IAEZ,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,kBAAkB,CACpC,IAAI,CACL,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,wDAAwD;QACxD,8DAA8D;QAC9D,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from "react-native-nitro-modules";
|
|
2
|
-
import type { Frame } from "react-native-vision-camera";
|
|
3
|
-
/**
|
|
4
|
-
* Shared shape of every provider's native VisionCamera v5 Nitro
|
|
5
|
-
* frame-processor HybridObject.
|
|
6
|
-
*
|
|
7
|
-
* Each provider package (`usesmileid_vision_face`,
|
|
8
|
-
* `usesmileid_mlkit_face`, …) ships a Nitro `HybridObject`
|
|
9
|
-
* implementation registered — via Nitro autolinking — under the name
|
|
10
|
-
* the analyzer exposes as `frameProcessorPluginName`. The camera layer
|
|
11
|
-
* resolves it by that name with
|
|
12
|
-
* `NitroModules.createHybridObject<UseSmileIDFrameProcessor>(name)`,
|
|
13
|
-
* keeping the cross-bridge identifier in the single per-provider
|
|
14
|
-
* `identifiers` registry (no second string literal here).
|
|
15
|
-
*
|
|
16
|
-
* `call` runs the provider's native scan session on the frame and
|
|
17
|
-
* returns the scan-result map serialised as JSON — pixels never enter
|
|
18
|
-
* the JS runtime. Frame-level failures return `{"error":"<reason>"}`.
|
|
19
|
-
* The JSON is parsed and Zod-validated on the JS thread by
|
|
20
|
-
* `useSmileIDFrameStream`; absent optional keys are omitted natively
|
|
21
|
-
* (never serialised as `null`, which the wire schemas reject).
|
|
22
|
-
*
|
|
23
|
-
* The platform tag here is only structural — it satisfies the
|
|
24
|
-
* `createHybridObject` generic bound. Each provider's own `.nitro.ts`
|
|
25
|
-
* spec declares its real (iOS-only or Android-only) platform.
|
|
26
|
-
*/
|
|
27
|
-
export interface UseSmileIDFrameProcessor extends HybridObject<{
|
|
28
|
-
ios: "swift";
|
|
29
|
-
android: "kotlin";
|
|
30
|
-
}> {
|
|
31
|
-
/**
|
|
32
|
-
* Run the native scan on `frame` with the physical device tilt
|
|
33
|
-
* `rotation` (clockwise degrees, `0` = upright portrait). Returns the
|
|
34
|
-
* scan-result map as a JSON string.
|
|
35
|
-
*/
|
|
36
|
-
call(frame: Frame, rotation: number): string;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=use_smile_id_frame_processor.d.ts.map
|