@smileid/usesmileid 12.0.0-beta01 → 12.0.0
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 +11 -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/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 +6 -4
- package/dist/core/models/document_type.js.map +1 -1
- 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.js +1 -1
- 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/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 +16 -1
- package/dist/data/dsl/builder/retry_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/retry_config_builder.js +16 -1
- 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/util/retry_util.d.ts +1 -1
- package/dist/data/util/retry_util.d.ts.map +1 -1
- package/dist/data/util/retry_util.js +2 -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/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 +39 -0
- package/dist/metadata/builder_configuration.d.ts.map +1 -0
- package/dist/metadata/builder_configuration.js +34 -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 +48 -0
- package/dist/metadata/metadata_configuration_mappers.d.ts.map +1 -0
- package/dist/metadata/metadata_configuration_mappers.js +171 -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 +184 -12
- 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.map +1 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js +1 -3
- 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 +18 -3
- 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 +12 -0
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/config_builder.js +12 -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 +111 -10
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.js +111 -10
- 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 +39 -4
- package/dist/presentation/flow/flow_navigation_manager.d.ts.map +1 -1
- package/dist/presentation/flow/flow_navigation_manager.js +141 -10
- 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 +73 -25
- 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 +36 -12
- package/dist/presentation/flow/screen/orchestrated_capture_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 -1
- 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/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/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.js +3 -0
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts +17 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.js +153 -18
- package/dist/presentation/screen/use_smile_id_capture_screen.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 +16 -11
- 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 -6
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.js +9 -8
- 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 +3 -2
- 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/package.json +26 -6
- package/src/__tests__/react_native_mock.tsx +8 -0
- package/src/camera/camera_defaults.ts +11 -9
- package/src/camera/orientation_degrees.ts +5 -6
- package/src/core/models/__tests__/document_type.test.ts +6 -4
- package/src/core/models/document_capture_mode.ts +27 -0
- package/src/core/models/document_type.ts +6 -4
- package/src/core/models/result.ts +9 -8
- 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 +1 -1
- 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 +222 -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/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 +22 -1
- 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/networking_factory.ts +14 -1
- package/src/data/repository/__tests__/network_retries.test.ts +117 -0
- package/src/data/repository/use_smile_id_repository_impl.ts +96 -9
- 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/util/__tests__/use_smile_id_token_decoder.test.ts +57 -1
- package/src/data/util/retry_util.ts +3 -2
- package/src/data/util/use_smile_id_token_decoder.ts +76 -28
- 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 +215 -0
- package/src/metadata/__tests__/metadata_configuration_objects.test.ts +85 -0
- package/src/metadata/__tests__/metadata_device_context.test.ts +147 -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 +18 -24
- package/src/metadata/builder_configuration.ts +63 -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 +234 -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 +195 -11
- package/src/presentation/assets/si_ess_animation_all_directions.json +1300 -286
- 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 +3 -4
- 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 +27 -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 +0 -3
- package/src/presentation/components/use_smile_id_guideline_thumbnail.tsx +131 -2
- package/src/presentation/components/use_smile_id_instructions_hero.tsx +100 -59
- package/src/presentation/components/use_smile_id_oval_border_palette.ts +7 -3
- package/src/presentation/flow/__tests__/document_flow_navigation.test.ts +200 -1
- package/src/presentation/flow/dsl/builder/config_builder.ts +14 -0
- package/src/presentation/flow/dsl/builder/ml_builder.ts +13 -4
- package/src/presentation/flow/dsl/builder/screens_builder.ts +111 -10
- 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 +179 -13
- package/src/presentation/flow/model/instruction_guideline.ts +6 -0
- package/src/presentation/flow/model/instructions_defaults.ts +103 -25
- package/src/presentation/flow/screen/orchestrated_capture_screen.tsx +43 -10
- package/src/presentation/flow/screen/orchestrated_instructions_screen.tsx +1 -0
- package/src/presentation/flow/screen/orchestrated_preview_screen.tsx +4 -2
- package/src/presentation/flow/screen/orchestrated_processing_screen.tsx +3 -3
- package/src/presentation/flow/validation/__tests__/job_type_validator.test.ts +64 -0
- package/src/presentation/flow/validation/job_type_validator.ts +24 -0
- package/src/presentation/screen/__tests__/instructions_screen_helpers.test.ts +15 -3
- package/src/presentation/screen/__tests__/use_smile_id_capture_screen.test.tsx +6 -4
- package/src/presentation/screen/helpers/capture_screen_helpers.ts +1 -0
- package/src/presentation/screen/helpers/instructions_screen_helpers.ts +7 -2
- package/src/presentation/screen/helpers/scan_state_to_overlay_state.ts +3 -0
- package/src/presentation/screen/use_smile_id_capture_screen.tsx +234 -36
- package/src/presentation/screen/use_smile_id_document_preview_screen.tsx +32 -22
- package/src/presentation/screen/use_smile_id_instructions_screen.tsx +4 -0
- package/src/presentation/screen/use_smile_id_preview_screen.tsx +9 -9
- package/src/presentation/screen/use_smile_id_processing_screen.tsx +7 -7
- package/src/presentation/theme/theme.ts +21 -19
- package/src/presentation/utils/force_max_brightness.tsx +4 -4
- 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_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
|
@@ -60,18 +60,18 @@ export class UseSmileIDFlowBuilder {
|
|
|
60
60
|
*/
|
|
61
61
|
localizations;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
63
|
+
* Invoked once when the flow terminates — with the submitted job on
|
|
64
|
+
* success, a typed error on failure, or a cancellation when the user
|
|
65
|
+
* exits before completing. Wire the returned user id / job id into
|
|
66
|
+
* your job-status pipeline. Defaults to a no-op so partners who don't
|
|
67
|
+
* need result handling still get a valid configuration; the
|
|
68
|
+
* server-issued `JobSubmissionResponse` carries `userId` / `jobId` /
|
|
69
|
+
* `status` / `message` / `createdAt`.
|
|
69
70
|
*/
|
|
70
71
|
onResult = () => { };
|
|
71
72
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* `docs/Architecture.md § Rollout`.
|
|
73
|
+
* Invoked for every analytics event the SDK emits during the flow.
|
|
74
|
+
* Optional — leave unset to ignore analytics.
|
|
75
75
|
*/
|
|
76
76
|
onAnalyticsEvent;
|
|
77
77
|
// --- Internal block builders ---------------------------------------------
|
|
@@ -81,11 +81,12 @@ export class UseSmileIDFlowBuilder {
|
|
|
81
81
|
_ml;
|
|
82
82
|
_screens;
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Configures global SDK feature flags (debug mode, offline mode, crash
|
|
85
|
+
* reporting). Repeated calls compose against the same configuration —
|
|
86
|
+
* `enableCrashReporting` set in one call and `enableDebugMode` set in
|
|
87
|
+
* another both end up on the final config.
|
|
85
88
|
*
|
|
86
|
-
*
|
|
87
|
-
* `enableCrashReporting` set in one call and `enableDebugMode` set
|
|
88
|
-
* in another both end up on the final config.
|
|
89
|
+
* `b.config((c) => { c.enableCrashReporting = false; })`
|
|
89
90
|
*/
|
|
90
91
|
config(block) {
|
|
91
92
|
if (!this._config)
|
|
@@ -93,7 +94,10 @@ export class UseSmileIDFlowBuilder {
|
|
|
93
94
|
block(this._config);
|
|
94
95
|
}
|
|
95
96
|
/**
|
|
96
|
-
*
|
|
97
|
+
* Configures the visual theme — colors, fonts, and corner shapes —
|
|
98
|
+
* applied to every SDK screen in the flow.
|
|
99
|
+
*
|
|
100
|
+
* `b.theme((t) => { t.primaryColor = t.color('#1A73E8', '#4DA3FF'); t.buttonShape = 12; })`
|
|
97
101
|
*
|
|
98
102
|
* Each call replaces the prior theme builder — partners typically
|
|
99
103
|
* configure the theme in one place, and accumulating across helpers
|
|
@@ -105,6 +109,10 @@ export class UseSmileIDFlowBuilder {
|
|
|
105
109
|
block(this._theme);
|
|
106
110
|
}
|
|
107
111
|
/**
|
|
112
|
+
* Configures the network stack: partner credentials, job type,
|
|
113
|
+
* timeouts, retry policy, response cache, and custom interceptors.
|
|
114
|
+
* Required for any flow that submits a job.
|
|
115
|
+
*
|
|
108
116
|
* `b.network((n) => { n.config((c) => { c.partnerConfig((p) => { p.partnerId = ...; }); }); })`
|
|
109
117
|
*
|
|
110
118
|
* Each call replaces the prior network builder. Network config
|
|
@@ -116,6 +124,9 @@ export class UseSmileIDFlowBuilder {
|
|
|
116
124
|
block(this._network);
|
|
117
125
|
}
|
|
118
126
|
/**
|
|
127
|
+
* Registers the on-device ML analyzers used for face and document
|
|
128
|
+
* detection, keyed by capture type.
|
|
129
|
+
*
|
|
119
130
|
* `b.ml((m) => { m.analyzers((a) => { a.forCaptureType(CaptureType.selfie, (face) => face.add(useSmileIDVisionFace)); }); })`
|
|
120
131
|
*/
|
|
121
132
|
ml(block) {
|
|
@@ -124,6 +135,10 @@ export class UseSmileIDFlowBuilder {
|
|
|
124
135
|
block(this._ml);
|
|
125
136
|
}
|
|
126
137
|
/**
|
|
138
|
+
* Declares the ordered sequence of screens the flow presents. Screens
|
|
139
|
+
* render in the order they are added; the same screen type may be
|
|
140
|
+
* added more than once.
|
|
141
|
+
*
|
|
127
142
|
* `b.screens((screens) => { screens.instructions(); screens.capture((c) => { c.captureType = CaptureType.selfie; }); })`
|
|
128
143
|
*
|
|
129
144
|
* Each screen-builder call appends a step to the orchestrator's
|
|
@@ -135,10 +150,11 @@ export class UseSmileIDFlowBuilder {
|
|
|
135
150
|
block(this._screens);
|
|
136
151
|
}
|
|
137
152
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
153
|
+
* Runs a pre-flight check of the current builder configuration and
|
|
154
|
+
* returns a `ValidationState` describing any blocking issues, without
|
|
155
|
+
* throwing. Today the only rule it surfaces is the empty-screens-block
|
|
156
|
+
* error — `b.screens` must register at least one screen before the
|
|
157
|
+
* builder can produce a flow.
|
|
142
158
|
*
|
|
143
159
|
* The full rule set (screen ordering, dependency rules, KYC and
|
|
144
160
|
* consent payload validation, etc.) runs inside `build()` and is
|
|
@@ -146,50 +162,60 @@ export class UseSmileIDFlowBuilder {
|
|
|
146
162
|
* the full picture during configuration should call
|
|
147
163
|
* `useSmileIDBuilder(...)` and pattern-match on the returned
|
|
148
164
|
* `result.kind`.
|
|
165
|
+
*
|
|
166
|
+
* @returns a `ValidationState` describing any blocking issues.
|
|
149
167
|
*/
|
|
150
168
|
validate() {
|
|
151
169
|
return ValidationState.invalid(runBuilderValidation(this._screens?.build().steps ?? []));
|
|
152
170
|
}
|
|
153
171
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* partner storage or
|
|
157
|
-
*
|
|
172
|
+
* Validates a `ConsentInformation` payload in isolation and returns a
|
|
173
|
+
* `ValidationState`, without throwing. Useful when the payload comes
|
|
174
|
+
* from dynamic partner storage or remote config — pre-flight it before
|
|
175
|
+
* assigning to `b.consentInformation`.
|
|
158
176
|
*/
|
|
159
177
|
validateConsent(consent) {
|
|
160
178
|
return ValidationState.invalid(runConsentValidation(consent));
|
|
161
179
|
}
|
|
162
180
|
/**
|
|
163
|
-
*
|
|
164
|
-
* when the partner pulls
|
|
165
|
-
* and wants to pre-flight them
|
|
166
|
-
* `b.enhancedKYCParams`.
|
|
181
|
+
* Validates an `EnhancedKYCParams` payload in isolation and returns a
|
|
182
|
+
* `ValidationState`, without throwing. Useful when the partner pulls
|
|
183
|
+
* KYC fields from a form or remote config and wants to pre-flight them
|
|
184
|
+
* before assigning to `b.enhancedKYCParams`.
|
|
167
185
|
*/
|
|
168
186
|
validateEnhancedKYCParams(params) {
|
|
169
187
|
return ValidationState.invalid(runEnhancedKYCParamsValidation(params));
|
|
170
188
|
}
|
|
171
189
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* different param shape.
|
|
190
|
+
* Validates a `BiometricKYCParams` payload in isolation and returns a
|
|
191
|
+
* `ValidationState`, without throwing.
|
|
175
192
|
*/
|
|
176
193
|
validateBiometricKYCParams(params) {
|
|
177
194
|
return ValidationState.invalid(runBiometricKYCParamsValidation(params));
|
|
178
195
|
}
|
|
179
|
-
/**
|
|
196
|
+
/**
|
|
197
|
+
* Validates a `DocumentVerificationParams` payload in isolation and
|
|
198
|
+
* returns a `ValidationState`, without throwing. Only `country` is
|
|
199
|
+
* required; `idType` is optional.
|
|
200
|
+
*/
|
|
180
201
|
validateDocumentVerificationParams(params) {
|
|
181
202
|
return ValidationState.invalid(runDocumentVerificationParamsValidation(params));
|
|
182
203
|
}
|
|
183
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* Validates an `EnhancedDocumentVerificationParams` payload in
|
|
206
|
+
* isolation and returns a `ValidationState`, without throwing. Both
|
|
207
|
+
* `country` and `idType` are required.
|
|
208
|
+
*/
|
|
184
209
|
validateEnhancedDocumentVerificationParams(params) {
|
|
185
210
|
return ValidationState.invalid(runEnhancedDocumentVerificationParamsValidation(params));
|
|
186
211
|
}
|
|
187
212
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* the in-build
|
|
213
|
+
* Validates a `UserDetails` payload in isolation and returns a
|
|
214
|
+
* `ValidationState`, without throwing. Useful when the partner pulls
|
|
215
|
+
* user PII from a form or remote config and wants to pre-flight it
|
|
216
|
+
* before assigning to `b.userDetails`. Surfaces the same dotted-path
|
|
217
|
+
* field names (`userDetails.givenNames` etc.) that the in-build
|
|
218
|
+
* validator emits.
|
|
193
219
|
*/
|
|
194
220
|
validateUserDetails(userDetails) {
|
|
195
221
|
return ValidationState.invalid(runUserDetailsValidation(userDetails));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_smile_id_flow_builder.js","sourceRoot":"","sources":["../../../../src/presentation/flow/dsl/use_smile_id_flow_builder.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EACL,eAAe,EACf,+BAA+B,EAC/B,oBAAoB,EACpB,oBAAoB,EACpB,uCAAuC,EACvC,+CAA+C,EAC/C,8BAA8B,EAC9B,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE;;;;;;;;;GASG;AACH,MAAM,OAAO,qBAAqB;IAChC;;;OAGG;IACH,kBAAkB,CAAsB;IAExC,yDAAyD;IACzD,iBAAiB,CAAqB;IAEtC,0DAA0D;IAC1D,kBAAkB,CAAsB;IAExC,kEAAkE;IAClE,0BAA0B,CAA8B;IAExD,0EAA0E;IAC1E,kCAAkC,CAAsC;IAExE;;;;;;;;;;OAUG;IACH,WAAW,CAAe;IAE1B;;;;;;OAMG;IACH,MAAM,CAAU;IAEhB;;;;;;;;OAQG;IACH,aAAa,CAA2B;IAExC
|
|
1
|
+
{"version":3,"file":"use_smile_id_flow_builder.js","sourceRoot":"","sources":["../../../../src/presentation/flow/dsl/use_smile_id_flow_builder.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D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AO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtD,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/B,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,OAAO;YACP,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,GAAG,CAAC,IAAI,CAAC,gBAAgB;gBACvB,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE;gBAC7C,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;QAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -3,10 +3,11 @@ import type { FlowConfigurationSnapshot } from "./dsl/use_smile_id_flow_builder"
|
|
|
3
3
|
import type { JobSubmissionState } from "./job_submission_state";
|
|
4
4
|
import type { UseSmileIDRepository } from "../../data/repository/use_smile_id_repository";
|
|
5
5
|
import type { ConsentInformation } from "../../core/models/params";
|
|
6
|
-
import type
|
|
6
|
+
import { type DocumentType } from "../../core/models/document_type";
|
|
7
7
|
import type { JobSubmissionResponse } from "../../data/model/job_submission_response";
|
|
8
8
|
import { type MetadataProvider } from "../../metadata/use_smile_id_metadata_factory";
|
|
9
9
|
import { type DocumentImageOrigin } from "../../metadata/document_image_origin";
|
|
10
|
+
import type { CaptureTelemetry } from "../screen/use_smile_id_capture_screen";
|
|
10
11
|
import type { SdkConfig } from "../../data/model/sdk_config";
|
|
11
12
|
import { DocumentSide } from "@smileid/usesmileid_bridge";
|
|
12
13
|
/**
|
|
@@ -76,6 +77,11 @@ export declare class FlowNavigationManager {
|
|
|
76
77
|
* removed when its side is retaken.
|
|
77
78
|
*/
|
|
78
79
|
private readonly _documentImageOrigins;
|
|
80
|
+
private _selfieCaptureTelemetry;
|
|
81
|
+
private readonly _documentCaptureTelemetry;
|
|
82
|
+
private _cameraName;
|
|
83
|
+
private _devicePositions;
|
|
84
|
+
private _deviceMovementDetected;
|
|
79
85
|
private _jobSubmissionState;
|
|
80
86
|
private readonly _listeners;
|
|
81
87
|
private readonly _steps;
|
|
@@ -91,6 +97,17 @@ export declare class FlowNavigationManager {
|
|
|
91
97
|
* defaults apply throughout the flow in those cases.
|
|
92
98
|
*/
|
|
93
99
|
readonly resolvedSdkConfig: SdkConfig | undefined;
|
|
100
|
+
/** Canonical `partner_id` decoded from the JWT (raw); resolved via the [partnerId] getter. */
|
|
101
|
+
private readonly _resolvedPartnerId;
|
|
102
|
+
/**
|
|
103
|
+
* Partner identifier the capture screen stamps into the Smile EXIF tag — the tag's HMAC/AES
|
|
104
|
+
* keys derive from it and the backend validates the tag against the request's partner_id.
|
|
105
|
+
*
|
|
106
|
+
* Sourced from the JWT `partner_id` claim (server-canonical form, e.g. `"002"`) so the stamped
|
|
107
|
+
* value matches what the backend keys on; falls back to the partner-supplied config value when
|
|
108
|
+
* the claim is absent/blank. Empty = skip tagging.
|
|
109
|
+
*/
|
|
110
|
+
get partnerId(): string;
|
|
94
111
|
/** Stable per-flow session id, stamped into every analytics event's `session_id`. */
|
|
95
112
|
private readonly _sessionId;
|
|
96
113
|
/** Submission attempts so far — stamped into `job_submitted` as `attempt`. */
|
|
@@ -101,6 +118,12 @@ export declare class FlowNavigationManager {
|
|
|
101
118
|
get enhancedLivenessEnabled(): boolean;
|
|
102
119
|
/** Document type from the flow's document capture step, if any (drives the instructions document variant). */
|
|
103
120
|
get documentType(): DocumentType | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Resolved document capture-frame aspect ratio (width / height), shared by
|
|
123
|
+
* capture, preview, and processing. Precedence: type `knownAspectRatio` →
|
|
124
|
+
* partner `knownIdAspectRatio` → orientation default.
|
|
125
|
+
*/
|
|
126
|
+
get documentFrameAspectRatio(): number | undefined;
|
|
104
127
|
/** Read-only navigation stack; top is the active screen. */
|
|
105
128
|
get navigationPath(): readonly ScreenSpec[];
|
|
106
129
|
/** Active screen (top of the path); `undefined` only when no screens are configured. */
|
|
@@ -155,8 +178,20 @@ export declare class FlowNavigationManager {
|
|
|
155
178
|
* metadata). Metadata-only, so it intentionally does not `_notify()`.
|
|
156
179
|
*/
|
|
157
180
|
recordDocumentImageOrigin(side: DocumentSide, origin: DocumentImageOrigin): void;
|
|
181
|
+
/** Records selfie capture telemetry (duration + retries) at capture completion. */
|
|
182
|
+
recordSelfieCaptureTelemetry(telemetry: CaptureTelemetry): void;
|
|
183
|
+
/** Records per-side document capture telemetry at each side's completion. */
|
|
184
|
+
recordDocumentCaptureTelemetry(side: DocumentSide, telemetry: CaptureTelemetry): void;
|
|
185
|
+
private _captureCameraName;
|
|
158
186
|
/** Per-side document origin wire entries (front then back; omitted when unset). */
|
|
159
187
|
private _documentImageOriginEntries;
|
|
188
|
+
/**
|
|
189
|
+
* Capture telemetry + image-property wire entries. Durations and retries keep
|
|
190
|
+
* a meaningful 0 (capture ran) and are omitted only when that capture type
|
|
191
|
+
* never ran. Color depth / pixel config are emitted for each present capture;
|
|
192
|
+
* document sizes when measured.
|
|
193
|
+
*/
|
|
194
|
+
private _captureTelemetryEntries;
|
|
160
195
|
private _precedingStepIsDocumentCapture;
|
|
161
196
|
setConsent(info: ConsentInformation): void;
|
|
162
197
|
get jobSubmissionState(): JobSubmissionState;
|
|
@@ -207,10 +242,10 @@ export declare class FlowNavigationManager {
|
|
|
207
242
|
*/
|
|
208
243
|
private _expectedLivenessImageCount;
|
|
209
244
|
/**
|
|
210
|
-
* Decode the `sdk_config`
|
|
211
|
-
* no token, or
|
|
245
|
+
* Decode the partner JWT into its claims (`sdk_config`, `partner_id`). `undefined` for offline
|
|
246
|
+
* mode, no token, or an unparseable token — SDK defaults apply in those cases.
|
|
212
247
|
*/
|
|
213
|
-
private static
|
|
248
|
+
private static _decodeToken;
|
|
214
249
|
private _notify;
|
|
215
250
|
}
|
|
216
251
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow_navigation_manager.d.ts","sourceRoot":"","sources":["../../../src/presentation/flow/flow_navigation_manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAMjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"flow_navigation_manager.d.ts","sourceRoot":"","sources":["../../../src/presentation/flow/flow_navigation_manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAMjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,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core/models/ml_config";
|
|
3
|
+
import { defaultFrameAspectRatio, } from "../../core/models/document_type";
|
|
3
4
|
import { MissingRequiredFieldException } from "../../core/exception/job_validation_exceptions";
|
|
4
5
|
import { UseSmileIDAnalyticsEventTypes, UseSmileIDAnalyticsParamKeys, UseSmileIDAnalyticsScreenNames, } from "./analytics/use_smile_id_analytics_event";
|
|
5
6
|
import { UseSmileIDMetadataFactory, } from "../../metadata/use_smile_id_metadata_factory";
|
|
6
7
|
import { DOCUMENT_BACK_IMAGE_ORIGIN_KEY, DOCUMENT_FRONT_IMAGE_ORIGIN_KEY, } from "../../metadata/document_image_origin";
|
|
8
|
+
import { configurationMetadataEntries } from "../../metadata/metadata_configuration_mappers";
|
|
9
|
+
import { CAPTURE_IMAGE_COLOR_DEPTH, CAPTURE_IMAGE_PIXEL_CONFIG, } from "../../metadata/captured_image_properties";
|
|
7
10
|
import { numSamplesOverride } from "../../data/model/sdk_config";
|
|
8
|
-
import { decodeSmileIDToken } from "../../data/util/use_smile_id_token_decoder";
|
|
11
|
+
import { decodeSmileIDToken, } from "../../data/util/use_smile_id_token_decoder";
|
|
9
12
|
import { DocumentSide, EnhancedSmartSelfieConfig, } from "@smileid/usesmileid_bridge";
|
|
10
13
|
import { ScanPerformanceProfile } from "@smileid/usesmileid_bridge";
|
|
11
14
|
const DEFAULT_CONSENT = Object.freeze({
|
|
@@ -35,6 +38,14 @@ export class FlowNavigationManager {
|
|
|
35
38
|
* removed when its side is retaken.
|
|
36
39
|
*/
|
|
37
40
|
_documentImageOrigins = new Map();
|
|
41
|
+
// Capture telemetry recorded at capture completion (selfie + per document side).
|
|
42
|
+
_selfieCaptureTelemetry;
|
|
43
|
+
_documentCaptureTelemetry = new Map();
|
|
44
|
+
// Identifier of the camera used for the most recent capture.
|
|
45
|
+
_cameraName;
|
|
46
|
+
// Accelerometer telemetry from the most recent capture (device_positions / movement).
|
|
47
|
+
_devicePositions = [];
|
|
48
|
+
_deviceMovementDetected = null;
|
|
38
49
|
_jobSubmissionState = { kind: "notAttempted" };
|
|
39
50
|
_listeners = new Set();
|
|
40
51
|
_steps;
|
|
@@ -50,6 +61,22 @@ export class FlowNavigationManager {
|
|
|
50
61
|
* defaults apply throughout the flow in those cases.
|
|
51
62
|
*/
|
|
52
63
|
resolvedSdkConfig;
|
|
64
|
+
/** Canonical `partner_id` decoded from the JWT (raw); resolved via the [partnerId] getter. */
|
|
65
|
+
_resolvedPartnerId;
|
|
66
|
+
/**
|
|
67
|
+
* Partner identifier the capture screen stamps into the Smile EXIF tag — the tag's HMAC/AES
|
|
68
|
+
* keys derive from it and the backend validates the tag against the request's partner_id.
|
|
69
|
+
*
|
|
70
|
+
* Sourced from the JWT `partner_id` claim (server-canonical form, e.g. `"002"`) so the stamped
|
|
71
|
+
* value matches what the backend keys on; falls back to the partner-supplied config value when
|
|
72
|
+
* the claim is absent/blank. Empty = skip tagging.
|
|
73
|
+
*/
|
|
74
|
+
get partnerId() {
|
|
75
|
+
const jwtPartnerId = this._resolvedPartnerId;
|
|
76
|
+
if (jwtPartnerId && jwtPartnerId.length > 0)
|
|
77
|
+
return jwtPartnerId;
|
|
78
|
+
return this._configuration.network?.config?.partnerConfig?.partnerId ?? "";
|
|
79
|
+
}
|
|
53
80
|
/** Stable per-flow session id, stamped into every analytics event's `session_id`. */
|
|
54
81
|
_sessionId;
|
|
55
82
|
/** Submission attempts so far — stamped into `job_submitted` as `attempt`. */
|
|
@@ -65,7 +92,9 @@ export class FlowNavigationManager {
|
|
|
65
92
|
this._metadataProvider =
|
|
66
93
|
options.metadataProvider ?? new UseSmileIDMetadataFactory();
|
|
67
94
|
this._sessionId = this._metadataProvider.sessionId;
|
|
68
|
-
|
|
95
|
+
const decodedToken = FlowNavigationManager._decodeToken(options.configuration);
|
|
96
|
+
this.resolvedSdkConfig = decodedToken?.sdkConfig;
|
|
97
|
+
this._resolvedPartnerId = decodedToken?.partnerId;
|
|
69
98
|
// Seed the path with the first screen so currentScreen/renderer have a
|
|
70
99
|
// deterministic start. Empty path → host renders the "no screens"
|
|
71
100
|
// sentinel (validation rejects empty screens at build time anyway).
|
|
@@ -100,6 +129,22 @@ export class FlowNavigationManager {
|
|
|
100
129
|
}
|
|
101
130
|
return undefined;
|
|
102
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Resolved document capture-frame aspect ratio (width / height), shared by
|
|
134
|
+
* capture, preview, and processing. Precedence: type `knownAspectRatio` →
|
|
135
|
+
* partner `knownIdAspectRatio` → orientation default.
|
|
136
|
+
*/
|
|
137
|
+
get documentFrameAspectRatio() {
|
|
138
|
+
for (const step of this._steps) {
|
|
139
|
+
if (step.kind === "capture" &&
|
|
140
|
+
step.config.captureType === CaptureType.document) {
|
|
141
|
+
const documentConfig = step.config.documentConfig;
|
|
142
|
+
return (documentConfig?.resolvedAspectRatio ??
|
|
143
|
+
defaultFrameAspectRatio(documentConfig?.documentType?.orientation ?? "Landscape"));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
103
148
|
// --- navigation path --------------------------------------------------
|
|
104
149
|
/** Read-only navigation stack; top is the active screen. */
|
|
105
150
|
get navigationPath() {
|
|
@@ -152,6 +197,20 @@ export class FlowNavigationManager {
|
|
|
152
197
|
if (next?.kind === "preview")
|
|
153
198
|
return this._steps[currentIdx + 2];
|
|
154
199
|
}
|
|
200
|
+
// At the document capture step with the front captured, the back still
|
|
201
|
+
// pending, and no document preview to drive the per-side loop, re-enter the
|
|
202
|
+
// capture step for the back side so captureBothSides is honoured even when
|
|
203
|
+
// the flow omits the document preview { } step. When a preview does follow,
|
|
204
|
+
// the per-side loop above handles the back instead.
|
|
205
|
+
if (current.kind === "capture" &&
|
|
206
|
+
current.config.captureType === CaptureType.document &&
|
|
207
|
+
this.documentCapturesBack() &&
|
|
208
|
+
this._captured.frontDocumentPath !== undefined &&
|
|
209
|
+
this._captured.backDocumentPath === undefined &&
|
|
210
|
+
!this._documentBackSkipped &&
|
|
211
|
+
!this.documentPreviewFollowsCapture()) {
|
|
212
|
+
return current;
|
|
213
|
+
}
|
|
155
214
|
return this._steps[currentIdx + 1];
|
|
156
215
|
}
|
|
157
216
|
/**
|
|
@@ -345,6 +404,28 @@ export class FlowNavigationManager {
|
|
|
345
404
|
return;
|
|
346
405
|
this._documentImageOrigins.set(side, origin);
|
|
347
406
|
}
|
|
407
|
+
/** Records selfie capture telemetry (duration + retries) at capture completion. */
|
|
408
|
+
recordSelfieCaptureTelemetry(telemetry) {
|
|
409
|
+
if (this._disposed)
|
|
410
|
+
return;
|
|
411
|
+
this._selfieCaptureTelemetry = telemetry;
|
|
412
|
+
this._captureCameraName(telemetry);
|
|
413
|
+
}
|
|
414
|
+
/** Records per-side document capture telemetry at each side's completion. */
|
|
415
|
+
recordDocumentCaptureTelemetry(side, telemetry) {
|
|
416
|
+
if (this._disposed)
|
|
417
|
+
return;
|
|
418
|
+
this._documentCaptureTelemetry.set(side, telemetry);
|
|
419
|
+
this._captureCameraName(telemetry);
|
|
420
|
+
}
|
|
421
|
+
_captureCameraName(telemetry) {
|
|
422
|
+
if (telemetry.cameraName)
|
|
423
|
+
this._cameraName = telemetry.cameraName;
|
|
424
|
+
if (telemetry.devicePositions.length > 0) {
|
|
425
|
+
this._devicePositions = telemetry.devicePositions;
|
|
426
|
+
this._deviceMovementDetected = telemetry.deviceMovementDetected;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
348
429
|
/** Per-side document origin wire entries (front then back; omitted when unset). */
|
|
349
430
|
_documentImageOriginEntries() {
|
|
350
431
|
const entries = [];
|
|
@@ -358,6 +439,50 @@ export class FlowNavigationManager {
|
|
|
358
439
|
}
|
|
359
440
|
return entries;
|
|
360
441
|
}
|
|
442
|
+
/**
|
|
443
|
+
* Capture telemetry + image-property wire entries. Durations and retries keep
|
|
444
|
+
* a meaningful 0 (capture ran) and are omitted only when that capture type
|
|
445
|
+
* never ran. Color depth / pixel config are emitted for each present capture;
|
|
446
|
+
* document sizes when measured.
|
|
447
|
+
*/
|
|
448
|
+
_captureTelemetryEntries() {
|
|
449
|
+
const entries = [];
|
|
450
|
+
const push = (name, value) => entries.push({ name, value });
|
|
451
|
+
const selfie = this._selfieCaptureTelemetry;
|
|
452
|
+
if (selfie) {
|
|
453
|
+
// Duration + retries keep a meaningful 0 (capture ran); telemetry is absent only when the
|
|
454
|
+
// capture type never ran.
|
|
455
|
+
push("selfie_capture_duration_ms", String(selfie.durationMs));
|
|
456
|
+
push("selfie_capture_retries", String(selfie.retries));
|
|
457
|
+
}
|
|
458
|
+
if (this._captured.selfiePath !== undefined) {
|
|
459
|
+
push("selfie_image_color_depth", String(CAPTURE_IMAGE_COLOR_DEPTH));
|
|
460
|
+
push("selfie_image_pixel_config", CAPTURE_IMAGE_PIXEL_CONFIG);
|
|
461
|
+
}
|
|
462
|
+
if (this._cameraName) {
|
|
463
|
+
push("camera_name", this._cameraName);
|
|
464
|
+
}
|
|
465
|
+
if (this._devicePositions.length > 0) {
|
|
466
|
+
push("device_positions", JSON.stringify(this._devicePositions));
|
|
467
|
+
if (this._deviceMovementDetected !== null) {
|
|
468
|
+
push("device_movement_detected", String(this._deviceMovementDetected));
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
const sideKey = (side) => side === DocumentSide.Back ? "back" : "front";
|
|
472
|
+
for (const side of [DocumentSide.Front, DocumentSide.Back]) {
|
|
473
|
+
const key = sideKey(side);
|
|
474
|
+
const telemetry = this._documentCaptureTelemetry.get(side);
|
|
475
|
+
if (telemetry) {
|
|
476
|
+
push(`document_${key}_capture_duration_ms`, String(telemetry.durationMs));
|
|
477
|
+
push(`document_${key}_capture_retries`, String(telemetry.retries));
|
|
478
|
+
push(`document_${key}_image_color_depth`, String(CAPTURE_IMAGE_COLOR_DEPTH));
|
|
479
|
+
push(`document_${key}_image_pixel_config`, CAPTURE_IMAGE_PIXEL_CONFIG);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
// Per-image original + final compressed sizes are stamped in the repository around the
|
|
483
|
+
// compression pass (it owns both the before and after byte counts), not here.
|
|
484
|
+
return entries;
|
|
485
|
+
}
|
|
361
486
|
_precedingStepIsDocumentCapture(index) {
|
|
362
487
|
const preceding = this._steps[index - 1];
|
|
363
488
|
return (preceding?.kind === "capture" &&
|
|
@@ -468,10 +593,16 @@ export class FlowNavigationManager {
|
|
|
468
593
|
// make() so a mid-flow rotation is captured. resolvedSdkConfig drives
|
|
469
594
|
// sdk_config_source + image_width/height provenance.
|
|
470
595
|
const baseMetadata = this._metadataProvider.make(this.resolvedSdkConfig);
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
596
|
+
// Append the per-side document origins plus the partner's builder setup and
|
|
597
|
+
// the active detection models, all as flat wire entries.
|
|
598
|
+
// configurationMetadataEntries always contributes the builder + model config objects, so
|
|
599
|
+
// there is always at least one extra entry to append.
|
|
600
|
+
const extraEntries = [
|
|
601
|
+
...this._documentImageOriginEntries(),
|
|
602
|
+
...this._captureTelemetryEntries(),
|
|
603
|
+
...configurationMetadataEntries(config),
|
|
604
|
+
];
|
|
605
|
+
const metadata = baseMetadata.withAdditionalEntries(extraEntries);
|
|
475
606
|
switch (jobType) {
|
|
476
607
|
// enableEnhancedLiveness is a screen-level capture flag, not a
|
|
477
608
|
// distinct job type — enrollment still hits /v3/registration.
|
|
@@ -740,16 +871,16 @@ export class FlowNavigationManager {
|
|
|
740
871
|
return profileNumSamples - 1;
|
|
741
872
|
}
|
|
742
873
|
/**
|
|
743
|
-
* Decode the `sdk_config`
|
|
744
|
-
* no token, or
|
|
874
|
+
* Decode the partner JWT into its claims (`sdk_config`, `partner_id`). `undefined` for offline
|
|
875
|
+
* mode, no token, or an unparseable token — SDK defaults apply in those cases.
|
|
745
876
|
*/
|
|
746
|
-
static
|
|
877
|
+
static _decodeToken(configuration) {
|
|
747
878
|
if (configuration.config?.allowOfflineMode)
|
|
748
879
|
return undefined;
|
|
749
880
|
const token = configuration.network?.config?.token;
|
|
750
881
|
if (!token || token.length === 0)
|
|
751
882
|
return undefined;
|
|
752
|
-
return decodeSmileIDToken(token)
|
|
883
|
+
return decodeSmileIDToken(token);
|
|
753
884
|
}
|
|
754
885
|
_notify() {
|
|
755
886
|
for (const listener of this._listeners) {
|