@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
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
/** Static camera tuning defaults. */
|
|
2
2
|
export declare const CameraDefaults: {
|
|
3
|
-
/** Focus running indicator visibility duration
|
|
3
|
+
/** Focus running indicator visibility duration (ms). */
|
|
4
4
|
readonly focusRunningDurationMs: 600;
|
|
5
|
-
/** Focus settled indicator visibility duration
|
|
5
|
+
/** Focus settled indicator visibility duration (ms). */
|
|
6
6
|
readonly focusSettledDurationMs: 500;
|
|
7
|
-
/** Pinned analysis-stream frame rate
|
|
7
|
+
/** Pinned analysis-stream frame rate; 30 fps keeps motion smooth at low ISO. */
|
|
8
8
|
readonly analysisTargetFps: 30;
|
|
9
|
-
/**
|
|
9
|
+
/** Selfie analysis resolution (4:3 — the face/smile heuristics are calibrated on it). */
|
|
10
10
|
readonly analysisTargetResolution: {
|
|
11
11
|
readonly width: 640;
|
|
12
12
|
readonly height: 480;
|
|
13
13
|
};
|
|
14
|
-
/**
|
|
14
|
+
/** Document analysis resolution (16:9, matched to the visible preview so the guide-rect crop stays aligned). */
|
|
15
|
+
readonly documentAnalysisResolution: {
|
|
16
|
+
readonly width: 1280;
|
|
17
|
+
readonly height: 720;
|
|
18
|
+
};
|
|
19
|
+
/** Longest-edge ceiling (px) for an imported document image; downscale-only. */
|
|
15
20
|
readonly documentMaxDimension: 1600;
|
|
16
|
-
/** JPEG
|
|
21
|
+
/** JPEG quality (0–1) for imported document images. */
|
|
17
22
|
readonly documentJpegQuality: 0.85;
|
|
18
|
-
/** Minimum shortest-edge (px) for a gallery document image; smaller is rejected
|
|
23
|
+
/** Minimum shortest-edge (px) for a gallery document image; smaller is rejected. */
|
|
19
24
|
readonly minGalleryDocumentDimensionPx: 600;
|
|
20
|
-
/** Default selfie JPEG width (px)
|
|
25
|
+
/** Default selfie JPEG width (px); also the `image_width` metadata fallback. */
|
|
21
26
|
readonly selfieJpegTargetWidth: 480;
|
|
22
|
-
/** Default selfie JPEG height (px)
|
|
27
|
+
/** Default selfie JPEG height (px); also the `image_height` metadata fallback. */
|
|
23
28
|
readonly selfieJpegTargetHeight: 640;
|
|
24
29
|
};
|
|
25
30
|
//# sourceMappingURL=camera_defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera_defaults.d.ts","sourceRoot":"","sources":["../../src/camera/camera_defaults.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,eAAO,MAAM,cAAc;IACzB,
|
|
1
|
+
{"version":3,"file":"camera_defaults.d.ts","sourceRoot":"","sources":["../../src/camera/camera_defaults.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,eAAO,MAAM,cAAc;IACzB,wDAAwD;;IAExD,wDAAwD;;IAGxD,gFAAgF;;IAEhF,yFAAyF;;;;;IAEzF,gHAAgH;;;;;IAGhH,gFAAgF;;IAEhF,uDAAuD;;IAEvD,oFAAoF;;IAEpF,gFAAgF;;IAEhF,kFAAkF;;CAE1E,CAAC"}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
/** Static camera tuning defaults. */
|
|
2
2
|
export const CameraDefaults = {
|
|
3
|
-
/** Focus running indicator visibility duration
|
|
3
|
+
/** Focus running indicator visibility duration (ms). */
|
|
4
4
|
focusRunningDurationMs: 600,
|
|
5
|
-
/** Focus settled indicator visibility duration
|
|
5
|
+
/** Focus settled indicator visibility duration (ms). */
|
|
6
6
|
focusSettledDurationMs: 500,
|
|
7
|
-
/** Pinned analysis-stream frame rate
|
|
7
|
+
/** Pinned analysis-stream frame rate; 30 fps keeps motion smooth at low ISO. */
|
|
8
8
|
analysisTargetFps: 30,
|
|
9
|
-
/**
|
|
9
|
+
/** Selfie analysis resolution (4:3 — the face/smile heuristics are calibrated on it). */
|
|
10
10
|
analysisTargetResolution: { width: 640, height: 480 },
|
|
11
|
-
/**
|
|
11
|
+
/** Document analysis resolution (16:9, matched to the visible preview so the guide-rect crop stays aligned). */
|
|
12
|
+
documentAnalysisResolution: { width: 1280, height: 720 },
|
|
13
|
+
/** Longest-edge ceiling (px) for an imported document image; downscale-only. */
|
|
12
14
|
documentMaxDimension: 1600,
|
|
13
|
-
/** JPEG
|
|
15
|
+
/** JPEG quality (0–1) for imported document images. */
|
|
14
16
|
documentJpegQuality: 0.85,
|
|
15
|
-
/** Minimum shortest-edge (px) for a gallery document image; smaller is rejected
|
|
17
|
+
/** Minimum shortest-edge (px) for a gallery document image; smaller is rejected. */
|
|
16
18
|
minGalleryDocumentDimensionPx: 600,
|
|
17
|
-
/** Default selfie JPEG width (px)
|
|
19
|
+
/** Default selfie JPEG width (px); also the `image_width` metadata fallback. */
|
|
18
20
|
selfieJpegTargetWidth: 480,
|
|
19
|
-
/** Default selfie JPEG height (px)
|
|
21
|
+
/** Default selfie JPEG height (px); also the `image_height` metadata fallback. */
|
|
20
22
|
selfieJpegTargetHeight: 640,
|
|
21
23
|
};
|
|
22
24
|
//# sourceMappingURL=camera_defaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera_defaults.js","sourceRoot":"","sources":["../../src/camera/camera_defaults.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,
|
|
1
|
+
{"version":3,"file":"camera_defaults.js","sourceRoot":"","sources":["../../src/camera/camera_defaults.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,wDAAwD;IACxD,sBAAsB,EAAE,GAAG;IAC3B,wDAAwD;IACxD,sBAAsB,EAAE,GAAG;IAE3B,gFAAgF;IAChF,iBAAiB,EAAE,EAAE;IACrB,yFAAyF;IACzF,wBAAwB,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAW;IAC9D,gHAAgH;IAChH,0BAA0B,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAW;IAEjE,gFAAgF;IAChF,oBAAoB,EAAE,IAAI;IAC1B,uDAAuD;IACvD,mBAAmB,EAAE,IAAI;IACzB,oFAAoF;IACpF,6BAA6B,EAAE,GAAG;IAClC,gFAAgF;IAChF,qBAAqB,EAAE,GAAG;IAC1B,kFAAkF;IAClF,sBAAsB,EAAE,GAAG;CACnB,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { Orientation } from "react-native-vision-camera";
|
|
2
2
|
/**
|
|
3
|
-
* Map VisionCamera
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
8
|
-
* not how the user is holding the phone.
|
|
3
|
+
* Map a VisionCamera {@link Orientation} to clockwise degrees (`0` = portrait).
|
|
4
|
+
* Feeds two callers: `onOutputOrientationChanged` (gravity tilt → the upright
|
|
5
|
+
* validator) and `onPreviewOrientationChanged` (locked viewport axis → the
|
|
6
|
+
* document `viewportOrientation` the frame processor uprights the capture to).
|
|
7
|
+
* Never use `frame.orientation` — that is the fixed sensor mounting.
|
|
9
8
|
*/
|
|
10
9
|
export declare function orientationToDegrees(orientation: Orientation): number;
|
|
11
10
|
//# sourceMappingURL=orientation_degrees.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orientation_degrees.d.ts","sourceRoot":"","sources":["../../src/camera/orientation_degrees.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D
|
|
1
|
+
{"version":3,"file":"orientation_degrees.d.ts","sourceRoot":"","sources":["../../src/camera/orientation_degrees.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAWrE"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Map VisionCamera
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
* not how the user is holding the phone.
|
|
2
|
+
* Map a VisionCamera {@link Orientation} to clockwise degrees (`0` = portrait).
|
|
3
|
+
* Feeds two callers: `onOutputOrientationChanged` (gravity tilt → the upright
|
|
4
|
+
* validator) and `onPreviewOrientationChanged` (locked viewport axis → the
|
|
5
|
+
* document `viewportOrientation` the frame processor uprights the capture to).
|
|
6
|
+
* Never use `frame.orientation` — that is the fixed sensor mounting.
|
|
8
7
|
*/
|
|
9
8
|
export function orientationToDegrees(orientation) {
|
|
10
9
|
switch (orientation) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orientation_degrees.js","sourceRoot":"","sources":["../../src/camera/orientation_degrees.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"orientation_degrees.js","sourceRoot":"","sources":["../../src/camera/orientation_degrees.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAAwB;IAC3D,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,UAAU;YACb,OAAO,CAAC,CAAC;QACX,KAAK,gBAAgB;YACnB,OAAO,EAAE,CAAC;QACZ,KAAK,sBAAsB;YACzB,OAAO,GAAG,CAAC;QACb,KAAK,iBAAiB;YACpB,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -31,4 +31,12 @@ export declare const DocumentCaptureMode: {
|
|
|
31
31
|
/** Auto-capture, but surface a manual shutter button after `activateManualAfterMs`. */
|
|
32
32
|
readonly AutoCaptureWithManualFallback: (args?: AutoCaptureWithManualFallbackArgs) => DocumentCaptureMode;
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* The wire token the server expects for the `auto_capture_enabled` builder-configuration field,
|
|
36
|
+
* keyed off the mode's `kind`. Lives with {@link DocumentCaptureMode} — its single source of
|
|
37
|
+
* truth — so the metadata layer maps the partner's typed choice straight onto the wire without a
|
|
38
|
+
* parallel enum. These exact strings are the server contract; changing them is a wire-breaking
|
|
39
|
+
* change. Not part of the public package surface (not re-exported from `index.ts`).
|
|
40
|
+
*/
|
|
41
|
+
export declare function autoCaptureWireValue(mode: DocumentCaptureMode | undefined): string;
|
|
34
42
|
//# sourceMappingURL=document_capture_mode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document_capture_mode.d.ts","sourceRoot":"","sources":["../../../src/core/models/document_capture_mode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;CAAE,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;CAAE,GAClC;IACE,QAAQ,CAAC,IAAI,EAAE,+BAA+B,CAAC;IAC/C,uEAAuE;IACvE,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;CACxC,CAAC;AAEN,uEAAuE;AACvE,eAAO,MAAM,gCAAgC,QAAS,CAAC;AASvD,yFAAyF;AACzF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,mBAAmB;IAC9B,oEAAoE;;uBAzBjD,aAAa;;IA2BhC,gEAAgE;;uBA1B7C,eAAe;;IA4BlC,uFAAuF;oDAE/E,iCAAiC,KACtC,mBAAmB;CAOd,CAAC"}
|
|
1
|
+
{"version":3,"file":"document_capture_mode.d.ts","sourceRoot":"","sources":["../../../src/core/models/document_capture_mode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;CAAE,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;CAAE,GAClC;IACE,QAAQ,CAAC,IAAI,EAAE,+BAA+B,CAAC;IAC/C,uEAAuE;IACvE,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;CACxC,CAAC;AAEN,uEAAuE;AACvE,eAAO,MAAM,gCAAgC,QAAS,CAAC;AASvD,yFAAyF;AACzF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,mBAAmB;IAC9B,oEAAoE;;uBAzBjD,aAAa;;IA2BhC,gEAAgE;;uBA1B7C,eAAe;;IA4BlC,uFAAuF;oDAE/E,iCAAiC,KACtC,mBAAmB;CAOd,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,mBAAmB,GAAG,SAAS,GACpC,MAAM,CAgBR"}
|
|
@@ -20,4 +20,28 @@ export const DocumentCaptureMode = {
|
|
|
20
20
|
});
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* The wire token the server expects for the `auto_capture_enabled` builder-configuration field,
|
|
25
|
+
* keyed off the mode's `kind`. Lives with {@link DocumentCaptureMode} — its single source of
|
|
26
|
+
* truth — so the metadata layer maps the partner's typed choice straight onto the wire without a
|
|
27
|
+
* parallel enum. These exact strings are the server contract; changing them is a wire-breaking
|
|
28
|
+
* change. Not part of the public package surface (not re-exported from `index.ts`).
|
|
29
|
+
*/
|
|
30
|
+
export function autoCaptureWireValue(mode) {
|
|
31
|
+
switch (mode?.kind) {
|
|
32
|
+
case "autoCapture":
|
|
33
|
+
return "auto_capture_only";
|
|
34
|
+
case "manualCapture":
|
|
35
|
+
return "manual";
|
|
36
|
+
case "autoCaptureWithManualFallback":
|
|
37
|
+
case undefined:
|
|
38
|
+
return "autocapture_default";
|
|
39
|
+
default: {
|
|
40
|
+
// Exhaustiveness guard: a new DocumentCaptureMode kind fails to compile here
|
|
41
|
+
// until it's handled above (`mode` narrows to `never` once all kinds are covered).
|
|
42
|
+
const exhaustive = mode;
|
|
43
|
+
return exhaustive;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
23
47
|
//# sourceMappingURL=document_capture_mode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document_capture_mode.js","sourceRoot":"","sources":["../../../src/core/models/document_capture_mode.ts"],"names":[],"mappings":"AAcA,uEAAuE;AACvE,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAC;AAEvD,MAAM,YAAY,GAAwB,MAAM,CAAC,MAAM,CAAC;IACtD,IAAI,EAAE,aAAa;CACpB,CAAC,CAAC;AACH,MAAM,cAAc,GAAwB,MAAM,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,eAAe;CACtB,CAAC,CAAC;AAOH,qGAAqG;AACrG,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,oEAAoE;IACpE,WAAW,EAAE,YAAY;IACzB,gEAAgE;IAChE,aAAa,EAAE,cAAc;IAC7B,uFAAuF;IACvF,6BAA6B,CAC3B,OAA0C,EAAE;QAE5C,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,+BAA+B;YACrC,qBAAqB,EACnB,IAAI,CAAC,qBAAqB,IAAI,gCAAgC;SACjE,CAAC,CAAC;IACL,CAAC;CACO,CAAC"}
|
|
1
|
+
{"version":3,"file":"document_capture_mode.js","sourceRoot":"","sources":["../../../src/core/models/document_capture_mode.ts"],"names":[],"mappings":"AAcA,uEAAuE;AACvE,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAC;AAEvD,MAAM,YAAY,GAAwB,MAAM,CAAC,MAAM,CAAC;IACtD,IAAI,EAAE,aAAa;CACpB,CAAC,CAAC;AACH,MAAM,cAAc,GAAwB,MAAM,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,eAAe;CACtB,CAAC,CAAC;AAOH,qGAAqG;AACrG,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,oEAAoE;IACpE,WAAW,EAAE,YAAY;IACzB,gEAAgE;IAChE,aAAa,EAAE,cAAc;IAC7B,uFAAuF;IACvF,6BAA6B,CAC3B,OAA0C,EAAE;QAE5C,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,+BAA+B;YACrC,qBAAqB,EACnB,IAAI,CAAC,qBAAqB,IAAI,gCAAgC;SACjE,CAAC,CAAC;IACL,CAAC;CACO,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAqC;IAErC,QAAQ,IAAI,EAAE,IAAI,EAAE,CAAC;QACnB,KAAK,aAAa;YAChB,OAAO,mBAAmB,CAAC;QAC7B,KAAK,eAAe;YAClB,OAAO,QAAQ,CAAC;QAClB,KAAK,+BAA+B,CAAC;QACrC,KAAK,SAAS;YACZ,OAAO,qBAAqB,CAAC;QAC/B,OAAO,CAAC,CAAC,CAAC;YACR,6EAA6E;YAC7E,mFAAmF;YACnF,MAAM,UAAU,GAAU,IAAI,CAAC;YAC/B,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -31,11 +31,11 @@ export type GenericDocumentArgs = {
|
|
|
31
31
|
};
|
|
32
32
|
/** Preset values and the `GenericDocument` factory for {@link DocumentType}. */
|
|
33
33
|
export declare const DocumentType: {
|
|
34
|
-
/** South Africa Green Book — booklet-style,
|
|
34
|
+
/** South Africa Green Book — booklet-style, single-side, portrait. */
|
|
35
35
|
readonly SouthAfricaGreenBook: {
|
|
36
36
|
readonly kind: "southAfricaGreenBook";
|
|
37
37
|
} & DocumentTypeFields;
|
|
38
|
-
/** Passport — single data page, no back side,
|
|
38
|
+
/** Passport — single data page, no back side, landscape. */
|
|
39
39
|
readonly Passport: {
|
|
40
40
|
readonly kind: "passport";
|
|
41
41
|
} & DocumentTypeFields;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document_type.d.ts","sourceRoot":"","sources":["../../../src/core/models/document_type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,sDAAsD;AACtD,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,UAAU,CAAC;AAE3D,KAAK,kBAAkB,GAAG;IACxB,qDAAqD;IACrD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;IAC1C,4FAA4F;IAC5F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,YAAY,GACpB,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;CAAE,GAAG,kBAAkB,CAAC,GAChE,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,kBAAkB,CAAC,GACpD,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAAG,kBAAkB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"document_type.d.ts","sourceRoot":"","sources":["../../../src/core/models/document_type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,sDAAsD;AACtD,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,UAAU,CAAC;AAE3D,KAAK,kBAAkB,GAAG;IACxB,qDAAqD;IACrD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;IAC1C,4FAA4F;IAC5F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,YAAY,GACpB,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;CAAE,GAAG,kBAAkB,CAAC,GAChE,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,kBAAkB,CAAC,GACpD,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAAG,kBAAkB,CAAC,CAAC;AAkBhE,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAC3C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,YAAY;IACvB,sEAAsE;;uBA9BlD,sBAAsB;;IAgC1C,4DAA4D;;uBA/BxC,UAAU;;IAiC9B,iFAAiF;sCAC3D,mBAAmB,KAAQ,YAAY;CAWrD,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,mBAAmB,GAC/B,MAAM,CAER"}
|
|
@@ -6,20 +6,22 @@
|
|
|
6
6
|
const SOUTH_AFRICA_GREEN_BOOK = Object.freeze({
|
|
7
7
|
kind: "southAfricaGreenBook",
|
|
8
8
|
displayName: "Green Book",
|
|
9
|
-
hasBackSide:
|
|
9
|
+
hasBackSide: false,
|
|
10
10
|
orientation: "Portrait",
|
|
11
|
+
knownAspectRatio: 320 / 428,
|
|
11
12
|
});
|
|
12
13
|
const PASSPORT = Object.freeze({
|
|
13
14
|
kind: "passport",
|
|
14
15
|
displayName: "Passport",
|
|
15
16
|
hasBackSide: false,
|
|
16
|
-
orientation: "
|
|
17
|
+
orientation: "Landscape",
|
|
18
|
+
knownAspectRatio: 356 / 272,
|
|
17
19
|
});
|
|
18
20
|
/** Preset values and the `GenericDocument` factory for {@link DocumentType}. */
|
|
19
21
|
export const DocumentType = {
|
|
20
|
-
/** South Africa Green Book — booklet-style,
|
|
22
|
+
/** South Africa Green Book — booklet-style, single-side, portrait. */
|
|
21
23
|
SouthAfricaGreenBook: SOUTH_AFRICA_GREEN_BOOK,
|
|
22
|
-
/** Passport — single data page, no back side,
|
|
24
|
+
/** Passport — single data page, no back side, landscape. */
|
|
23
25
|
Passport: PASSPORT,
|
|
24
26
|
/** Catch-all without a preset; defaults to a landscape, two-sided "Document". */
|
|
25
27
|
GenericDocument(args = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document_type.js","sourceRoot":"","sources":["../../../src/core/models/document_type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqBH,MAAM,uBAAuB,GAAiB,MAAM,CAAC,MAAM,CAAC;IAC1D,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"document_type.js","sourceRoot":"","sources":["../../../src/core/models/document_type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqBH,MAAM,uBAAuB,GAAiB,MAAM,CAAC,MAAM,CAAC;IAC1D,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,UAAU;IACvB,gBAAgB,EAAE,GAAG,GAAG,GAAG;CAC5B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAiB,MAAM,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,WAAW;IACxB,gBAAgB,EAAE,GAAG,GAAG,GAAG;CAC5B,CAAC,CAAC;AAUH,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,sEAAsE;IACtE,oBAAoB,EAAE,uBAAuB;IAC7C,4DAA4D;IAC5D,QAAQ,EAAE,QAAQ;IAClB,iFAAiF;IACjF,eAAe,CAAC,OAA4B,EAAE;QAC5C,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,UAAU;YAC3C,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI;YACrC,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,WAAW;YAC5C,GAAG,CAAC,IAAI,CAAC,gBAAgB,KAAK,SAAS;gBACrC,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE;gBAC7C,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;IACL,CAAC;CACO,CAAC;AAEX;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,WAAgC;IAEhC,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACnD,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The outcome of an SDK operation: success with a value, failure with an
|
|
3
|
+
* error, or cancellation when the user exits the flow. Surfaced to
|
|
4
|
+
* partners through `onResult`.
|
|
3
5
|
*
|
|
4
6
|
* Partners never need to unwrap a `UseSmileIDResult` directly — all
|
|
5
7
|
* errors are automatically surfaced through the `onResult` callback.
|
|
6
8
|
* The discriminated union lets partner code `switch (result.status)`
|
|
7
|
-
* and exhaust
|
|
9
|
+
* and exhaust the branches without try/catch ceremony.
|
|
8
10
|
*/
|
|
9
11
|
export type UseSmileIDResult<T> = {
|
|
10
12
|
readonly status: "success";
|
|
@@ -15,15 +17,14 @@ export type UseSmileIDResult<T> = {
|
|
|
15
17
|
} | {
|
|
16
18
|
readonly status: "cancelled";
|
|
17
19
|
};
|
|
18
|
-
/**
|
|
20
|
+
/** A successful outcome carrying the resulting value. */
|
|
19
21
|
export declare function success<T>(value: T): UseSmileIDResult<T>;
|
|
20
|
-
/**
|
|
22
|
+
/** A failed outcome carrying the causing error. */
|
|
21
23
|
export declare function failure<T>(error: unknown): UseSmileIDResult<T>;
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
24
|
-
* (e.g. back-pressed out of the first screen)
|
|
25
|
-
*
|
|
26
|
-
* cancellation apart from an error.
|
|
25
|
+
* The user deliberately exited the flow without completing or failing it
|
|
26
|
+
* (e.g. back-pressed out of the first screen) — distinct from a failure
|
|
27
|
+
* so cancellation can be handled separately.
|
|
27
28
|
*/
|
|
28
29
|
export declare function cancelled<T>(): UseSmileIDResult<T>;
|
|
29
30
|
//# sourceMappingURL=result.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/core/models/result.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/core/models/result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAC1B;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC;AAErC,yDAAyD;AACzD,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAExD;AAED,mDAAmD;AACnD,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,KAAK,gBAAgB,CAAC,CAAC,CAAC,CAElD"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** A successful outcome carrying the resulting value. */
|
|
2
2
|
export function success(value) {
|
|
3
3
|
return { status: "success", value };
|
|
4
4
|
}
|
|
5
|
-
/**
|
|
5
|
+
/** A failed outcome carrying the causing error. */
|
|
6
6
|
export function failure(error) {
|
|
7
7
|
return { status: "failure", error };
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* (e.g. back-pressed out of the first screen)
|
|
12
|
-
*
|
|
13
|
-
* cancellation apart from an error.
|
|
10
|
+
* The user deliberately exited the flow without completing or failing it
|
|
11
|
+
* (e.g. back-pressed out of the first screen) — distinct from a failure
|
|
12
|
+
* so cancellation can be handled separately.
|
|
14
13
|
*/
|
|
15
14
|
export function cancelled() {
|
|
16
15
|
return { status: "cancelled" };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/core/models/result.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/core/models/result.ts"],"names":[],"mappings":"AAeA,yDAAyD;AACzD,MAAM,UAAU,OAAO,CAAI,KAAQ;IACjC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACtC,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,OAAO,CAAI,KAAc;IACvC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -20,7 +20,7 @@ import { currentRequestTimestamp } from "../../security/request_timestamp";
|
|
|
20
20
|
* value written by `TokenRefreshInterceptor` is observed automatically
|
|
21
21
|
* by the next outgoing request.
|
|
22
22
|
*/
|
|
23
|
-
const SDK_VERSION = "12.0.0
|
|
23
|
+
const SDK_VERSION = "12.0.0";
|
|
24
24
|
/**
|
|
25
25
|
* Source-SDK identifier, suffixed with the runtime platform so the server can
|
|
26
26
|
* attribute the request and resolve the matching per-SDK signing secret.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smile_auth_interceptor.js","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_auth_interceptor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAG3E;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"smile_auth_interceptor.js","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_auth_interceptor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAG3E;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,GAAG,QAAQ,CAAC;AAE7B;;;GAGG;AACH,SAAS,SAAS;IAChB,QAAQ,QAAQ,CAAC,EAAE,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,6BAA6B,CAAC;QACvC,KAAK,KAAK;YACR,OAAO,yBAAyB,CAAC;QACnC;YACE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;AACH,CAAC;AAOD,MAAM,OAAO,oBAAoB;IACd,cAAc,CAAgB;IAC9B,YAAY,CAAc;IAE3C,YAAY,OAAoC;QAC9C,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,MAAqB;QAC1B,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACjE,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChC,CAAC;IAEO,KAAK,CAAC,UAAU,CACtB,MAAkC;QAElC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,SAAS,EAAE,CAAC,CAAC;QACtD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,WAAW,CAAC,CAAC;QAC9D,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACxE,IAAI,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;YACpC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACtE,CAAC;QACD,2EAA2E;QAC3E,uEAAuE;QACvE,yEAAyE;QACzE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,uBAAuB,EAAE,CAAC,CAAC;QAC3E,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AxiosInstance } from "axios";
|
|
2
|
+
import type { SecurityPolicy } from "../../security/security_policy";
|
|
2
3
|
/**
|
|
3
4
|
* Stamps the `smileid-device-nonce` header on every outbound request
|
|
4
5
|
* whose axios config declares `_useSmileIDAttestation: true`. The
|
|
@@ -26,11 +27,21 @@ import type { AxiosInstance } from "axios";
|
|
|
26
27
|
* Warm-up lives outside the interceptor. Call `Attestation.warmUp()`
|
|
27
28
|
* once at flow mount so the per-request `requestToken` call doesn't
|
|
28
29
|
* pay the multi-second warm-up cost on every submission.
|
|
30
|
+
*
|
|
31
|
+
* Attestation is additionally gated by the server-driven {@link SecurityPolicy}:
|
|
32
|
+
* when the session's policy disables the device-attestation check, an opted-in
|
|
33
|
+
* request ships without a device nonce. The policy is fail-secure, so a token
|
|
34
|
+
* that omits the claim attests as before.
|
|
29
35
|
*/
|
|
30
36
|
export declare const DEVICE_NONCE_HEADER = "smileid-device-nonce";
|
|
31
37
|
/** Axios config key that opts a request into attestation stamping. */
|
|
32
38
|
export declare const ATTESTATION_OPT_IN_KEY = "_useSmileIDAttestation";
|
|
39
|
+
export type SmileIntegrityInterceptorOptions = {
|
|
40
|
+
readonly securityPolicy: SecurityPolicy;
|
|
41
|
+
};
|
|
33
42
|
export declare class SmileIntegrityInterceptor {
|
|
43
|
+
private readonly _securityPolicy;
|
|
44
|
+
constructor(options: SmileIntegrityInterceptorOptions);
|
|
34
45
|
attach(client: AxiosInstance): {
|
|
35
46
|
request: number;
|
|
36
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smile_integrity_interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_integrity_interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"smile_integrity_interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_integrity_interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAIvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAE/D,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACzC,CAAC;AAEF,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;gBAErC,OAAO,EAAE,gCAAgC;IAIrD,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;YAOpC,UAAU;CA4BzB"}
|
|
@@ -27,11 +27,20 @@ import { REQUEST_MAC_HEADER } from "./smile_request_mac_interceptor";
|
|
|
27
27
|
* Warm-up lives outside the interceptor. Call `Attestation.warmUp()`
|
|
28
28
|
* once at flow mount so the per-request `requestToken` call doesn't
|
|
29
29
|
* pay the multi-second warm-up cost on every submission.
|
|
30
|
+
*
|
|
31
|
+
* Attestation is additionally gated by the server-driven {@link SecurityPolicy}:
|
|
32
|
+
* when the session's policy disables the device-attestation check, an opted-in
|
|
33
|
+
* request ships without a device nonce. The policy is fail-secure, so a token
|
|
34
|
+
* that omits the claim attests as before.
|
|
30
35
|
*/
|
|
31
36
|
export const DEVICE_NONCE_HEADER = "smileid-device-nonce";
|
|
32
37
|
/** Axios config key that opts a request into attestation stamping. */
|
|
33
38
|
export const ATTESTATION_OPT_IN_KEY = "_useSmileIDAttestation";
|
|
34
39
|
export class SmileIntegrityInterceptor {
|
|
40
|
+
_securityPolicy;
|
|
41
|
+
constructor(options) {
|
|
42
|
+
this._securityPolicy = options.securityPolicy;
|
|
43
|
+
}
|
|
35
44
|
attach(client) {
|
|
36
45
|
const requestId = client.interceptors.request.use(async (config) => {
|
|
37
46
|
return this._onRequest(config);
|
|
@@ -42,6 +51,10 @@ export class SmileIntegrityInterceptor {
|
|
|
42
51
|
const optedIn = config[ATTESTATION_OPT_IN_KEY] === true;
|
|
43
52
|
if (!optedIn)
|
|
44
53
|
return config;
|
|
54
|
+
// Server-driven policy can switch device attestation off for this session; when it is off,
|
|
55
|
+
// ship the opted-in request without requesting a token.
|
|
56
|
+
if (!this._securityPolicy.isPlayIntegrityCheckActive())
|
|
57
|
+
return config;
|
|
45
58
|
const macHeader = config.headers.get(REQUEST_MAC_HEADER);
|
|
46
59
|
if (typeof macHeader !== "string")
|
|
47
60
|
return config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smile_integrity_interceptor.js","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_integrity_interceptor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"smile_integrity_interceptor.js","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_integrity_interceptor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAG/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAE1D,sEAAsE;AACtE,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAM/D,MAAM,OAAO,yBAAyB;IACnB,eAAe,CAAiB;IAEjD,YAAY,OAAyC;QACnD,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,MAAqB;QAC1B,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACjE,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChC,CAAC;IAEO,KAAK,CAAC,UAAU,CACtB,MAAkC;QAElC,MAAM,OAAO,GACV,MAA+D,CAC9D,sBAAsB,CACvB,KAAK,IAAI,CAAC;QACb,IAAI,CAAC,OAAO;YAAE,OAAO,MAAM,CAAC;QAE5B,2FAA2F;QAC3F,wDAAwD;QACxD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,0BAA0B,EAAE;YAAE,OAAO,MAAM,CAAC;QAEtE,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACzD,IAAI,OAAO,SAAS,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC;QAEjD,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;YACxD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;YACpC,MAAM,CAAC,OAAO,CAAC,GAAG,CAChB,mBAAmB,EACnB,OAAO,kBAAkB,CAAC,OAAO,CAAC,EAAE,CACrC,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,YAAY,oBAAoB;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IAChE,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IACjD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AxiosInstance } from "axios";
|
|
2
2
|
import type { SmileIDCryptoManager } from "../../security/smile_id_crypto_manager";
|
|
3
|
+
import type { SecurityPolicy } from "../../security/security_policy";
|
|
3
4
|
/**
|
|
4
5
|
* Stamps the `smileid-request-mac` header on every outbound request whose axios
|
|
5
6
|
* config declares `_useSmileIDRequestMac: true`. The value is computed by
|
|
@@ -15,6 +16,11 @@ import type { SmileIDCryptoManager } from "../../security/smile_id_crypto_manage
|
|
|
15
16
|
* rather than signed against an invented timestamp.
|
|
16
17
|
*
|
|
17
18
|
* Requests without the opt-in flag pass through unchanged.
|
|
19
|
+
*
|
|
20
|
+
* Signing is additionally gated by the server-driven {@link SecurityPolicy}: when the session's
|
|
21
|
+
* policy disables payload signing, an opted-in request still ships, just unsigned — the same wire
|
|
22
|
+
* shape as an opt-out request. The policy is fail-secure, so a token that omits the claim signs as
|
|
23
|
+
* before.
|
|
18
24
|
*/
|
|
19
25
|
export declare const REQUEST_MAC_HEADER = "smileid-request-mac";
|
|
20
26
|
export declare const REQUEST_TIMESTAMP_HEADER = "smileid-request-timestamp";
|
|
@@ -22,9 +28,11 @@ export declare const REQUEST_TIMESTAMP_HEADER = "smileid-request-timestamp";
|
|
|
22
28
|
export declare const REQUEST_MAC_OPT_IN_KEY = "_useSmileIDRequestMac";
|
|
23
29
|
export type SmileRequestMacInterceptorOptions = {
|
|
24
30
|
readonly cryptoManager: SmileIDCryptoManager;
|
|
31
|
+
readonly securityPolicy: SecurityPolicy;
|
|
25
32
|
};
|
|
26
33
|
export declare class SmileRequestMacInterceptor {
|
|
27
34
|
private readonly _cryptoManager;
|
|
35
|
+
private readonly _securityPolicy;
|
|
28
36
|
constructor(options: SmileRequestMacInterceptorOptions);
|
|
29
37
|
attach(client: AxiosInstance): {
|
|
30
38
|
request: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smile_request_mac_interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_request_mac_interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAGvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"smile_request_mac_interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_request_mac_interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAGvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAEpE,8DAA8D;AAC9D,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAE9D,MAAM,MAAM,iCAAiC,GAAG;IAC9C,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;IAC7C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACzC,CAAC;AAEF,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;gBAErC,OAAO,EAAE,iCAAiC;IAKtD,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;YAOpC,UAAU;CAgCzB"}
|
|
@@ -14,6 +14,11 @@ import { SmileIDCryptoError } from "../../security/smile_id_crypto_error";
|
|
|
14
14
|
* rather than signed against an invented timestamp.
|
|
15
15
|
*
|
|
16
16
|
* Requests without the opt-in flag pass through unchanged.
|
|
17
|
+
*
|
|
18
|
+
* Signing is additionally gated by the server-driven {@link SecurityPolicy}: when the session's
|
|
19
|
+
* policy disables payload signing, an opted-in request still ships, just unsigned — the same wire
|
|
20
|
+
* shape as an opt-out request. The policy is fail-secure, so a token that omits the claim signs as
|
|
21
|
+
* before.
|
|
17
22
|
*/
|
|
18
23
|
export const REQUEST_MAC_HEADER = "smileid-request-mac";
|
|
19
24
|
export const REQUEST_TIMESTAMP_HEADER = "smileid-request-timestamp";
|
|
@@ -21,8 +26,10 @@ export const REQUEST_TIMESTAMP_HEADER = "smileid-request-timestamp";
|
|
|
21
26
|
export const REQUEST_MAC_OPT_IN_KEY = "_useSmileIDRequestMac";
|
|
22
27
|
export class SmileRequestMacInterceptor {
|
|
23
28
|
_cryptoManager;
|
|
29
|
+
_securityPolicy;
|
|
24
30
|
constructor(options) {
|
|
25
31
|
this._cryptoManager = options.cryptoManager;
|
|
32
|
+
this._securityPolicy = options.securityPolicy;
|
|
26
33
|
}
|
|
27
34
|
attach(client) {
|
|
28
35
|
const requestId = client.interceptors.request.use(async (config) => {
|
|
@@ -34,6 +41,10 @@ export class SmileRequestMacInterceptor {
|
|
|
34
41
|
const optedIn = config[REQUEST_MAC_OPT_IN_KEY] === true;
|
|
35
42
|
if (!optedIn)
|
|
36
43
|
return config;
|
|
44
|
+
// Server-driven policy can switch payload signing off for this session; when it is off, ship
|
|
45
|
+
// the opted-in request unsigned and let the server apply its policy.
|
|
46
|
+
if (!this._securityPolicy.isPayloadSigningActive())
|
|
47
|
+
return config;
|
|
37
48
|
const timestamp = config.headers.get(REQUEST_TIMESTAMP_HEADER);
|
|
38
49
|
if (typeof timestamp !== "string")
|
|
39
50
|
return config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smile_request_mac_interceptor.js","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_request_mac_interceptor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"smile_request_mac_interceptor.js","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_request_mac_interceptor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAI1E;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AACxD,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AAEpE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAO9D,MAAM,OAAO,0BAA0B;IACpB,cAAc,CAAuB;IACrC,eAAe,CAAiB;IAEjD,YAAY,OAA0C;QACpD,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,MAAqB;QAC1B,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACjE,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChC,CAAC;IAEO,KAAK,CAAC,UAAU,CACtB,MAAkC;QAElC,MAAM,OAAO,GACV,MAA+D,CAC9D,sBAAsB,CACvB,KAAK,IAAI,CAAC;QACb,IAAI,CAAC,OAAO;YAAE,OAAO,MAAM,CAAC;QAE5B,6FAA6F;QAC7F,qEAAqE;QACrE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,sBAAsB,EAAE;YAAE,OAAO,MAAM,CAAC;QAElE,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QAC/D,IAAI,OAAO,SAAS,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC;QAEjD,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CACxC,SAAS,EACT,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,EAC/B,MAAM,CAAC,IAAI,CACZ,CAAC;YACF,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,KAAK,YAAY,kBAAkB,CAAC;gBAAE,MAAM,KAAK,CAAC;YACxD,mEAAmE;YACnE,sEAAsE;YACtE,mDAAmD;QACrD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,4EAA4E;AAC5E,SAAS,eAAe,CACtB,OAA8C;IAE9C,MAAM,MAAM,GACV,OAAQ,OAAsC,CAAC,MAAM,KAAK,UAAU;QAClE,CAAC,CAAG,OAAqC,CAAC,MAAM,EAG5C;QACJ,CAAC,CAAE,OAA8C,CAAC;IACtD,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,KAAK,IAAI,IAAI;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ImageTypeId } from "@smileid/usesmileid_bridge";
|
|
2
|
+
/**
|
|
3
|
+
* A single compressible image, abstracted so the orchestration logic (`PayloadCompressor`) is
|
|
4
|
+
* pure and unit-testable with in-memory fakes — the real implementation re-encodes the JPEG via
|
|
5
|
+
* a native module and re-stamps the Smile EXIF `image_digest` the backend validates.
|
|
6
|
+
*
|
|
7
|
+
* Contract: `recompress` **must re-encode from the retained source pixels**, never from the
|
|
8
|
+
* already-compressed bytes, so repeated steps don't stack generational loss and retries are
|
|
9
|
+
* deterministic. It is asynchronous because the encode/re-stamp delegates to native code.
|
|
10
|
+
*/
|
|
11
|
+
export interface CompressibleAsset {
|
|
12
|
+
/** The image's wire type — also the EXIF re-stamp's `image_type_id`. */
|
|
13
|
+
readonly imageType: ImageTypeId;
|
|
14
|
+
/** Current encoded JPEG size in bytes. */
|
|
15
|
+
encodedSize(): number;
|
|
16
|
+
/** Current re-encode quality in `[0, 1]`. Reports the capture quality before any recompress. */
|
|
17
|
+
quality(): number;
|
|
18
|
+
/** Re-encode from the retained source at `quality` (caller clamps to the floor). */
|
|
19
|
+
recompress(quality: number): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The full set of images in one submission. Any role may be absent (e.g. SmartSelfie has no
|
|
23
|
+
* documents; Enhanced KYC has no images at all → the compressor is a no-op).
|
|
24
|
+
*/
|
|
25
|
+
export declare class CompressibleAssets {
|
|
26
|
+
readonly selfie: CompressibleAsset | undefined;
|
|
27
|
+
readonly liveness: readonly CompressibleAsset[];
|
|
28
|
+
readonly documentFront: CompressibleAsset | undefined;
|
|
29
|
+
readonly documentBack: CompressibleAsset | undefined;
|
|
30
|
+
constructor(args: {
|
|
31
|
+
selfie?: CompressibleAsset | undefined;
|
|
32
|
+
liveness?: readonly CompressibleAsset[] | undefined;
|
|
33
|
+
documentFront?: CompressibleAsset | undefined;
|
|
34
|
+
documentBack?: CompressibleAsset | undefined;
|
|
35
|
+
});
|
|
36
|
+
/** All present assets, in submission order. */
|
|
37
|
+
all(): CompressibleAsset[];
|
|
38
|
+
/** Combined size of the front + back document images (0 when neither is present). */
|
|
39
|
+
documentCombinedSize(): number;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=compressible_asset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compressible_asset.d.ts","sourceRoot":"","sources":["../../../src/data/compression/compressible_asset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,0CAA0C;IAC1C,WAAW,IAAI,MAAM,CAAC;IACtB,gGAAgG;IAChG,OAAO,IAAI,MAAM,CAAC;IAClB,oFAAoF;IACpF,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,QAAQ,CAAC,aAAa,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtD,QAAQ,CAAC,YAAY,EAAE,iBAAiB,GAAG,SAAS,CAAC;gBAEzC,IAAI,EAAE;QAChB,MAAM,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;QACvC,QAAQ,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,CAAC;QACpD,aAAa,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;QAC9C,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;KAC9C;IAOD,+CAA+C;IAC/C,GAAG,IAAI,iBAAiB,EAAE;IAS1B,qFAAqF;IACrF,oBAAoB,IAAI,MAAM;CAM/B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The full set of images in one submission. Any role may be absent (e.g. SmartSelfie has no
|
|
3
|
+
* documents; Enhanced KYC has no images at all → the compressor is a no-op).
|
|
4
|
+
*/
|
|
5
|
+
export class CompressibleAssets {
|
|
6
|
+
selfie;
|
|
7
|
+
liveness;
|
|
8
|
+
documentFront;
|
|
9
|
+
documentBack;
|
|
10
|
+
constructor(args) {
|
|
11
|
+
this.selfie = args.selfie;
|
|
12
|
+
this.liveness = args.liveness ?? [];
|
|
13
|
+
this.documentFront = args.documentFront;
|
|
14
|
+
this.documentBack = args.documentBack;
|
|
15
|
+
}
|
|
16
|
+
/** All present assets, in submission order. */
|
|
17
|
+
all() {
|
|
18
|
+
const result = [];
|
|
19
|
+
if (this.selfie)
|
|
20
|
+
result.push(this.selfie);
|
|
21
|
+
result.push(...this.liveness);
|
|
22
|
+
if (this.documentFront)
|
|
23
|
+
result.push(this.documentFront);
|
|
24
|
+
if (this.documentBack)
|
|
25
|
+
result.push(this.documentBack);
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
/** Combined size of the front + back document images (0 when neither is present). */
|
|
29
|
+
documentCombinedSize() {
|
|
30
|
+
return ((this.documentFront?.encodedSize() ?? 0) +
|
|
31
|
+
(this.documentBack?.encodedSize() ?? 0));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=compressible_asset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compressible_asset.js","sourceRoot":"","sources":["../../../src/data/compression/compressible_asset.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IACpB,MAAM,CAAgC;IACtC,QAAQ,CAA+B;IACvC,aAAa,CAAgC;IAC7C,YAAY,CAAgC;IAErD,YAAY,IAKX;QACC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACxC,CAAC;IAED,+CAA+C;IAC/C,GAAG;QACD,MAAM,MAAM,GAAwB,EAAE,CAAC;QACvC,IAAI,IAAI,CAAC,MAAM;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,aAAa;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,YAAY;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACtD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,qFAAqF;IACrF,oBAAoB;QAClB,OAAO,CACL,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;YACxC,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CACxC,CAAC;IACJ,CAAC;CACF"}
|