@smileid/usesmileid 12.0.0 → 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 +4 -0
- 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_type.d.ts +1 -1
- package/dist/core/models/document_type.d.ts.map +1 -1
- package/dist/core/models/document_type.js +2 -2
- 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/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/smile_id_api.d.ts +1 -1
- package/dist/data/api/smile_id_api.d.ts.map +1 -1
- package/dist/data/dsl/builder/retry_config_builder.d.ts +4 -4
- package/dist/data/dsl/builder/retry_config_builder.d.ts.map +1 -1
- package/dist/data/dsl/builder/retry_config_builder.js +6 -6
- package/dist/data/dsl/builder/retry_config_builder.js.map +1 -1
- 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 +1 -1
- package/dist/data/util/retry_util.d.ts.map +1 -1
- package/dist/data/util/retry_util.js +5 -0
- package/dist/data/util/retry_util.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/metadata/builder_configuration.d.ts +5 -0
- package/dist/metadata/builder_configuration.d.ts.map +1 -1
- package/dist/metadata/builder_configuration.js +1 -0
- package/dist/metadata/builder_configuration.js.map +1 -1
- package/dist/metadata/metadata_configuration_mappers.d.ts +2 -3
- package/dist/metadata/metadata_configuration_mappers.d.ts.map +1 -1
- package/dist/metadata/metadata_configuration_mappers.js +13 -6
- package/dist/metadata/metadata_configuration_mappers.js.map +1 -1
- package/dist/metadata/use_smile_id_metadata_factory.d.ts.map +1 -1
- package/dist/metadata/use_smile_id_metadata_factory.js +14 -5
- package/dist/metadata/use_smile_id_metadata_factory.js.map +1 -1
- 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 +8 -3
- package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js.map +1 -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 +8 -3
- package/dist/presentation/components/use_smile_id_instructions_hero.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts +16 -0
- package/dist/presentation/flow/dsl/builder/config_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/config_builder.js +18 -0
- package/dist/presentation/flow/dsl/builder/config_builder.js.map +1 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts +3 -6
- package/dist/presentation/flow/dsl/builder/screens_builder.d.ts.map +1 -1
- package/dist/presentation/flow/dsl/builder/screens_builder.js +3 -6
- package/dist/presentation/flow/dsl/builder/screens_builder.js.map +1 -1
- package/dist/presentation/flow/flow_navigation_manager.d.ts +5 -1
- package/dist/presentation/flow/flow_navigation_manager.d.ts.map +1 -1
- package/dist/presentation/flow/flow_navigation_manager.js +7 -1
- package/dist/presentation/flow/flow_navigation_manager.js.map +1 -1
- package/dist/presentation/flow/model/instructions_defaults.d.ts.map +1 -1
- package/dist/presentation/flow/model/instructions_defaults.js +1 -1
- 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 +13 -3
- 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_preview_screen.d.ts.map +1 -1
- package/dist/presentation/flow/screen/orchestrated_preview_screen.js +0 -8
- package/dist/presentation/flow/screen/orchestrated_preview_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/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/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 +11 -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 +4 -2
- package/dist/presentation/screen/use_smile_id_capture_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_capture_screen.js +36 -15
- 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.js +1 -1
- package/dist/presentation/screen/use_smile_id_document_preview_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts +1 -21
- package/dist/presentation/screen/use_smile_id_preview_screen.d.ts.map +1 -1
- package/dist/presentation/screen/use_smile_id_preview_screen.js +3 -14
- package/dist/presentation/screen/use_smile_id_preview_screen.js.map +1 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.js +1 -1
- package/dist/presentation/screen/use_smile_id_processing_screen.js.map +1 -1
- 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 +11 -4
- package/src/__tests__/dsl.test.ts +51 -1
- 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/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 +2 -2
- package/src/core/models/__tests__/flow_models.test.ts +26 -0
- package/src/core/models/config.ts +22 -0
- package/src/core/models/document_type.ts +2 -2
- package/src/core/models/global_privacy_control.ts +45 -0
- package/src/core/models/network_config.ts +2 -2
- 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/smile_auth_interceptor.ts +3 -18
- package/src/data/compression/__tests__/payload_compressor_real_jpeg.test.ts +6 -2
- package/src/data/dsl/builder/__tests__/config_builders.test.ts +62 -0
- package/src/data/dsl/builder/retry_config_builder.ts +6 -6
- 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/repository/__tests__/network_retries.test.ts +1 -1
- package/src/data/repository/__tests__/use_smile_id_repository.test.ts +1 -1
- package/src/data/security/__tests__/request_canonicalizer.test.ts +132 -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/retry_util.ts +9 -1
- package/src/index.ts +6 -4
- package/src/metadata/__tests__/metadata_configuration_mappers.test.ts +39 -0
- package/src/metadata/__tests__/metadata_configuration_objects.test.ts +2 -1
- package/src/metadata/__tests__/metadata_device_context.test.ts +3 -3
- package/src/metadata/__tests__/metadata_device_os_android.test.ts +18 -0
- package/src/metadata/__tests__/metadata_golden_fixture.json +1 -1
- package/src/metadata/__tests__/metadata_payload_golden.test.ts +4 -4
- package/src/metadata/__tests__/use_smile_id_metadata.test.ts +1 -1
- package/src/metadata/builder_configuration.ts +6 -0
- package/src/metadata/metadata_configuration_mappers.ts +21 -7
- package/src/metadata/use_smile_id_metadata_factory.ts +17 -6
- 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 -6589
- 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/components/__tests__/use_smile_id_enhanced_smart_selfie_clip.test.tsx +9 -4
- package/src/presentation/components/__tests__/use_smile_id_instructions_hero.test.tsx +44 -0
- package/src/presentation/components/use_smile_id_enhanced_smart_selfie_clip.tsx +9 -3
- package/src/presentation/components/use_smile_id_instructions_hero.tsx +10 -0
- package/src/presentation/flow/__tests__/document_flow_navigation.test.ts +3 -3
- 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 +21 -0
- package/src/presentation/flow/dsl/builder/screens_builder.ts +3 -6
- package/src/presentation/flow/flow_navigation_manager.ts +6 -1
- package/src/presentation/flow/model/instructions_defaults.ts +1 -1
- package/src/presentation/flow/screen/orchestrated_capture_screen.tsx +18 -3
- package/src/presentation/flow/screen/orchestrated_consent_screen.tsx +5 -0
- package/src/presentation/flow/screen/orchestrated_preview_screen.tsx +0 -12
- 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/flow_validator.ts +55 -26
- 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__/scan_state_to_overlay_state.test.ts +47 -27
- package/src/presentation/screen/__tests__/use_smile_id_capture_screen.test.tsx +176 -14
- 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_ui_state.ts +27 -27
- package/src/presentation/screen/helpers/ess_turn_haptics.ts +9 -9
- package/src/presentation/screen/helpers/scan_state_to_overlay_state.ts +13 -13
- package/src/presentation/screen/helpers/use_capture_orientation_lock.ts +69 -7
- package/src/presentation/screen/use_smile_id_capture_screen.tsx +47 -19
- 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 +1 -1
- package/src/presentation/screen/use_smile_id_preview_screen.tsx +13 -45
- package/src/presentation/screen/use_smile_id_processing_screen.tsx +1 -1
- package/src/presentation/utils/__tests__/locale_utils.test.ts +46 -5
- 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/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/src/presentation/components/use_smile_id_face_silhouette_overlay.tsx +0 -27
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
ModelProvider,
|
|
13
13
|
MODEL_DESCRIPTOR_UNKNOWN,
|
|
14
14
|
} from "../model_configuration";
|
|
15
|
+
import { GlobalPrivacyControl } from "../../core/models/global_privacy_control";
|
|
15
16
|
import {
|
|
16
17
|
flowConfigurationToBuilderConfiguration,
|
|
17
18
|
flowConfigurationToModelConfiguration,
|
|
@@ -201,6 +202,21 @@ describe("flowConfigurationToSelfieLivenessTelemetry", () => {
|
|
|
201
202
|
expect(telemetry.activeLivenessType).toBe("head_pose");
|
|
202
203
|
});
|
|
203
204
|
|
|
205
|
+
it("reports back_camera in agent mode", () => {
|
|
206
|
+
const telemetry = flowConfigurationToSelfieLivenessTelemetry(
|
|
207
|
+
flow((screens) =>
|
|
208
|
+
screens.capture((capture) => {
|
|
209
|
+
capture.captureType = CaptureType.selfie;
|
|
210
|
+
capture.selfie((selfie) => {
|
|
211
|
+
selfie.allowAgentMode = true;
|
|
212
|
+
});
|
|
213
|
+
}),
|
|
214
|
+
),
|
|
215
|
+
);
|
|
216
|
+
expect(telemetry.selfieImageOrigin).toBe("back_camera");
|
|
217
|
+
expect(telemetry.activeLivenessType).toBe("smile");
|
|
218
|
+
});
|
|
219
|
+
|
|
204
220
|
it("is all-null for a document-only flow", () => {
|
|
205
221
|
const telemetry = flowConfigurationToSelfieLivenessTelemetry(
|
|
206
222
|
flow((screens) =>
|
|
@@ -212,4 +228,27 @@ describe("flowConfigurationToSelfieLivenessTelemetry", () => {
|
|
|
212
228
|
expect(telemetry.activeLivenessType).toBeNull();
|
|
213
229
|
expect(telemetry.selfieImageOrigin).toBeNull();
|
|
214
230
|
});
|
|
231
|
+
|
|
232
|
+
it("global privacy control lands in the configuration metadata", () => {
|
|
233
|
+
// Default posture: a snapshot without a config block reports the
|
|
234
|
+
// opt-out baseline.
|
|
235
|
+
expect(
|
|
236
|
+
flowConfigurationToBuilderConfiguration(flow(() => {}))
|
|
237
|
+
.globalPrivacyControl,
|
|
238
|
+
).toBe("opt-out");
|
|
239
|
+
|
|
240
|
+
// Explicit legacy posture flows through the config snapshot.
|
|
241
|
+
const optIn: FlowConfiguration = {
|
|
242
|
+
...flow(() => {}),
|
|
243
|
+
config: {
|
|
244
|
+
enableCrashReporting: true,
|
|
245
|
+
enableDebugMode: false,
|
|
246
|
+
allowOfflineMode: false,
|
|
247
|
+
globalPrivacyControl: GlobalPrivacyControl.OptIn,
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
expect(
|
|
251
|
+
flowConfigurationToBuilderConfiguration(optIn).globalPrivacyControl,
|
|
252
|
+
).toBe("opt-in");
|
|
253
|
+
});
|
|
215
254
|
});
|
|
@@ -25,6 +25,7 @@ const builderConfiguration: BuilderConfiguration = {
|
|
|
25
25
|
allowGalleryUpload: true,
|
|
26
26
|
captureBothSides: true,
|
|
27
27
|
allowSkipBack: false,
|
|
28
|
+
globalPrivacyControl: "opt-out",
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
const modelConfiguration: ModelConfiguration = {
|
|
@@ -37,7 +38,7 @@ const modelConfiguration: ModelConfiguration = {
|
|
|
37
38
|
documentModel: {
|
|
38
39
|
provider: ModelProvider.Smile,
|
|
39
40
|
name: "noop_document_detector",
|
|
40
|
-
version: "12.0.
|
|
41
|
+
version: "12.0.1",
|
|
41
42
|
bundled: true,
|
|
42
43
|
},
|
|
43
44
|
};
|
|
@@ -9,7 +9,7 @@ function fields(
|
|
|
9
9
|
overrides: Partial<UseSmileIDMetadataFields> = {},
|
|
10
10
|
): UseSmileIDMetadataFields {
|
|
11
11
|
return {
|
|
12
|
-
sdkVersion: "12.0.
|
|
12
|
+
sdkVersion: "12.0.1",
|
|
13
13
|
sdk: "react-native-expo",
|
|
14
14
|
deviceOs: "Android 14",
|
|
15
15
|
deviceModel: "",
|
|
@@ -89,10 +89,10 @@ describe("device-context keys (62-key parity)", () => {
|
|
|
89
89
|
it("emits wrapper identity when present and omits it when blank", () => {
|
|
90
90
|
const populated = fields({
|
|
91
91
|
wrapperName: "react_native_expo",
|
|
92
|
-
wrapperVersion: "12.0.
|
|
92
|
+
wrapperVersion: "12.0.1",
|
|
93
93
|
});
|
|
94
94
|
expect(value("wrapper_name", populated)).toBe("react_native_expo");
|
|
95
|
-
expect(value("wrapper_version", populated)).toBe("12.0.
|
|
95
|
+
expect(value("wrapper_version", populated)).toBe("12.0.1");
|
|
96
96
|
|
|
97
97
|
const names = new UseSmileIDMetadata(fields())
|
|
98
98
|
.toEntries()
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
vi.mock("react-native", () => ({
|
|
4
|
+
Platform: { OS: "android", Version: 31, constants: { Release: "12" } },
|
|
5
|
+
Dimensions: {
|
|
6
|
+
get: () => ({ width: 1080, height: 2400, scale: 3 }),
|
|
7
|
+
},
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
import { UseSmileIDMetadataFactory } from "../use_smile_id_metadata_factory";
|
|
11
|
+
|
|
12
|
+
describe("device_os on Android", () => {
|
|
13
|
+
it("reports the release version, not the API level", () => {
|
|
14
|
+
const factory = new UseSmileIDMetadataFactory();
|
|
15
|
+
|
|
16
|
+
expect(factory.make().toFields().deviceOs).toBe("Android 12");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Shared cross-SDK golden parity vectors. These metadata keys must serialise to the EXACT same wire value on Android, iOS, Flutter, and React Native for the standard fully-populated golden snapshot. Each SDK's metadata-payload golden test asserts its payload contains every entry below verbatim. Maintained manually — keep the four copies (android/ios/flutter/react-native-expo test dirs) in sync.",
|
|
3
3
|
"expected": {
|
|
4
|
-
"sdk_version": "12.0.
|
|
4
|
+
"sdk_version": "12.0.1",
|
|
5
5
|
"proxy": "true",
|
|
6
6
|
"proximity_sensor": "true",
|
|
7
7
|
"sdk_config_source": "sdk_config",
|
|
@@ -17,7 +17,7 @@ import goldenFixture from "./metadata_golden_fixture.json";
|
|
|
17
17
|
describe("metadata payload (golden, device-context fields)", () => {
|
|
18
18
|
function fullyPopulated(): UseSmileIDMetadataFields {
|
|
19
19
|
return {
|
|
20
|
-
sdkVersion: "12.0.
|
|
20
|
+
sdkVersion: "12.0.1",
|
|
21
21
|
sdk: "react-native-expo",
|
|
22
22
|
deviceOs: "Android 14",
|
|
23
23
|
deviceModel: "Google Pixel 8",
|
|
@@ -56,7 +56,7 @@ describe("metadata payload (golden, device-context fields)", () => {
|
|
|
56
56
|
vpn: false,
|
|
57
57
|
certificateDigest: ["AA:BB", "CC:DD"],
|
|
58
58
|
wrapperName: "react_native_expo",
|
|
59
|
-
wrapperVersion: "12.0.
|
|
59
|
+
wrapperVersion: "12.0.1",
|
|
60
60
|
sdkLaunchCount: 5,
|
|
61
61
|
geolocation: {
|
|
62
62
|
latitude: 1.5,
|
|
@@ -128,7 +128,7 @@ describe("metadata payload (golden, device-context fields)", () => {
|
|
|
128
128
|
|
|
129
129
|
it("emits scalar + meaningful-falsey + JSON-shaped values correctly", () => {
|
|
130
130
|
const map = entriesOf(fullyPopulated());
|
|
131
|
-
expect(map.get("sdk_version")).toBe("12.0.
|
|
131
|
+
expect(map.get("sdk_version")).toBe("12.0.1");
|
|
132
132
|
expect(map.get("proxy")).toBe("true");
|
|
133
133
|
expect(map.get("battery_status")).toBe("0"); // 0 is meaningful
|
|
134
134
|
expect(map.get("sdk_config_source")).toBe("sdk_config");
|
|
@@ -153,7 +153,7 @@ describe("metadata payload (golden, device-context fields)", () => {
|
|
|
153
153
|
|
|
154
154
|
it("default snapshot emits only the always-present keys", () => {
|
|
155
155
|
const minimal: UseSmileIDMetadataFields = {
|
|
156
|
-
sdkVersion: "12.0.
|
|
156
|
+
sdkVersion: "12.0.1",
|
|
157
157
|
sdk: "react-native-expo",
|
|
158
158
|
deviceOs: "Android 14",
|
|
159
159
|
deviceModel: "",
|
|
@@ -23,7 +23,7 @@ import { SdkConfigSource } from "../../data/model/sdk_config_source";
|
|
|
23
23
|
// survive `toEntries()` from this fixture are the truly-always-present ones
|
|
24
24
|
// (SDK constants, sessionId, sdk_config_source).
|
|
25
25
|
const baseFields: UseSmileIDMetadataFields = Object.freeze({
|
|
26
|
-
sdkVersion: "12.0.
|
|
26
|
+
sdkVersion: "12.0.1",
|
|
27
27
|
sdk: "react-native-expo",
|
|
28
28
|
deviceOs: "",
|
|
29
29
|
deviceModel: "",
|
|
@@ -32,6 +32,11 @@ export type BuilderConfiguration = {
|
|
|
32
32
|
readonly allowGalleryUpload: boolean;
|
|
33
33
|
readonly captureBothSides: boolean;
|
|
34
34
|
readonly allowSkipBack: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Partner-declared GPC posture ("opt-out" / "opt-in") — the consent
|
|
37
|
+
* layout every session ran under.
|
|
38
|
+
*/
|
|
39
|
+
readonly globalPrivacyControl: string;
|
|
35
40
|
};
|
|
36
41
|
|
|
37
42
|
/**
|
|
@@ -59,5 +64,6 @@ export function builderConfigurationToJson(
|
|
|
59
64
|
allow_gallery_upload: configuration.allowGalleryUpload,
|
|
60
65
|
capture_both_sides: configuration.captureBothSides,
|
|
61
66
|
allow_skip_back: configuration.allowSkipBack,
|
|
67
|
+
global_privacy_control: configuration.globalPrivacyControl,
|
|
62
68
|
};
|
|
63
69
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GlobalPrivacyControl } from "../core/models/global_privacy_control";
|
|
1
2
|
import { AnalyzerFactoryKey } from "@smileid/usesmileid_bridge";
|
|
2
3
|
|
|
3
4
|
import { CaptureType } from "../core/models/ml_config";
|
|
@@ -89,6 +90,8 @@ export function flowConfigurationToBuilderConfiguration(
|
|
|
89
90
|
allowGalleryUpload: document?.allowGalleryUpload ?? false,
|
|
90
91
|
captureBothSides: document?.captureBothSides ?? false,
|
|
91
92
|
allowSkipBack: document?.allowSkipBack ?? false,
|
|
93
|
+
globalPrivacyControl:
|
|
94
|
+
configuration.config?.globalPrivacyControl ?? GlobalPrivacyControl.OptOut,
|
|
92
95
|
};
|
|
93
96
|
}
|
|
94
97
|
|
|
@@ -165,14 +168,13 @@ type SelfieLivenessTelemetry =
|
|
|
165
168
|
|
|
166
169
|
/**
|
|
167
170
|
* Flow-derived selfie liveness telemetry. All-`null` for flows without a selfie
|
|
168
|
-
* capture; otherwise the active-liveness check
|
|
169
|
-
*
|
|
170
|
-
* `front_camera` — the selfie SDK has no gallery path).
|
|
171
|
+
* capture; otherwise the active-liveness check, the version, and the lens the
|
|
172
|
+
* selfie came from (the selfie SDK has no gallery path).
|
|
171
173
|
*/
|
|
172
174
|
export function flowConfigurationToSelfieLivenessTelemetry(
|
|
173
175
|
configuration: FlowConfiguration,
|
|
174
176
|
): SelfieLivenessTelemetry {
|
|
175
|
-
let selfie:
|
|
177
|
+
let selfie: SelfieLivenessSource;
|
|
176
178
|
let hasSelfieCapture = false;
|
|
177
179
|
for (const step of configuration.screens.steps) {
|
|
178
180
|
if (step.kind === "capture") {
|
|
@@ -190,12 +192,24 @@ export function flowConfigurationToSelfieLivenessTelemetry(
|
|
|
190
192
|
};
|
|
191
193
|
}
|
|
192
194
|
return {
|
|
193
|
-
activeLivenessType: selfie
|
|
195
|
+
activeLivenessType: activeLivenessTypeOf(selfie),
|
|
194
196
|
activeLivenessVersion: "2.0.0",
|
|
195
|
-
selfieImageOrigin:
|
|
197
|
+
selfieImageOrigin: selfieImageOriginOf(selfie),
|
|
196
198
|
};
|
|
197
199
|
}
|
|
198
200
|
|
|
201
|
+
type SelfieLivenessSource =
|
|
202
|
+
| { enableEnhancedLiveness: boolean; allowAgentMode?: boolean }
|
|
203
|
+
| undefined;
|
|
204
|
+
|
|
205
|
+
function activeLivenessTypeOf(selfie: SelfieLivenessSource): string {
|
|
206
|
+
return selfie?.enableEnhancedLiveness ? "head_pose" : "smile";
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function selfieImageOriginOf(selfie: SelfieLivenessSource): string {
|
|
210
|
+
return selfie?.allowAgentMode ? "back_camera" : "front_camera";
|
|
211
|
+
}
|
|
212
|
+
|
|
199
213
|
function faceDescriptorOf(
|
|
200
214
|
key: AnalyzerFactoryKey | undefined,
|
|
201
215
|
): ModelDescriptor {
|
|
@@ -229,6 +243,6 @@ function faceDescriptorOf(
|
|
|
229
243
|
const NOOP_DOCUMENT_DESCRIPTOR: ModelDescriptor = {
|
|
230
244
|
provider: ModelProvider.Smile,
|
|
231
245
|
name: "noop_document_detector",
|
|
232
|
-
version: "12.0.
|
|
246
|
+
version: "12.0.1",
|
|
233
247
|
bundled: true,
|
|
234
248
|
};
|
|
@@ -61,7 +61,7 @@ import { CameraDefaults } from "../camera/camera_defaults";
|
|
|
61
61
|
|
|
62
62
|
// Beta release version reported to the backend as `sdk_version`. Keep in sync
|
|
63
63
|
// with the `version` field across the published package.json files.
|
|
64
|
-
const SDK_VERSION = "12.0.
|
|
64
|
+
const SDK_VERSION = "12.0.1";
|
|
65
65
|
// The security-policy axis is versioned independently of the SDK release tag,
|
|
66
66
|
// so it stays at the base `12.0.0` (not the prerelease tag).
|
|
67
67
|
const SECURITY_POLICY_VERSION = "12.0.0";
|
|
@@ -468,20 +468,31 @@ export class UseSmileIDMetadataFactory implements MetadataProvider {
|
|
|
468
468
|
// --- field resolvers --------------------------------------------------------
|
|
469
469
|
|
|
470
470
|
function resolveDeviceOs(): string {
|
|
471
|
-
//
|
|
472
|
-
// "iOS 17.4"
|
|
473
|
-
// "Android 14"
|
|
471
|
+
// `"iOS 17.4"` / `"Android 12"` — the shape the native EXIF tagger stamps.
|
|
474
472
|
const platform =
|
|
475
473
|
Platform.OS === "ios"
|
|
476
474
|
? "iOS"
|
|
477
475
|
: Platform.OS === "android"
|
|
478
476
|
? "Android"
|
|
479
477
|
: Platform.OS;
|
|
480
|
-
const version =
|
|
481
|
-
typeof Platform.Version !== "undefined" ? String(Platform.Version) : "";
|
|
478
|
+
const version = resolveOsVersion();
|
|
482
479
|
return version ? `${platform} ${version}` : platform;
|
|
483
480
|
}
|
|
484
481
|
|
|
482
|
+
function resolveOsVersion(): string {
|
|
483
|
+
if (Platform.OS === "android") {
|
|
484
|
+
const release = (
|
|
485
|
+
Platform.constants as { Release?: string | number } | undefined
|
|
486
|
+
)?.Release;
|
|
487
|
+
if (release !== undefined && release !== null && `${release}` !== "") {
|
|
488
|
+
return `${release}`;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
return typeof Platform.Version !== "undefined"
|
|
492
|
+
? String(Platform.Version)
|
|
493
|
+
: "";
|
|
494
|
+
}
|
|
495
|
+
|
|
485
496
|
function resolveLocalTimeOfEnrolment(): string {
|
|
486
497
|
try {
|
|
487
498
|
return new Date().toISOString();
|