@smileid/usesmileid 12.0.0-beta01 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +701 -89
- package/dist/camera/camera_defaults.d.ts +14 -9
- package/dist/camera/camera_defaults.d.ts.map +1 -1
- package/dist/camera/camera_defaults.js +11 -9
- package/dist/camera/camera_defaults.js.map +1 -1
- package/dist/camera/orientation_degrees.d.ts +5 -6
- package/dist/camera/orientation_degrees.d.ts.map +1 -1
- package/dist/camera/orientation_degrees.js +5 -6
- package/dist/camera/orientation_degrees.js.map +1 -1
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.d.ts +11 -0
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.d.ts.map +1 -0
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.js +17 -0
- package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.js.map +1 -0
- package/dist/core/exception/capture_validation_exceptions.d.ts +1 -0
- package/dist/core/exception/capture_validation_exceptions.d.ts.map +1 -1
- package/dist/core/exception/capture_validation_exceptions.js +1 -0
- package/dist/core/exception/capture_validation_exceptions.js.map +1 -1
- package/dist/core/exception/index.d.ts +1 -0
- package/dist/core/exception/index.d.ts.map +1 -1
- package/dist/core/exception/index.js +1 -0
- package/dist/core/exception/index.js.map +1 -1
- package/dist/core/exception/use_smile_id_error_code.d.ts +1 -0
- package/dist/core/exception/use_smile_id_error_code.d.ts.map +1 -1
- package/dist/core/exception/use_smile_id_error_code.js +1 -0
- package/dist/core/exception/use_smile_id_error_code.js.map +1 -1
- package/dist/core/models/config.d.ts +19 -0
- package/dist/core/models/config.d.ts.map +1 -1
- package/dist/core/models/document_capture_mode.d.ts +8 -0
- package/dist/core/models/document_capture_mode.d.ts.map +1 -1
- package/dist/core/models/document_capture_mode.js +24 -0
- package/dist/core/models/document_capture_mode.js.map +1 -1
- package/dist/core/models/document_type.d.ts +2 -2
- package/dist/core/models/document_type.d.ts.map +1 -1
- package/dist/core/models/document_type.js +7 -5
- package/dist/core/models/document_type.js.map +1 -1
- package/dist/core/models/global_privacy_control.d.ts +36 -0
- package/dist/core/models/global_privacy_control.d.ts.map +1 -0
- package/dist/core/models/global_privacy_control.js +39 -0
- package/dist/core/models/global_privacy_control.js.map +1 -0
- package/dist/core/models/network_config.d.ts +2 -2
- package/dist/core/models/network_config.js +2 -2
- package/dist/core/models/result.d.ts +9 -8
- package/dist/core/models/result.d.ts.map +1 -1
- package/dist/core/models/result.js +5 -6
- package/dist/core/models/result.js.map +1 -1
- package/dist/data/api/interceptors/smile_auth_interceptor.d.ts.map +1 -1
- package/dist/data/api/interceptors/smile_auth_interceptor.js +3 -17
- package/dist/data/api/interceptors/smile_auth_interceptor.js.map +1 -1
- package/dist/data/api/interceptors/smile_integrity_interceptor.d.ts +11 -0
- package/dist/data/api/interceptors/smile_integrity_interceptor.d.ts.map +1 -1
- package/dist/data/api/interceptors/smile_integrity_interceptor.js +13 -0
- package/dist/data/api/interceptors/smile_integrity_interceptor.js.map +1 -1
- package/dist/data/api/interceptors/smile_request_mac_interceptor.d.ts +8 -0
- package/dist/data/api/interceptors/smile_request_mac_interceptor.d.ts.map +1 -1
- package/dist/data/api/interceptors/smile_request_mac_interceptor.js +11 -0
- package/dist/data/api/interceptors/smile_request_mac_interceptor.js.map +1 -1
- package/dist/data/api/smile_id_api.d.ts +1 -1
- package/dist/data/api/smile_id_api.d.ts.map +1 -1
- package/dist/data/compression/compressible_asset.d.ts +41 -0
- package/dist/data/compression/compressible_asset.d.ts.map +1 -0
- package/dist/data/compression/compressible_asset.js +34 -0
- package/dist/data/compression/compressible_asset.js.map +1 -0
- package/dist/data/compression/payload_compression_config.d.ts +36 -0
- package/dist/data/compression/payload_compression_config.d.ts.map +1 -0
- package/dist/data/compression/payload_compression_config.js +52 -0
- package/dist/data/compression/payload_compression_config.js.map +1 -0
- package/dist/data/compression/payload_compression_runner.d.ts +29 -0
- package/dist/data/compression/payload_compression_runner.d.ts.map +1 -0
- package/dist/data/compression/payload_compression_runner.js +55 -0
- package/dist/data/compression/payload_compression_runner.js.map +1 -0
- package/dist/data/compression/payload_compressor.d.ts +40 -0
- package/dist/data/compression/payload_compressor.d.ts.map +1 -0
- package/dist/data/compression/payload_compressor.js +126 -0
- package/dist/data/compression/payload_compressor.js.map +1 -0
- package/dist/data/compression/uri_compressible_asset.d.ts +23 -0
- package/dist/data/compression/uri_compressible_asset.d.ts.map +1 -0
- package/dist/data/compression/uri_compressible_asset.js +77 -0
- package/dist/data/compression/uri_compressible_asset.js.map +1 -0
- package/dist/data/dsl/builder/cache_config_builder.d.ts +2 -1
- package/dist/data/dsl/builder/cache_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/cache_config_builder.js +2 -1
- package/dist/data/dsl/builder/cache_config_builder.js.map +1 -1
- package/dist/data/dsl/builder/config_builder.d.ts +40 -14
- package/dist/data/dsl/builder/config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/config_builder.js +40 -14
- package/dist/data/dsl/builder/config_builder.js.map +1 -1
- package/dist/data/dsl/builder/interceptor_config_builder.d.ts +9 -7
- package/dist/data/dsl/builder/interceptor_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/interceptor_config_builder.js +9 -7
- package/dist/data/dsl/builder/interceptor_config_builder.js.map +1 -1
- package/dist/data/dsl/builder/retry_config_builder.d.ts +19 -4
- package/dist/data/dsl/builder/retry_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/retry_config_builder.js +21 -6
- package/dist/data/dsl/builder/retry_config_builder.js.map +1 -1
- package/dist/data/dsl/builder/timeout_config_builder.d.ts +4 -0
- package/dist/data/dsl/builder/timeout_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/timeout_config_builder.js +4 -0
- package/dist/data/dsl/builder/timeout_config_builder.js.map +1 -1
- package/dist/data/dsl/use_smile_id_network_builder.d.ts +17 -0
- package/dist/data/dsl/use_smile_id_network_builder.d.ts.map +1 -1
- package/dist/data/dsl/use_smile_id_network_builder.js +17 -0
- package/dist/data/dsl/use_smile_id_network_builder.js.map +1 -1
- package/dist/data/factory/networking_factory.d.ts.map +1 -1
- package/dist/data/factory/networking_factory.js +11 -1
- package/dist/data/factory/networking_factory.js.map +1 -1
- package/dist/data/repository/use_smile_id_repository_impl.d.ts +6 -0
- package/dist/data/repository/use_smile_id_repository_impl.d.ts.map +1 -1
- package/dist/data/repository/use_smile_id_repository_impl.js +82 -8
- package/dist/data/repository/use_smile_id_repository_impl.js.map +1 -1
- package/dist/data/security/request_canonicalizer.d.ts.map +1 -1
- package/dist/data/security/request_canonicalizer.js +14 -2
- package/dist/data/security/request_canonicalizer.js.map +1 -1
- package/dist/data/security/security_policy.d.ts +43 -0
- package/dist/data/security/security_policy.d.ts.map +1 -0
- package/dist/data/security/security_policy.js +61 -0
- package/dist/data/security/security_policy.js.map +1 -0
- package/dist/data/smile_id_urls.d.ts +1 -1
- package/dist/data/smile_id_urls.js +1 -1
- package/dist/data/smile_id_urls.js.map +1 -1
- package/dist/data/util/retry_util.d.ts +2 -2
- package/dist/data/util/retry_util.d.ts.map +1 -1
- package/dist/data/util/retry_util.js +7 -1
- package/dist/data/util/retry_util.js.map +1 -1
- package/dist/data/util/use_smile_id_token_decoder.d.ts +22 -0
- package/dist/data/util/use_smile_id_token_decoder.d.ts.map +1 -1
- package/dist/data/util/use_smile_id_token_decoder.js +58 -24
- package/dist/data/util/use_smile_id_token_decoder.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/l10n/strings_en.d.ts +2 -1
- package/dist/l10n/strings_en.d.ts.map +1 -1
- package/dist/l10n/strings_en.js +2 -1
- package/dist/l10n/strings_en.js.map +1 -1
- package/dist/l10n/use_smile_id_localizations.d.ts +1 -0
- package/dist/l10n/use_smile_id_localizations.d.ts.map +1 -1
- package/dist/l10n/use_smile_id_localizations.js +3 -0
- package/dist/l10n/use_smile_id_localizations.js.map +1 -1
- package/dist/metadata/builder_configuration.d.ts +44 -0
- package/dist/metadata/builder_configuration.d.ts.map +1 -0
- package/dist/metadata/builder_configuration.js +35 -0
- package/dist/metadata/builder_configuration.js.map +1 -0
- package/dist/metadata/captured_image_properties.d.ts +11 -0
- package/dist/metadata/captured_image_properties.d.ts.map +1 -0
- package/dist/metadata/captured_image_properties.js +11 -0
- package/dist/metadata/captured_image_properties.js.map +1 -0
- package/dist/metadata/device_orientation_collector.d.ts +17 -0
- package/dist/metadata/device_orientation_collector.d.ts.map +1 -0
- package/dist/metadata/device_orientation_collector.js +66 -0
- package/dist/metadata/device_orientation_collector.js.map +1 -0
- package/dist/metadata/geolocation.d.ts +20 -0
- package/dist/metadata/geolocation.d.ts.map +1 -0
- package/dist/metadata/geolocation.js +40 -0
- package/dist/metadata/geolocation.js.map +1 -0
- package/dist/metadata/metadata_configuration_mappers.d.ts +47 -0
- package/dist/metadata/metadata_configuration_mappers.d.ts.map +1 -0
- package/dist/metadata/metadata_configuration_mappers.js +178 -0
- package/dist/metadata/metadata_configuration_mappers.js.map +1 -0
- package/dist/metadata/model_configuration.d.ts +41 -0
- package/dist/metadata/model_configuration.d.ts.map +1 -0
- package/dist/metadata/model_configuration.js +44 -0
- package/dist/metadata/model_configuration.js.map +1 -0
- package/dist/metadata/optional_native_modules.d.ts +79 -3
- package/dist/metadata/optional_native_modules.d.ts.map +1 -1
- package/dist/metadata/optional_native_modules.js +108 -3
- package/dist/metadata/optional_native_modules.js.map +1 -1
- package/dist/metadata/use_smile_id_metadata.d.ts +45 -7
- package/dist/metadata/use_smile_id_metadata.d.ts.map +1 -1
- package/dist/metadata/use_smile_id_metadata.js +85 -13
- package/dist/metadata/use_smile_id_metadata.js.map +1 -1
- package/dist/metadata/use_smile_id_metadata_factory.d.ts +37 -0
- package/dist/metadata/use_smile_id_metadata_factory.d.ts.map +1 -1
- package/dist/metadata/use_smile_id_metadata_factory.js +197 -16
- package/dist/metadata/use_smile_id_metadata_factory.js.map +1 -1
- package/dist/presentation/assets/svg/document_shimmer_strings.d.ts +14 -0
- package/dist/presentation/assets/svg/document_shimmer_strings.d.ts.map +1 -0
- package/dist/presentation/assets/svg/document_shimmer_strings.js +14 -0
- package/dist/presentation/assets/svg/document_shimmer_strings.js.map +1 -0
- package/dist/presentation/assets/svg/instruction_svg_strings.d.ts +12 -4
- package/dist/presentation/assets/svg/instruction_svg_strings.d.ts.map +1 -1
- package/dist/presentation/assets/svg/instruction_svg_strings.js +19 -8
- package/dist/presentation/assets/svg/instruction_svg_strings.js.map +1 -1
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.d.ts +0 -5
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.d.ts.map +1 -1
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.js +0 -5
- package/dist/presentation/components/helpers/enhanced_smart_selfie_animation_frames.js.map +1 -1
- package/dist/presentation/components/icons/index.d.ts +24 -8
- package/dist/presentation/components/icons/index.d.ts.map +1 -1
- package/dist/presentation/components/icons/index.js +31 -11
- package/dist/presentation/components/icons/index.js.map +1 -1
- package/dist/presentation/components/use_smile_id_attribution.d.ts +1 -1
- package/dist/presentation/components/use_smile_id_button.d.ts +2 -2
- package/dist/presentation/components/use_smile_id_button.js +4 -4
- package/dist/presentation/components/use_smile_id_button.js.map +1 -1
- package/dist/presentation/components/use_smile_id_capture_content.d.ts +13 -0
- package/dist/presentation/components/use_smile_id_capture_content.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_capture_content.js +15 -9
- package/dist/presentation/components/use_smile_id_capture_content.js.map +1 -1
- package/dist/presentation/components/use_smile_id_captured_document_image.d.ts +2 -3
- package/dist/presentation/components/use_smile_id_captured_document_image.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_captured_document_image.js +1 -3
- package/dist/presentation/components/use_smile_id_captured_document_image.js.map +1 -1
- package/dist/presentation/components/use_smile_id_document_capture_controls.d.ts +12 -6
- package/dist/presentation/components/use_smile_id_document_capture_controls.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_document_capture_controls.js +59 -16
- package/dist/presentation/components/use_smile_id_document_capture_controls.js.map +1 -1
- package/dist/presentation/components/use_smile_id_document_overlay.d.ts +22 -5
- package/dist/presentation/components/use_smile_id_document_overlay.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_document_overlay.js +80 -40
- package/dist/presentation/components/use_smile_id_document_overlay.js.map +1 -1
- package/dist/presentation/components/use_smile_id_document_shimmer.d.ts +15 -0
- package/dist/presentation/components/use_smile_id_document_shimmer.d.ts.map +1 -0
- package/dist/presentation/components/use_smile_id_document_shimmer.js +23 -0
- package/dist/presentation/components/use_smile_id_document_shimmer.js.map +1 -0
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts +5 -2
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js +9 -6
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js.map +1 -1
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.js +84 -1
- package/dist/presentation/components/use_smile_id_guideline_thumbnail.js.map +1 -1
- package/dist/presentation/components/use_smile_id_instructions_hero.d.ts +3 -1
- package/dist/presentation/components/use_smile_id_instructions_hero.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_instructions_hero.js +25 -5
- package/dist/presentation/components/use_smile_id_instructions_hero.js.map +1 -1
- package/dist/presentation/components/use_smile_id_oval_border_palette.d.ts.map +1 -1
- package/dist/presentation/components/use_smile_id_oval_border_palette.js +7 -3
- package/dist/presentation/components/use_smile_id_oval_border_palette.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts +28 -0
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/config_builder.js +30 -0
- package/dist/presentation/flow/dsl/builder/config_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/ml_builder.d.ts +13 -4
- package/dist/presentation/flow/dsl/builder/ml_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/ml_builder.js +3 -2
- package/dist/presentation/flow/dsl/builder/ml_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts +110 -12
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.js +110 -12
- package/dist/presentation/flow/dsl/builder/screens_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/theme_builder.d.ts +15 -2
- package/dist/presentation/flow/dsl/builder/theme_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/theme_builder.js +15 -2
- package/dist/presentation/flow/dsl/builder/theme_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/use_smile_id_builder.d.ts +6 -4
- package/dist/presentation/flow/dsl/use_smile_id_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/use_smile_id_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.d.ts +62 -36
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js +62 -36
- package/dist/presentation/flow/dsl/use_smile_id_flow_builder.js.map +1 -1
- package/dist/presentation/flow/flow_navigation_manager.d.ts +44 -5
- package/dist/presentation/flow/flow_navigation_manager.d.ts.map +1 -1
- package/dist/presentation/flow/flow_navigation_manager.js +148 -11
- package/dist/presentation/flow/flow_navigation_manager.js.map +1 -1
- package/dist/presentation/flow/model/instruction_guideline.d.ts +9 -0
- package/dist/presentation/flow/model/instruction_guideline.d.ts.map +1 -1
- package/dist/presentation/flow/model/instructions_defaults.d.ts +11 -2
- package/dist/presentation/flow/model/instructions_defaults.d.ts.map +1 -1
- package/dist/presentation/flow/model/instructions_defaults.js +74 -26
- package/dist/presentation/flow/model/instructions_defaults.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_capture_screen.d.ts.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_capture_screen.js +48 -14
- package/dist/presentation/flow/screen/orchestrated_capture_screen.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_consent_screen.d.ts.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_consent_screen.js +3 -1
- package/dist/presentation/flow/screen/orchestrated_consent_screen.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.js +1 -1
- package/dist/presentation/flow/screen/orchestrated_instructions_screen.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_preview_screen.d.ts.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js +3 -9
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_processing_screen.js +3 -3
- package/dist/presentation/flow/screen/orchestrated_processing_screen.js.map +1 -1
- package/dist/presentation/flow/use_smile_id_flow.d.ts.map +1 -1
- package/dist/presentation/flow/use_smile_id_flow.js +10 -4
- package/dist/presentation/flow/use_smile_id_flow.js.map +1 -1
- package/dist/presentation/flow/validation/flow_validator.d.ts.map +1 -1
- package/dist/presentation/flow/validation/flow_validator.js +42 -20
- package/dist/presentation/flow/validation/flow_validator.js.map +1 -1
- package/dist/presentation/flow/validation/job_type_validator.d.ts.map +1 -1
- package/dist/presentation/flow/validation/job_type_validator.js +14 -0
- package/dist/presentation/flow/validation/job_type_validator.js.map +1 -1
- package/dist/presentation/screen/helpers/capture_screen_helpers.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/capture_screen_helpers.js +1 -0
- package/dist/presentation/screen/helpers/capture_screen_helpers.js.map +1 -1
- package/dist/presentation/screen/helpers/capture_ui_state.d.ts +6 -6
- package/dist/presentation/screen/helpers/capture_ui_state.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/capture_ui_state.js +19 -19
- package/dist/presentation/screen/helpers/capture_ui_state.js.map +1 -1
- package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts +2 -2
- package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/ess_turn_haptics.js +6 -6
- package/dist/presentation/screen/helpers/ess_turn_haptics.js.map +1 -1
- package/dist/presentation/screen/helpers/instructions_screen_helpers.d.ts +1 -0
- package/dist/presentation/screen/helpers/instructions_screen_helpers.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/instructions_screen_helpers.js +6 -2
- package/dist/presentation/screen/helpers/instructions_screen_helpers.js.map +1 -1
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts +5 -5
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js +14 -11
- package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js.map +1 -1
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts +13 -3
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts.map +1 -1
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.js +48 -6
- package/dist/presentation/screen/helpers/use_capture_orientation_lock.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts +21 -3
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.js +188 -32
- package/dist/presentation/screen/use_smile_id_capture_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_consent_screen.d.ts +7 -0
- package/dist/presentation/screen/use_smile_id_consent_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_consent_screen.js +6 -5
- package/dist/presentation/screen/use_smile_id_consent_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_document_back_instructions.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_document_back_instructions.js +5 -13
- package/dist/presentation/screen/use_smile_id_document_back_instructions.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_document_preview_screen.d.ts +2 -3
- package/dist/presentation/screen/use_smile_id_document_preview_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js +17 -12
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_instructions_screen.d.ts +2 -0
- package/dist/presentation/screen/use_smile_id_instructions_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_instructions_screen.js +2 -1
- package/dist/presentation/screen/use_smile_id_instructions_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts +7 -26
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.js +10 -20
- package/dist/presentation/screen/use_smile_id_preview_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.d.ts +2 -3
- package/dist/presentation/screen/use_smile_id_processing_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.js +4 -3
- package/dist/presentation/screen/use_smile_id_processing_screen.js.map +1 -1
- package/dist/presentation/theme/theme.d.ts +1 -1
- package/dist/presentation/theme/theme.d.ts.map +1 -1
- package/dist/presentation/theme/theme.js +20 -18
- package/dist/presentation/theme/theme.js.map +1 -1
- package/dist/presentation/utils/force_max_brightness.d.ts +4 -4
- package/dist/presentation/utils/locale_utils.d.ts +10 -4
- package/dist/presentation/utils/locale_utils.d.ts.map +1 -1
- package/dist/presentation/utils/locale_utils.js +13 -5
- package/dist/presentation/utils/locale_utils.js.map +1 -1
- package/dist/testing/fake_face_analyzer.d.ts +43 -0
- package/dist/testing/fake_face_analyzer.d.ts.map +1 -0
- package/dist/testing/fake_face_analyzer.js +52 -0
- package/dist/testing/fake_face_analyzer.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +7 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/scenario_expectations.d.ts +28 -0
- package/dist/testing/scenario_expectations.d.ts.map +1 -0
- package/dist/testing/scenario_expectations.js +65 -0
- package/dist/testing/scenario_expectations.js.map +1 -0
- package/dist/testing/scenario_loader.d.ts +11 -0
- package/dist/testing/scenario_loader.d.ts.map +1 -0
- package/dist/testing/scenario_loader.js +64 -0
- package/dist/testing/scenario_loader.js.map +1 -0
- package/dist/testing/scripted_scan_results.d.ts +17 -0
- package/dist/testing/scripted_scan_results.d.ts.map +1 -0
- package/dist/testing/scripted_scan_results.js +52 -0
- package/dist/testing/scripted_scan_results.js.map +1 -0
- package/package.json +34 -7
- package/src/__tests__/dsl.test.ts +51 -1
- package/src/__tests__/react_native_mock.tsx +8 -0
- package/src/__tests__/setup_react_native.ts +17 -2
- package/src/__tests__/snapshots/__snapshots__/screens_structural.test.tsx.snap +5261 -0
- package/src/__tests__/snapshots/screens_structural.test.tsx +230 -0
- package/src/camera/__tests__/use_smile_id_camera_system.test.ts +103 -0
- package/src/camera/camera_defaults.ts +11 -9
- package/src/camera/orientation_degrees.ts +5 -6
- package/src/core/exception/__tests__/builder_validation_exceptions.test.ts +67 -0
- package/src/core/exception/agent_mode_with_enhanced_liveness_exception.ts +20 -0
- package/src/core/exception/capture_validation_exceptions.ts +1 -0
- package/src/core/exception/index.ts +1 -0
- package/src/core/exception/use_smile_id_error_code.ts +1 -0
- package/src/core/models/__tests__/document_type.test.ts +7 -5
- package/src/core/models/__tests__/flow_models.test.ts +26 -0
- package/src/core/models/config.ts +22 -0
- package/src/core/models/document_capture_mode.ts +27 -0
- package/src/core/models/document_type.ts +7 -5
- package/src/core/models/global_privacy_control.ts +45 -0
- package/src/core/models/network_config.ts +2 -2
- package/src/core/models/result.ts +9 -8
- package/src/data/api/__tests__/smile_id_api.test.ts +1 -1
- package/src/data/api/interceptors/__tests__/gzip_interceptor.test.ts +83 -0
- package/src/data/api/interceptors/__tests__/smile_integrity_interceptor.test.ts +37 -1
- package/src/data/api/interceptors/__tests__/smile_request_mac_interceptor.test.ts +59 -1
- package/src/data/api/interceptors/smile_auth_interceptor.ts +3 -18
- package/src/data/api/interceptors/smile_integrity_interceptor.ts +20 -0
- package/src/data/api/interceptors/smile_request_mac_interceptor.ts +13 -0
- package/src/data/compression/__tests__/payload_compressor.test.ts +200 -0
- package/src/data/compression/__tests__/payload_compressor_real_jpeg.test.ts +226 -0
- package/src/data/compression/compressible_asset.ts +62 -0
- package/src/data/compression/payload_compression_config.ts +53 -0
- package/src/data/compression/payload_compression_runner.ts +102 -0
- package/src/data/compression/payload_compressor.ts +164 -0
- package/src/data/compression/uri_compressible_asset.ts +85 -0
- package/src/data/dsl/builder/__tests__/config_builders.test.ts +62 -0
- package/src/data/dsl/builder/cache_config_builder.ts +3 -1
- package/src/data/dsl/builder/config_builder.ts +45 -14
- package/src/data/dsl/builder/interceptor_config_builder.ts +9 -7
- package/src/data/dsl/builder/retry_config_builder.ts +27 -6
- package/src/data/dsl/builder/timeout_config_builder.ts +7 -0
- package/src/data/dsl/use_smile_id_network_builder.ts +17 -0
- package/src/data/factory/__tests__/retry_gzip_mac_composition.test.ts +163 -0
- package/src/data/factory/__tests__/signed_job_submission_headers.test.ts +1 -1
- package/src/data/factory/networking_factory.ts +14 -1
- package/src/data/repository/__tests__/network_retries.test.ts +117 -0
- package/src/data/repository/__tests__/use_smile_id_repository.test.ts +1 -1
- package/src/data/repository/use_smile_id_repository_impl.ts +96 -9
- package/src/data/security/__tests__/request_canonicalizer.test.ts +132 -0
- package/src/data/security/__tests__/security_policy.test.ts +96 -0
- package/src/data/security/__tests__/smile_id_crypto_manager.test.ts +18 -0
- package/src/data/security/request_canonicalizer.ts +15 -2
- package/src/data/security/security_policy.ts +70 -0
- package/src/data/smile_id_urls.ts +1 -1
- package/src/data/util/__tests__/retry_util.test.ts +25 -0
- package/src/data/util/__tests__/use_smile_id_token_decoder.test.ts +57 -1
- package/src/data/util/retry_util.ts +12 -3
- package/src/data/util/use_smile_id_token_decoder.ts +76 -28
- package/src/index.ts +6 -4
- package/src/l10n/strings_en.ts +2 -1
- package/src/l10n/use_smile_id_localizations.ts +3 -0
- package/src/metadata/__tests__/device_orientation_collector.test.ts +15 -0
- package/src/metadata/__tests__/metadata_configuration_mappers.test.ts +254 -0
- package/src/metadata/__tests__/metadata_configuration_objects.test.ts +86 -0
- package/src/metadata/__tests__/metadata_device_context.test.ts +147 -0
- package/src/metadata/__tests__/metadata_device_os_android.test.ts +18 -0
- package/src/metadata/__tests__/metadata_golden_fixture.json +13 -0
- package/src/metadata/__tests__/metadata_payload_golden.test.ts +193 -0
- package/src/metadata/__tests__/use_smile_id_metadata.test.ts +19 -25
- package/src/metadata/builder_configuration.ts +69 -0
- package/src/metadata/captured_image_properties.ts +10 -0
- package/src/metadata/device_orientation_collector.ts +75 -0
- package/src/metadata/geolocation.ts +46 -0
- package/src/metadata/metadata_configuration_mappers.ts +248 -0
- package/src/metadata/model_configuration.ts +68 -0
- package/src/metadata/optional_native_modules.ts +157 -3
- package/src/metadata/use_smile_id_metadata.ts +140 -17
- package/src/metadata/use_smile_id_metadata_factory.ts +211 -16
- package/src/presentation/assets/si_document_green_book_hero_animation.json +1 -4668
- package/src/presentation/assets/si_document_hero_animation.json +1 -4799
- package/src/presentation/assets/si_document_hero_back_animation.json +1 -2039
- package/src/presentation/assets/si_document_passport_hero_animation.json +1 -14491
- package/src/presentation/assets/si_ess_all_directions_hero_animation.json +1 -0
- package/src/presentation/assets/si_ess_animation_all_directions.json +1 -5575
- package/src/presentation/assets/si_selfie_hero_animation.json +1 -1439
- package/src/presentation/assets/si_smile_to_capture_animation.json +1 -1439
- package/src/presentation/assets/svg/document_shimmer_strings.ts +17 -0
- package/src/presentation/assets/svg/instruction_svg_strings.ts +34 -12
- package/src/presentation/components/__tests__/enhanced_smart_selfie_animation_frames.test.ts +1 -3
- package/src/presentation/components/__tests__/use_smile_id_enhanced_smart_selfie_clip.test.tsx +12 -8
- package/src/presentation/components/__tests__/use_smile_id_guideline_thumbnail.test.tsx +34 -1
- package/src/presentation/components/__tests__/use_smile_id_instructions_hero.test.tsx +71 -0
- package/src/presentation/components/__tests__/use_smile_id_oval_border_palette.test.ts +7 -5
- package/src/presentation/components/helpers/enhanced_smart_selfie_animation_frames.ts +0 -6
- package/src/presentation/components/icons/index.tsx +65 -18
- package/src/presentation/components/use_smile_id_attribution.tsx +1 -1
- package/src/presentation/components/use_smile_id_button.tsx +4 -4
- package/src/presentation/components/use_smile_id_capture_content.tsx +36 -12
- package/src/presentation/components/use_smile_id_captured_document_image.tsx +3 -8
- package/src/presentation/components/use_smile_id_document_capture_controls.tsx +103 -39
- package/src/presentation/components/use_smile_id_document_overlay.tsx +134 -44
- package/src/presentation/components/use_smile_id_document_shimmer.tsx +51 -0
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_clip.tsx +9 -6
- package/src/presentation/components/use_smile_id_guideline_thumbnail.tsx +131 -2
- package/src/presentation/components/use_smile_id_instructions_hero.tsx +111 -60
- package/src/presentation/components/use_smile_id_oval_border_palette.ts +7 -3
- package/src/presentation/flow/__tests__/document_flow_navigation.test.ts +203 -4
- package/src/presentation/flow/__tests__/flow_navigation_manager.test.ts +49 -0
- package/src/presentation/flow/dsl/builder/__tests__/config_builder.test.ts +25 -0
- package/src/presentation/flow/dsl/builder/config_builder.ts +35 -0
- package/src/presentation/flow/dsl/builder/ml_builder.ts +13 -4
- package/src/presentation/flow/dsl/builder/screens_builder.ts +110 -12
- package/src/presentation/flow/dsl/builder/theme_builder.ts +19 -2
- package/src/presentation/flow/dsl/use_smile_id_builder.tsx +6 -4
- package/src/presentation/flow/dsl/use_smile_id_flow_builder.ts +62 -36
- package/src/presentation/flow/flow_navigation_manager.ts +185 -14
- package/src/presentation/flow/model/instruction_guideline.ts +6 -0
- package/src/presentation/flow/model/instructions_defaults.ts +104 -26
- package/src/presentation/flow/screen/orchestrated_capture_screen.tsx +60 -12
- package/src/presentation/flow/screen/orchestrated_consent_screen.tsx +5 -0
- package/src/presentation/flow/screen/orchestrated_instructions_screen.tsx +1 -0
- package/src/presentation/flow/screen/orchestrated_preview_screen.tsx +4 -14
- package/src/presentation/flow/screen/orchestrated_processing_screen.tsx +3 -3
- package/src/presentation/flow/use_smile_id_flow.tsx +11 -4
- package/src/presentation/flow/validation/__tests__/flow_validator.test.ts +61 -1
- package/src/presentation/flow/validation/__tests__/job_type_validator.test.ts +64 -0
- package/src/presentation/flow/validation/flow_validator.ts +55 -26
- package/src/presentation/flow/validation/job_type_validator.ts +24 -0
- package/src/presentation/screen/__tests__/capture_ui_state.test.ts +66 -47
- package/src/presentation/screen/__tests__/ess_turn_haptics.test.ts +15 -11
- package/src/presentation/screen/__tests__/instructions_screen_helpers.test.ts +15 -3
- package/src/presentation/screen/__tests__/scan_state_to_overlay_state.test.ts +47 -27
- package/src/presentation/screen/__tests__/use_smile_id_capture_screen.test.tsx +182 -18
- package/src/presentation/screen/__tests__/use_smile_id_document_back_instructions.test.tsx +1 -1
- package/src/presentation/screen/__tests__/use_smile_id_preview_screen.test.tsx +10 -40
- package/src/presentation/screen/helpers/__tests__/use_capture_orientation_lock.test.tsx +212 -0
- package/src/presentation/screen/helpers/capture_screen_helpers.ts +1 -0
- package/src/presentation/screen/helpers/capture_ui_state.ts +27 -27
- package/src/presentation/screen/helpers/ess_turn_haptics.ts +9 -9
- package/src/presentation/screen/helpers/instructions_screen_helpers.ts +7 -2
- package/src/presentation/screen/helpers/scan_state_to_overlay_state.ts +16 -13
- package/src/presentation/screen/helpers/use_capture_orientation_lock.ts +69 -7
- package/src/presentation/screen/use_smile_id_capture_screen.tsx +280 -54
- package/src/presentation/screen/use_smile_id_consent_screen.tsx +16 -5
- package/src/presentation/screen/use_smile_id_document_back_instructions.tsx +14 -23
- package/src/presentation/screen/use_smile_id_document_preview_screen.tsx +33 -23
- package/src/presentation/screen/use_smile_id_instructions_screen.tsx +4 -0
- package/src/presentation/screen/use_smile_id_preview_screen.tsx +21 -53
- package/src/presentation/screen/use_smile_id_processing_screen.tsx +8 -8
- package/src/presentation/theme/theme.ts +21 -19
- package/src/presentation/utils/__tests__/locale_utils.test.ts +46 -5
- package/src/presentation/utils/force_max_brightness.tsx +4 -4
- package/src/presentation/utils/locale_utils.ts +13 -4
- package/src/testing/__tests__/fake_face_analyzer.test.ts +42 -0
- package/src/testing/__tests__/scenario_expectations.test.ts +110 -0
- package/src/testing/__tests__/scenario_loader.test.ts +64 -0
- package/src/testing/fake_face_analyzer.ts +82 -0
- package/src/testing/index.ts +15 -0
- package/src/testing/scenario_expectations.ts +87 -0
- package/src/testing/scenario_loader.ts +83 -0
- package/src/testing/scripted_scan_results.ts +66 -0
- package/dist/camera/frame_processor_plugin.d.ts +0 -28
- package/dist/camera/frame_processor_plugin.d.ts.map +0 -1
- package/dist/camera/frame_processor_plugin.js +0 -21
- package/dist/camera/frame_processor_plugin.js.map +0 -1
- package/dist/camera/use_smile_id_frame_processor.d.ts +0 -38
- package/dist/camera/use_smile_id_frame_processor.d.ts.map +0 -1
- package/dist/camera/use_smile_id_frame_processor.js +0 -2
- package/dist/camera/use_smile_id_frame_processor.js.map +0 -1
- package/dist/presentation/components/use_smile_id_document_frame_glyph.d.ts +0 -17
- package/dist/presentation/components/use_smile_id_document_frame_glyph.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_document_frame_glyph.js +0 -17
- package/dist/presentation/components/use_smile_id_document_frame_glyph.js.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.d.ts +0 -24
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.js +0 -91
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_animation.js.map +0 -1
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.d.ts +0 -15
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.js +0 -19
- package/dist/presentation/components/use_smile_id_face_silhouette_overlay.js.map +0 -1
- package/dist/presentation/components/use_smile_id_instruction_card.d.ts +0 -31
- package/dist/presentation/components/use_smile_id_instruction_card.d.ts.map +0 -1
- package/dist/presentation/components/use_smile_id_instruction_card.js +0 -43
- package/dist/presentation/components/use_smile_id_instruction_card.js.map +0 -1
- package/dist/presentation/screen/helpers/use_document_orientation_lock.d.ts +0 -24
- package/dist/presentation/screen/helpers/use_document_orientation_lock.d.ts.map +0 -1
- package/dist/presentation/screen/helpers/use_document_orientation_lock.js +0 -47
- package/dist/presentation/screen/helpers/use_document_orientation_lock.js.map +0 -1
- package/src/presentation/components/use_smile_id_document_frame_glyph.tsx +0 -162
- package/src/presentation/components/use_smile_id_face_silhouette_overlay.tsx +0 -27
|
@@ -1,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smile_auth_interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_auth_interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAGvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"smile_auth_interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_auth_interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAGvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAyBxD,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC,CAAC;AAEF,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;gBAE/B,OAAO,EAAE,2BAA2B;IAKhD;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;YAOpC,UAAU;CAgBzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sourceSdkIdentifier } from "@smileid/usesmileid_bridge";
|
|
2
2
|
import { currentRequestTimestamp } from "../../security/request_timestamp";
|
|
3
3
|
/**
|
|
4
4
|
* Auth interceptor.
|
|
@@ -20,21 +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.
|
|
24
|
-
/**
|
|
25
|
-
* Source-SDK identifier, suffixed with the runtime platform so the server can
|
|
26
|
-
* attribute the request and resolve the matching per-SDK signing secret.
|
|
27
|
-
*/
|
|
28
|
-
function sourceSdk() {
|
|
29
|
-
switch (Platform.OS) {
|
|
30
|
-
case "android":
|
|
31
|
-
return "react-native-expo (android)";
|
|
32
|
-
case "ios":
|
|
33
|
-
return "react-native-expo (iOS)";
|
|
34
|
-
default:
|
|
35
|
-
return "react-native-expo";
|
|
36
|
-
}
|
|
37
|
-
}
|
|
23
|
+
const SDK_VERSION = "12.0.1";
|
|
38
24
|
export class SmileAuthInterceptor {
|
|
39
25
|
_partnerConfig;
|
|
40
26
|
_tokenHolder;
|
|
@@ -55,7 +41,7 @@ export class SmileAuthInterceptor {
|
|
|
55
41
|
}
|
|
56
42
|
async _onRequest(config) {
|
|
57
43
|
config.headers.set("smileid-token", this._tokenHolder.current);
|
|
58
|
-
config.headers.set("smileid-source-sdk",
|
|
44
|
+
config.headers.set("smileid-source-sdk", sourceSdkIdentifier());
|
|
59
45
|
config.headers.set("smileid-source-sdk-version", SDK_VERSION);
|
|
60
46
|
config.headers.set("smileid-partner-id", this._partnerConfig.partnerId);
|
|
61
47
|
if (this._partnerConfig.callbackUrl) {
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"smile_auth_interceptor.js","sourceRoot":"","sources":["../../../../src/data/api/interceptors/smile_auth_interceptor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAG3E;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,GAAG,QAAQ,CAAC;AAO7B,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,mBAAmB,EAAE,CAAC,CAAC;QAChE,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"}
|
|
@@ -19,7 +19,7 @@ import type { JobSubmissionResponse } from "../model/job_submission_response";
|
|
|
19
19
|
* infrastructure for future divergence.
|
|
20
20
|
*/
|
|
21
21
|
declare const PROD_BASE_URL: "https://api.smileidentity.com/";
|
|
22
|
-
declare const SANDBOX_BASE_URL: "https://
|
|
22
|
+
declare const SANDBOX_BASE_URL: "https://testapi.smileidentity.com/";
|
|
23
23
|
export declare class SmileIDAPI {
|
|
24
24
|
private readonly _client;
|
|
25
25
|
private readonly _partnerConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smile_id_api.d.ts","sourceRoot":"","sources":["../../../src/data/api/smile_id_api.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,kCAAkC,CAAC;AAG1C,OAAO,KAAK,EACV,mBAAmB,EACnB,2BAA2B,EAC3B,mCAAmC,EACnC,kBAAkB,EAClB,gCAAgC,EAChC,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAG9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAK9E;;;;;;;;;;;;;GAaG;AAQH,QAAA,MAAM,aAAa,kCAAyB,CAAC;AAC7C,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"smile_id_api.d.ts","sourceRoot":"","sources":["../../../src/data/api/smile_id_api.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,kCAAkC,CAAC;AAG1C,OAAO,KAAK,EACV,mBAAmB,EACnB,2BAA2B,EAC3B,mCAAmC,EACnC,kBAAkB,EAClB,gCAAgC,EAChC,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAG9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAK9E;;;;;;;;;;;;;GAaG;AAQH,QAAA,MAAM,aAAa,kCAAyB,CAAC;AAC7C,QAAA,MAAM,gBAAgB,sCAAsB,CAAC;AAY7C,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;gBAEnC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa;IAK/D;;;;;;;;;;;;;;;;;OAiBG;IACG,qBAAqB,CACzB,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,qBAAqB,CAAC;IAYjC;;;;;OAKG;IACG,yBAAyB,CAC7B,OAAO,EAAE,gCAAgC,GACxC,OAAO,CAAC,qBAAqB,CAAC;IAa3B,WAAW,CACf,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;IAuB3B,YAAY,CAChB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,qBAAqB,CAAC;IAqB3B,oBAAoB,CACxB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,qBAAqB,CAAC;IAI3B,4BAA4B,CAChC,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAAC,qBAAqB,CAAC;YAOnB,yBAAyB;IAyBvC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,oBAAoB;IAiB5B;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAYrC;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAavB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,yBAAyB;IAWjC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,yBAAyB;YAkBnB,cAAc;CAY7B;AAoHD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAgBrE;AAED,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,aAAa,EACb,gBAAgB,GACjB,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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const PayloadCompressionConfig: {
|
|
2
|
+
/** 1 MiB. Binary MB is the locked cross-SDK unit. */
|
|
3
|
+
readonly bytesPerMB: number;
|
|
4
|
+
/** Primary compression goal for the raw bundle. */
|
|
5
|
+
readonly rawTarget: number;
|
|
6
|
+
/** Relaxed raw ceiling, accepted only if the projected encoded size still fits the cap. */
|
|
7
|
+
readonly rawFallback: number;
|
|
8
|
+
/** The real guardrail: projected base64-encoded body must stay under this (margin under 6 MB). */
|
|
9
|
+
readonly hardEncodedCap: number;
|
|
10
|
+
/** Rule A trigger: combined document images larger than this start the document sub-pass. */
|
|
11
|
+
readonly docCombinedTrigger: number;
|
|
12
|
+
/** Rule A sub-target: pull the combined documents under this (back first, then front). */
|
|
13
|
+
readonly docCombinedTarget: number;
|
|
14
|
+
/** Rule B trigger: a selfie larger than this marks a face-heavy job (faces compressed first). */
|
|
15
|
+
readonly selfieTrigger: number;
|
|
16
|
+
/** Minimum JPEG quality for face images (selfie + liveness) — higher penalty. Pending DS sign-off. */
|
|
17
|
+
readonly faceMinQ: 0.45;
|
|
18
|
+
/** Minimum JPEG quality for document images — preserves OCR / MRZ. Pending DS sign-off. */
|
|
19
|
+
readonly docMinQ: 0.7;
|
|
20
|
+
/**
|
|
21
|
+
* Absolute JPEG-quality floor for the hard-guarantee pass. When a bundle is still over
|
|
22
|
+
* `rawFallback` after every image has hit its per-type floor (`faceMinQ` / `docMinQ`), the
|
|
23
|
+
* guarantee pass keeps stepping quality down to this value — below the per-type floors — so an
|
|
24
|
+
* oversized capture never fails submission on size. Matches v11's quality-10 floor.
|
|
25
|
+
*/
|
|
26
|
+
readonly absoluteMinQ: 0.1;
|
|
27
|
+
/** Quality decrement per re-encode step. */
|
|
28
|
+
readonly qualityStep: 0.05;
|
|
29
|
+
/** Nominal re-encode start point; each asset steps down from its own capture quality. */
|
|
30
|
+
readonly startQ: 0.9;
|
|
31
|
+
/** Fixed allowance for multipart field names + part framing not counted in image/metadata totals. */
|
|
32
|
+
readonly structuralOverheadBytes: 2048;
|
|
33
|
+
};
|
|
34
|
+
/** base64 length of `n` raw bytes: `ceil(n / 3) * 4`. */
|
|
35
|
+
export declare function base64Len(n: number): number;
|
|
36
|
+
//# sourceMappingURL=payload_compression_config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload_compression_config.d.ts","sourceRoot":"","sources":["../../../src/data/compression/payload_compression_config.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,wBAAwB;IACnC,qDAAqD;;IAErD,mDAAmD;;IAEnD,2FAA2F;;IAE3F,kGAAkG;;IAElG,6FAA6F;;IAE7F,0FAA0F;;IAE1F,iGAAiG;;IAEjG,sGAAsG;;IAEtG,2FAA2F;;IAE3F;;;;;OAKG;;IAEH,4CAA4C;;IAE5C,yFAAyF;;IAEzF,qGAAqG;;CAE7F,CAAC;AAEX,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared byte-size guardrails and adaptive JPEG-compression constants for keeping a v3
|
|
3
|
+
* form-data submission under AWS Lambda's 6 MB synchronous payload limit.
|
|
4
|
+
*
|
|
5
|
+
* **Cross-SDK source of truth** — the same thresholds, order, floors, and {@link base64Len}
|
|
6
|
+
* formula are mirrored byte-for-byte in the Android, iOS, and Flutter SDKs. Do not diverge any
|
|
7
|
+
* value without updating all four platforms.
|
|
8
|
+
*
|
|
9
|
+
* Lambda sees the **base64-encoded** body forwarded by API Gateway (base64 expands binary by
|
|
10
|
+
* ~33%), so the real guardrail is `PayloadCompressor.projectedEncodedSize` against
|
|
11
|
+
* `hardEncodedCap` — not raw bytes. Units are **binary MB (MiB, 1 << 20)**, locked across all
|
|
12
|
+
* four SDKs.
|
|
13
|
+
*/
|
|
14
|
+
const BYTES_PER_MB = 1 << 20;
|
|
15
|
+
export const PayloadCompressionConfig = {
|
|
16
|
+
/** 1 MiB. Binary MB is the locked cross-SDK unit. */
|
|
17
|
+
bytesPerMB: BYTES_PER_MB,
|
|
18
|
+
/** Primary compression goal for the raw bundle. */
|
|
19
|
+
rawTarget: 4 * BYTES_PER_MB,
|
|
20
|
+
/** Relaxed raw ceiling, accepted only if the projected encoded size still fits the cap. */
|
|
21
|
+
rawFallback: 4 * BYTES_PER_MB + BYTES_PER_MB / 2, // 4.5 MiB
|
|
22
|
+
/** The real guardrail: projected base64-encoded body must stay under this (margin under 6 MB). */
|
|
23
|
+
hardEncodedCap: Math.floor((57 * BYTES_PER_MB) / 10), // 5.7 MiB
|
|
24
|
+
/** Rule A trigger: combined document images larger than this start the document sub-pass. */
|
|
25
|
+
docCombinedTrigger: 4 * BYTES_PER_MB,
|
|
26
|
+
/** Rule A sub-target: pull the combined documents under this (back first, then front). */
|
|
27
|
+
docCombinedTarget: 3 * BYTES_PER_MB,
|
|
28
|
+
/** Rule B trigger: a selfie larger than this marks a face-heavy job (faces compressed first). */
|
|
29
|
+
selfieTrigger: 1 * BYTES_PER_MB,
|
|
30
|
+
/** Minimum JPEG quality for face images (selfie + liveness) — higher penalty. Pending DS sign-off. */
|
|
31
|
+
faceMinQ: 0.45,
|
|
32
|
+
/** Minimum JPEG quality for document images — preserves OCR / MRZ. Pending DS sign-off. */
|
|
33
|
+
docMinQ: 0.7,
|
|
34
|
+
/**
|
|
35
|
+
* Absolute JPEG-quality floor for the hard-guarantee pass. When a bundle is still over
|
|
36
|
+
* `rawFallback` after every image has hit its per-type floor (`faceMinQ` / `docMinQ`), the
|
|
37
|
+
* guarantee pass keeps stepping quality down to this value — below the per-type floors — so an
|
|
38
|
+
* oversized capture never fails submission on size. Matches v11's quality-10 floor.
|
|
39
|
+
*/
|
|
40
|
+
absoluteMinQ: 0.1,
|
|
41
|
+
/** Quality decrement per re-encode step. */
|
|
42
|
+
qualityStep: 0.05,
|
|
43
|
+
/** Nominal re-encode start point; each asset steps down from its own capture quality. */
|
|
44
|
+
startQ: 0.9,
|
|
45
|
+
/** Fixed allowance for multipart field names + part framing not counted in image/metadata totals. */
|
|
46
|
+
structuralOverheadBytes: 2048,
|
|
47
|
+
};
|
|
48
|
+
/** base64 length of `n` raw bytes: `ceil(n / 3) * 4`. */
|
|
49
|
+
export function base64Len(n) {
|
|
50
|
+
return Math.ceil(n / 3) * 4;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=payload_compression_config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload_compression_config.js","sourceRoot":"","sources":["../../../src/data/compression/payload_compression_config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,CAAC;AAE7B,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,qDAAqD;IACrD,UAAU,EAAE,YAAY;IACxB,mDAAmD;IACnD,SAAS,EAAE,CAAC,GAAG,YAAY;IAC3B,2FAA2F;IAC3F,WAAW,EAAE,CAAC,GAAG,YAAY,GAAG,YAAY,GAAG,CAAC,EAAE,UAAU;IAC5D,kGAAkG;IAClG,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,YAAY,CAAC,GAAG,EAAE,CAAC,EAAE,UAAU;IAChE,6FAA6F;IAC7F,kBAAkB,EAAE,CAAC,GAAG,YAAY;IACpC,0FAA0F;IAC1F,iBAAiB,EAAE,CAAC,GAAG,YAAY;IACnC,iGAAiG;IACjG,aAAa,EAAE,CAAC,GAAG,YAAY;IAC/B,sGAAsG;IACtG,QAAQ,EAAE,IAAI;IACd,2FAA2F;IAC3F,OAAO,EAAE,GAAG;IACZ;;;;;OAKG;IACH,YAAY,EAAE,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,IAAI;IACjB,yFAAyF;IACzF,MAAM,EAAE,GAAG;IACX,qGAAqG;IACrG,uBAAuB,EAAE,IAAI;CACrB,CAAC;AAEX,yDAAyD;AACzD,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-role JPEG sizes in MB, measured before compression (`*Original`) and after (`*Final`); equal
|
|
3
|
+
* when the image was not compressed, `undefined` for an absent role. Stamped into the submission
|
|
4
|
+
* metadata so the backend sees each file's original size and its compressed size.
|
|
5
|
+
*/
|
|
6
|
+
export interface PayloadCompressionSizes {
|
|
7
|
+
readonly selfieOriginalMb?: number | undefined;
|
|
8
|
+
readonly selfieFinalMb?: number | undefined;
|
|
9
|
+
readonly frontOriginalMb?: number | undefined;
|
|
10
|
+
readonly frontFinalMb?: number | undefined;
|
|
11
|
+
readonly backOriginalMb?: number | undefined;
|
|
12
|
+
readonly backFinalMb?: number | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Builds `CompressibleAssets` from a submission's captured JPEG URIs and runs `PayloadCompressor`
|
|
16
|
+
* to bring the bundle under the transmission cap, re-stamping the Smile EXIF `image_digest` (and
|
|
17
|
+
* re-encoding natively) per step. Best-effort: it compresses each image down to its quality floor
|
|
18
|
+
* and resolves — it never throws on size, so submission is never blocked.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PayloadCompressionRunner: {
|
|
21
|
+
compress(args: {
|
|
22
|
+
selfieImage?: string | undefined;
|
|
23
|
+
livenessImages?: readonly string[] | undefined;
|
|
24
|
+
frontDocument?: string | undefined;
|
|
25
|
+
backDocument?: string | undefined;
|
|
26
|
+
metadataBytes: number;
|
|
27
|
+
}): Promise<PayloadCompressionSizes>;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=payload_compression_runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload_compression_runner.d.ts","sourceRoot":"","sources":["../../../src/data/compression/payload_compression_runner.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C;AAQD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;mBACd;QACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACjC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;QAC/C,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACnC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAClC,aAAa,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAoDrC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { File } from "expo-file-system";
|
|
2
|
+
import { ImageType } from "@smileid/usesmileid_bridge";
|
|
3
|
+
import { CameraDefaults } from "../../camera/camera_defaults";
|
|
4
|
+
import { CompressibleAssets } from "./compressible_asset";
|
|
5
|
+
import { PayloadCompressor } from "./payload_compressor";
|
|
6
|
+
import { UriCompressibleAsset } from "./uri_compressible_asset";
|
|
7
|
+
// RN `CameraDefaults` only exposes the document JPEG quality; selfie/liveness capture quality
|
|
8
|
+
// match the cross-SDK values. These seed only the recompress start, which steps DOWN from here
|
|
9
|
+
// (never re-encoding above the capture quality, which would inflate).
|
|
10
|
+
const SELFIE_CAPTURE_QUALITY = 0.95;
|
|
11
|
+
const LIVENESS_CAPTURE_QUALITY = 0.8;
|
|
12
|
+
const BYTES_PER_MB = 1024 * 1024;
|
|
13
|
+
function sizeInMb(uri) {
|
|
14
|
+
if (uri === undefined)
|
|
15
|
+
return undefined;
|
|
16
|
+
const bytes = new File(uri).size ?? 0;
|
|
17
|
+
return bytes > 0 ? bytes / BYTES_PER_MB : undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Builds `CompressibleAssets` from a submission's captured JPEG URIs and runs `PayloadCompressor`
|
|
21
|
+
* to bring the bundle under the transmission cap, re-stamping the Smile EXIF `image_digest` (and
|
|
22
|
+
* re-encoding natively) per step. Best-effort: it compresses each image down to its quality floor
|
|
23
|
+
* and resolves — it never throws on size, so submission is never blocked.
|
|
24
|
+
*/
|
|
25
|
+
export const PayloadCompressionRunner = {
|
|
26
|
+
async compress(args) {
|
|
27
|
+
// Original JPEG sizes, measured before the compressor rewrites the files in place.
|
|
28
|
+
const selfieOriginalMb = sizeInMb(args.selfieImage);
|
|
29
|
+
const frontOriginalMb = sizeInMb(args.frontDocument);
|
|
30
|
+
const backOriginalMb = sizeInMb(args.backDocument);
|
|
31
|
+
const assets = new CompressibleAssets({
|
|
32
|
+
selfie: args.selfieImage
|
|
33
|
+
? new UriCompressibleAsset(ImageType.Selfie, args.selfieImage, SELFIE_CAPTURE_QUALITY)
|
|
34
|
+
: undefined,
|
|
35
|
+
liveness: (args.livenessImages ?? []).map((uri) => new UriCompressibleAsset(ImageType.Liveness, uri, LIVENESS_CAPTURE_QUALITY)),
|
|
36
|
+
documentFront: args.frontDocument
|
|
37
|
+
? new UriCompressibleAsset(ImageType.DocumentFront, args.frontDocument, CameraDefaults.documentJpegQuality)
|
|
38
|
+
: undefined,
|
|
39
|
+
documentBack: args.backDocument
|
|
40
|
+
? new UriCompressibleAsset(ImageType.DocumentBack, args.backDocument, CameraDefaults.documentJpegQuality)
|
|
41
|
+
: undefined,
|
|
42
|
+
});
|
|
43
|
+
await PayloadCompressor.prepareBundleForTransmission(assets, args.metadataBytes);
|
|
44
|
+
// Final JPEG sizes, measured after compression (equal to the originals when not compressed).
|
|
45
|
+
return {
|
|
46
|
+
selfieOriginalMb,
|
|
47
|
+
selfieFinalMb: sizeInMb(args.selfieImage),
|
|
48
|
+
frontOriginalMb,
|
|
49
|
+
frontFinalMb: sizeInMb(args.frontDocument),
|
|
50
|
+
backOriginalMb,
|
|
51
|
+
backFinalMb: sizeInMb(args.backDocument),
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=payload_compression_runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload_compression_runner.js","sourceRoot":"","sources":["../../../src/data/compression/payload_compression_runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,8FAA8F;AAC9F,+FAA+F;AAC/F,sEAAsE;AACtE,MAAM,sBAAsB,GAAG,IAAI,CAAC;AACpC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAErC,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;AAgBjC,SAAS,QAAQ,CAAC,GAAuB;IACvC,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;IACtC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,KAAK,CAAC,QAAQ,CAAC,IAMd;QACC,mFAAmF;QACnF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACrD,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEnD,MAAM,MAAM,GAAG,IAAI,kBAAkB,CAAC;YACpC,MAAM,EAAE,IAAI,CAAC,WAAW;gBACtB,CAAC,CAAC,IAAI,oBAAoB,CACtB,SAAS,CAAC,MAAM,EAChB,IAAI,CAAC,WAAW,EAChB,sBAAsB,CACvB;gBACH,CAAC,CAAC,SAAS;YACb,QAAQ,EAAE,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,GAAG,CACvC,CAAC,GAAG,EAAE,EAAE,CACN,IAAI,oBAAoB,CACtB,SAAS,CAAC,QAAQ,EAClB,GAAG,EACH,wBAAwB,CACzB,CACJ;YACD,aAAa,EAAE,IAAI,CAAC,aAAa;gBAC/B,CAAC,CAAC,IAAI,oBAAoB,CACtB,SAAS,CAAC,aAAa,EACvB,IAAI,CAAC,aAAa,EAClB,cAAc,CAAC,mBAAmB,CACnC;gBACH,CAAC,CAAC,SAAS;YACb,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC7B,CAAC,CAAC,IAAI,oBAAoB,CACtB,SAAS,CAAC,YAAY,EACtB,IAAI,CAAC,YAAY,EACjB,cAAc,CAAC,mBAAmB,CACnC;gBACH,CAAC,CAAC,SAAS;SACd,CAAC,CAAC;QACH,MAAM,iBAAiB,CAAC,4BAA4B,CAClD,MAAM,EACN,IAAI,CAAC,aAAa,CACnB,CAAC;QAEF,6FAA6F;QAC7F,OAAO;YACL,gBAAgB;YAChB,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;YACzC,eAAe;YACf,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;YAC1C,cAAc;YACd,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;SACzC,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type CompressibleAsset, CompressibleAssets } from "./compressible_asset";
|
|
2
|
+
/**
|
|
3
|
+
* Adaptive image-compression orchestrator that keeps a v3 submission under the Lambda payload
|
|
4
|
+
* cap. Pure decision logic over `CompressibleAssets` — the native JPEG encode + EXIF re-stamp
|
|
5
|
+
* lives behind `CompressibleAsset.recompress`.
|
|
6
|
+
*
|
|
7
|
+
* **Cross-SDK source of truth.** The size formulas, plan order, sub-rules, and loop here are
|
|
8
|
+
* mirrored byte-for-byte with the Android / iOS / Flutter SDKs. See `PayloadCompressionConfig`.
|
|
9
|
+
*
|
|
10
|
+
* Scope: image compression only. Metadata is **measured** (it counts toward the bundle and the
|
|
11
|
+
* projected encoded size) but never modified.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PayloadCompressor: {
|
|
14
|
+
/** Raw bundle size: sum of current image bytes + serialized metadata JSON bytes. */
|
|
15
|
+
rawBundleSize(assets: CompressibleAssets, metadataBytes: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Projected size of the base64-encoded body API Gateway forwards to Lambda: images are
|
|
18
|
+
* base64-expanded, metadata JSON is counted raw, plus a fixed structural allowance. The real
|
|
19
|
+
* guardrail.
|
|
20
|
+
*/
|
|
21
|
+
projectedEncodedSize(assets: CompressibleAssets, metadataBytes: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Ordered (asset, minQuality) plan. Faces take the higher penalty (lower floor); documents are
|
|
24
|
+
* preserved. Rule B (selfie > 1 MB → faces first), Rule A (documents > 4 MB → back, front,
|
|
25
|
+
* faces last), else generic (faces first).
|
|
26
|
+
*/
|
|
27
|
+
buildCompressionPlan(assets: CompressibleAssets): Array<[CompressibleAsset, number]>;
|
|
28
|
+
/**
|
|
29
|
+
* Compress `assets` in place until the bundle is guaranteed to ship. Steps: early-out → Rule A
|
|
30
|
+
* document sub-target → walk the global plan to the per-type floors → hard-guarantee pass that
|
|
31
|
+
* drops past the floors (down to `absoluteMinQ`) until the bundle fits both caps. Never throws;
|
|
32
|
+
* a job never fails submission purely on payload size.
|
|
33
|
+
*/
|
|
34
|
+
prepareBundleForTransmission(assets: CompressibleAssets, metadataBytes: number): Promise<void>;
|
|
35
|
+
/** True while the bundle exceeds the relaxed raw ceiling or the projected encoded cap. */
|
|
36
|
+
_overRelaxedCap(assets: CompressibleAssets, metadataBytes: number): boolean;
|
|
37
|
+
/** Reduce each asset in `group` (order matters) toward `target` as measured by `measure`. */
|
|
38
|
+
_compressGroupToTarget(group: CompressibleAsset[], minQuality: number, target: number, measure: () => number): Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=payload_compressor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload_compressor.d.ts","sourceRoot":"","sources":["../../../src/data/compression/payload_compressor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAM9B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB;IAC5B,oFAAoF;0BAC9D,kBAAkB,iBAAiB,MAAM,GAAG,MAAM;IAOxE;;;;OAIG;iCAEO,kBAAkB,iBACX,MAAM,GACpB,MAAM;IAUT;;;;OAIG;iCAEO,kBAAkB,GACzB,KAAK,CAAC,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAwBrC;;;;;OAKG;yCAEO,kBAAkB,iBACX,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;IAoDhB,0FAA0F;4BAClE,kBAAkB,iBAAiB,MAAM,GAAG,OAAO;IAO3E,6FAA6F;kCAEpF,iBAAiB,EAAE,cACd,MAAM,UACV,MAAM,WACL,MAAM,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;CAUjB,CAAC"}
|