@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.
Files changed (255) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.d.ts +11 -0
  3. package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.d.ts.map +1 -0
  4. package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.js +17 -0
  5. package/dist/core/exception/agent_mode_with_enhanced_liveness_exception.js.map +1 -0
  6. package/dist/core/exception/capture_validation_exceptions.d.ts +1 -0
  7. package/dist/core/exception/capture_validation_exceptions.d.ts.map +1 -1
  8. package/dist/core/exception/capture_validation_exceptions.js +1 -0
  9. package/dist/core/exception/capture_validation_exceptions.js.map +1 -1
  10. package/dist/core/exception/index.d.ts +1 -0
  11. package/dist/core/exception/index.d.ts.map +1 -1
  12. package/dist/core/exception/index.js +1 -0
  13. package/dist/core/exception/index.js.map +1 -1
  14. package/dist/core/exception/use_smile_id_error_code.d.ts +1 -0
  15. package/dist/core/exception/use_smile_id_error_code.d.ts.map +1 -1
  16. package/dist/core/exception/use_smile_id_error_code.js +1 -0
  17. package/dist/core/exception/use_smile_id_error_code.js.map +1 -1
  18. package/dist/core/models/config.d.ts +19 -0
  19. package/dist/core/models/config.d.ts.map +1 -1
  20. package/dist/core/models/document_type.d.ts +1 -1
  21. package/dist/core/models/document_type.d.ts.map +1 -1
  22. package/dist/core/models/document_type.js +2 -2
  23. package/dist/core/models/document_type.js.map +1 -1
  24. package/dist/core/models/global_privacy_control.d.ts +36 -0
  25. package/dist/core/models/global_privacy_control.d.ts.map +1 -0
  26. package/dist/core/models/global_privacy_control.js +39 -0
  27. package/dist/core/models/global_privacy_control.js.map +1 -0
  28. package/dist/core/models/network_config.d.ts +2 -2
  29. package/dist/core/models/network_config.js +2 -2
  30. package/dist/data/api/interceptors/smile_auth_interceptor.d.ts.map +1 -1
  31. package/dist/data/api/interceptors/smile_auth_interceptor.js +3 -17
  32. package/dist/data/api/interceptors/smile_auth_interceptor.js.map +1 -1
  33. package/dist/data/api/smile_id_api.d.ts +1 -1
  34. package/dist/data/api/smile_id_api.d.ts.map +1 -1
  35. package/dist/data/dsl/builder/retry_config_builder.d.ts +4 -4
  36. package/dist/data/dsl/builder/retry_config_builder.d.ts.map +1 -1
  37. package/dist/data/dsl/builder/retry_config_builder.js +6 -6
  38. package/dist/data/dsl/builder/retry_config_builder.js.map +1 -1
  39. package/dist/data/smile_id_urls.d.ts +1 -1
  40. package/dist/data/smile_id_urls.js +1 -1
  41. package/dist/data/smile_id_urls.js.map +1 -1
  42. package/dist/data/util/retry_util.d.ts +1 -1
  43. package/dist/data/util/retry_util.d.ts.map +1 -1
  44. package/dist/data/util/retry_util.js +5 -0
  45. package/dist/data/util/retry_util.js.map +1 -1
  46. package/dist/index.d.ts +2 -2
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +2 -2
  49. package/dist/index.js.map +1 -1
  50. package/dist/metadata/builder_configuration.d.ts +5 -0
  51. package/dist/metadata/builder_configuration.d.ts.map +1 -1
  52. package/dist/metadata/builder_configuration.js +1 -0
  53. package/dist/metadata/builder_configuration.js.map +1 -1
  54. package/dist/metadata/metadata_configuration_mappers.d.ts +2 -3
  55. package/dist/metadata/metadata_configuration_mappers.d.ts.map +1 -1
  56. package/dist/metadata/metadata_configuration_mappers.js +13 -6
  57. package/dist/metadata/metadata_configuration_mappers.js.map +1 -1
  58. package/dist/metadata/use_smile_id_metadata_factory.d.ts.map +1 -1
  59. package/dist/metadata/use_smile_id_metadata_factory.js +14 -5
  60. package/dist/metadata/use_smile_id_metadata_factory.js.map +1 -1
  61. package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts +5 -2
  62. package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.d.ts.map +1 -1
  63. package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js +8 -3
  64. package/dist/presentation/components/use_smile_id_enhanced_smart_selfie_clip.js.map +1 -1
  65. package/dist/presentation/components/use_smile_id_instructions_hero.d.ts.map +1 -1
  66. package/dist/presentation/components/use_smile_id_instructions_hero.js +8 -3
  67. package/dist/presentation/components/use_smile_id_instructions_hero.js.map +1 -1
  68. package/dist/presentation/flow/dsl/builder/config_builder.d.ts +16 -0
  69. package/dist/presentation/flow/dsl/builder/config_builder.d.ts.map +1 -1
  70. package/dist/presentation/flow/dsl/builder/config_builder.js +18 -0
  71. package/dist/presentation/flow/dsl/builder/config_builder.js.map +1 -1
  72. package/dist/presentation/flow/dsl/builder/screens_builder.d.ts +3 -6
  73. package/dist/presentation/flow/dsl/builder/screens_builder.d.ts.map +1 -1
  74. package/dist/presentation/flow/dsl/builder/screens_builder.js +3 -6
  75. package/dist/presentation/flow/dsl/builder/screens_builder.js.map +1 -1
  76. package/dist/presentation/flow/flow_navigation_manager.d.ts +5 -1
  77. package/dist/presentation/flow/flow_navigation_manager.d.ts.map +1 -1
  78. package/dist/presentation/flow/flow_navigation_manager.js +7 -1
  79. package/dist/presentation/flow/flow_navigation_manager.js.map +1 -1
  80. package/dist/presentation/flow/model/instructions_defaults.d.ts.map +1 -1
  81. package/dist/presentation/flow/model/instructions_defaults.js +1 -1
  82. package/dist/presentation/flow/model/instructions_defaults.js.map +1 -1
  83. package/dist/presentation/flow/screen/orchestrated_capture_screen.d.ts.map +1 -1
  84. package/dist/presentation/flow/screen/orchestrated_capture_screen.js +13 -3
  85. package/dist/presentation/flow/screen/orchestrated_capture_screen.js.map +1 -1
  86. package/dist/presentation/flow/screen/orchestrated_consent_screen.d.ts.map +1 -1
  87. package/dist/presentation/flow/screen/orchestrated_consent_screen.js +3 -1
  88. package/dist/presentation/flow/screen/orchestrated_consent_screen.js.map +1 -1
  89. package/dist/presentation/flow/screen/orchestrated_preview_screen.d.ts.map +1 -1
  90. package/dist/presentation/flow/screen/orchestrated_preview_screen.js +0 -8
  91. package/dist/presentation/flow/screen/orchestrated_preview_screen.js.map +1 -1
  92. package/dist/presentation/flow/use_smile_id_flow.d.ts.map +1 -1
  93. package/dist/presentation/flow/use_smile_id_flow.js +10 -4
  94. package/dist/presentation/flow/use_smile_id_flow.js.map +1 -1
  95. package/dist/presentation/flow/validation/flow_validator.d.ts.map +1 -1
  96. package/dist/presentation/flow/validation/flow_validator.js +42 -20
  97. package/dist/presentation/flow/validation/flow_validator.js.map +1 -1
  98. package/dist/presentation/screen/helpers/capture_ui_state.d.ts +6 -6
  99. package/dist/presentation/screen/helpers/capture_ui_state.d.ts.map +1 -1
  100. package/dist/presentation/screen/helpers/capture_ui_state.js +19 -19
  101. package/dist/presentation/screen/helpers/capture_ui_state.js.map +1 -1
  102. package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts +2 -2
  103. package/dist/presentation/screen/helpers/ess_turn_haptics.d.ts.map +1 -1
  104. package/dist/presentation/screen/helpers/ess_turn_haptics.js +6 -6
  105. package/dist/presentation/screen/helpers/ess_turn_haptics.js.map +1 -1
  106. package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts +5 -5
  107. package/dist/presentation/screen/helpers/scan_state_to_overlay_state.d.ts.map +1 -1
  108. package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js +11 -11
  109. package/dist/presentation/screen/helpers/scan_state_to_overlay_state.js.map +1 -1
  110. package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts +13 -3
  111. package/dist/presentation/screen/helpers/use_capture_orientation_lock.d.ts.map +1 -1
  112. package/dist/presentation/screen/helpers/use_capture_orientation_lock.js +48 -6
  113. package/dist/presentation/screen/helpers/use_capture_orientation_lock.js.map +1 -1
  114. package/dist/presentation/screen/use_smile_id_capture_screen.d.ts +4 -2
  115. package/dist/presentation/screen/use_smile_id_capture_screen.d.ts.map +1 -1
  116. package/dist/presentation/screen/use_smile_id_capture_screen.js +36 -15
  117. package/dist/presentation/screen/use_smile_id_capture_screen.js.map +1 -1
  118. package/dist/presentation/screen/use_smile_id_consent_screen.d.ts +7 -0
  119. package/dist/presentation/screen/use_smile_id_consent_screen.d.ts.map +1 -1
  120. package/dist/presentation/screen/use_smile_id_consent_screen.js +6 -5
  121. package/dist/presentation/screen/use_smile_id_consent_screen.js.map +1 -1
  122. package/dist/presentation/screen/use_smile_id_document_back_instructions.d.ts.map +1 -1
  123. package/dist/presentation/screen/use_smile_id_document_back_instructions.js +5 -13
  124. package/dist/presentation/screen/use_smile_id_document_back_instructions.js.map +1 -1
  125. package/dist/presentation/screen/use_smile_id_document_preview_screen.js +1 -1
  126. package/dist/presentation/screen/use_smile_id_document_preview_screen.js.map +1 -1
  127. package/dist/presentation/screen/use_smile_id_preview_screen.d.ts +1 -21
  128. package/dist/presentation/screen/use_smile_id_preview_screen.d.ts.map +1 -1
  129. package/dist/presentation/screen/use_smile_id_preview_screen.js +3 -14
  130. package/dist/presentation/screen/use_smile_id_preview_screen.js.map +1 -1
  131. package/dist/presentation/screen/use_smile_id_processing_screen.js +1 -1
  132. package/dist/presentation/screen/use_smile_id_processing_screen.js.map +1 -1
  133. package/dist/presentation/utils/locale_utils.d.ts +10 -4
  134. package/dist/presentation/utils/locale_utils.d.ts.map +1 -1
  135. package/dist/presentation/utils/locale_utils.js +13 -5
  136. package/dist/presentation/utils/locale_utils.js.map +1 -1
  137. package/dist/testing/fake_face_analyzer.d.ts +43 -0
  138. package/dist/testing/fake_face_analyzer.d.ts.map +1 -0
  139. package/dist/testing/fake_face_analyzer.js +52 -0
  140. package/dist/testing/fake_face_analyzer.js.map +1 -0
  141. package/dist/testing/index.d.ts +5 -0
  142. package/dist/testing/index.d.ts.map +1 -0
  143. package/dist/testing/index.js +7 -0
  144. package/dist/testing/index.js.map +1 -0
  145. package/dist/testing/scenario_expectations.d.ts +28 -0
  146. package/dist/testing/scenario_expectations.d.ts.map +1 -0
  147. package/dist/testing/scenario_expectations.js +65 -0
  148. package/dist/testing/scenario_expectations.js.map +1 -0
  149. package/dist/testing/scenario_loader.d.ts +11 -0
  150. package/dist/testing/scenario_loader.d.ts.map +1 -0
  151. package/dist/testing/scenario_loader.js +64 -0
  152. package/dist/testing/scenario_loader.js.map +1 -0
  153. package/dist/testing/scripted_scan_results.d.ts +17 -0
  154. package/dist/testing/scripted_scan_results.d.ts.map +1 -0
  155. package/dist/testing/scripted_scan_results.js +52 -0
  156. package/dist/testing/scripted_scan_results.js.map +1 -0
  157. package/package.json +11 -4
  158. package/src/__tests__/dsl.test.ts +51 -1
  159. package/src/__tests__/setup_react_native.ts +17 -2
  160. package/src/__tests__/snapshots/__snapshots__/screens_structural.test.tsx.snap +5261 -0
  161. package/src/__tests__/snapshots/screens_structural.test.tsx +230 -0
  162. package/src/camera/__tests__/use_smile_id_camera_system.test.ts +103 -0
  163. package/src/core/exception/__tests__/builder_validation_exceptions.test.ts +67 -0
  164. package/src/core/exception/agent_mode_with_enhanced_liveness_exception.ts +20 -0
  165. package/src/core/exception/capture_validation_exceptions.ts +1 -0
  166. package/src/core/exception/index.ts +1 -0
  167. package/src/core/exception/use_smile_id_error_code.ts +1 -0
  168. package/src/core/models/__tests__/document_type.test.ts +2 -2
  169. package/src/core/models/__tests__/flow_models.test.ts +26 -0
  170. package/src/core/models/config.ts +22 -0
  171. package/src/core/models/document_type.ts +2 -2
  172. package/src/core/models/global_privacy_control.ts +45 -0
  173. package/src/core/models/network_config.ts +2 -2
  174. package/src/data/api/__tests__/smile_id_api.test.ts +1 -1
  175. package/src/data/api/interceptors/__tests__/gzip_interceptor.test.ts +83 -0
  176. package/src/data/api/interceptors/smile_auth_interceptor.ts +3 -18
  177. package/src/data/compression/__tests__/payload_compressor_real_jpeg.test.ts +6 -2
  178. package/src/data/dsl/builder/__tests__/config_builders.test.ts +62 -0
  179. package/src/data/dsl/builder/retry_config_builder.ts +6 -6
  180. package/src/data/factory/__tests__/retry_gzip_mac_composition.test.ts +163 -0
  181. package/src/data/factory/__tests__/signed_job_submission_headers.test.ts +1 -1
  182. package/src/data/repository/__tests__/network_retries.test.ts +1 -1
  183. package/src/data/repository/__tests__/use_smile_id_repository.test.ts +1 -1
  184. package/src/data/security/__tests__/request_canonicalizer.test.ts +132 -0
  185. package/src/data/smile_id_urls.ts +1 -1
  186. package/src/data/util/__tests__/retry_util.test.ts +25 -0
  187. package/src/data/util/retry_util.ts +9 -1
  188. package/src/index.ts +6 -4
  189. package/src/metadata/__tests__/metadata_configuration_mappers.test.ts +39 -0
  190. package/src/metadata/__tests__/metadata_configuration_objects.test.ts +2 -1
  191. package/src/metadata/__tests__/metadata_device_context.test.ts +3 -3
  192. package/src/metadata/__tests__/metadata_device_os_android.test.ts +18 -0
  193. package/src/metadata/__tests__/metadata_golden_fixture.json +1 -1
  194. package/src/metadata/__tests__/metadata_payload_golden.test.ts +4 -4
  195. package/src/metadata/__tests__/use_smile_id_metadata.test.ts +1 -1
  196. package/src/metadata/builder_configuration.ts +6 -0
  197. package/src/metadata/metadata_configuration_mappers.ts +21 -7
  198. package/src/metadata/use_smile_id_metadata_factory.ts +17 -6
  199. package/src/presentation/assets/si_document_green_book_hero_animation.json +1 -4668
  200. package/src/presentation/assets/si_document_hero_animation.json +1 -4799
  201. package/src/presentation/assets/si_document_hero_back_animation.json +1 -2039
  202. package/src/presentation/assets/si_document_passport_hero_animation.json +1 -14491
  203. package/src/presentation/assets/si_ess_all_directions_hero_animation.json +1 -0
  204. package/src/presentation/assets/si_ess_animation_all_directions.json +1 -6589
  205. package/src/presentation/assets/si_selfie_hero_animation.json +1 -1439
  206. package/src/presentation/assets/si_smile_to_capture_animation.json +1 -1439
  207. package/src/presentation/components/__tests__/use_smile_id_enhanced_smart_selfie_clip.test.tsx +9 -4
  208. package/src/presentation/components/__tests__/use_smile_id_instructions_hero.test.tsx +44 -0
  209. package/src/presentation/components/use_smile_id_enhanced_smart_selfie_clip.tsx +9 -3
  210. package/src/presentation/components/use_smile_id_instructions_hero.tsx +10 -0
  211. package/src/presentation/flow/__tests__/document_flow_navigation.test.ts +3 -3
  212. package/src/presentation/flow/__tests__/flow_navigation_manager.test.ts +49 -0
  213. package/src/presentation/flow/dsl/builder/__tests__/config_builder.test.ts +25 -0
  214. package/src/presentation/flow/dsl/builder/config_builder.ts +21 -0
  215. package/src/presentation/flow/dsl/builder/screens_builder.ts +3 -6
  216. package/src/presentation/flow/flow_navigation_manager.ts +6 -1
  217. package/src/presentation/flow/model/instructions_defaults.ts +1 -1
  218. package/src/presentation/flow/screen/orchestrated_capture_screen.tsx +18 -3
  219. package/src/presentation/flow/screen/orchestrated_consent_screen.tsx +5 -0
  220. package/src/presentation/flow/screen/orchestrated_preview_screen.tsx +0 -12
  221. package/src/presentation/flow/use_smile_id_flow.tsx +11 -4
  222. package/src/presentation/flow/validation/__tests__/flow_validator.test.ts +61 -1
  223. package/src/presentation/flow/validation/flow_validator.ts +55 -26
  224. package/src/presentation/screen/__tests__/capture_ui_state.test.ts +66 -47
  225. package/src/presentation/screen/__tests__/ess_turn_haptics.test.ts +15 -11
  226. package/src/presentation/screen/__tests__/scan_state_to_overlay_state.test.ts +47 -27
  227. package/src/presentation/screen/__tests__/use_smile_id_capture_screen.test.tsx +176 -14
  228. package/src/presentation/screen/__tests__/use_smile_id_document_back_instructions.test.tsx +1 -1
  229. package/src/presentation/screen/__tests__/use_smile_id_preview_screen.test.tsx +10 -40
  230. package/src/presentation/screen/helpers/__tests__/use_capture_orientation_lock.test.tsx +212 -0
  231. package/src/presentation/screen/helpers/capture_ui_state.ts +27 -27
  232. package/src/presentation/screen/helpers/ess_turn_haptics.ts +9 -9
  233. package/src/presentation/screen/helpers/scan_state_to_overlay_state.ts +13 -13
  234. package/src/presentation/screen/helpers/use_capture_orientation_lock.ts +69 -7
  235. package/src/presentation/screen/use_smile_id_capture_screen.tsx +47 -19
  236. package/src/presentation/screen/use_smile_id_consent_screen.tsx +16 -5
  237. package/src/presentation/screen/use_smile_id_document_back_instructions.tsx +14 -23
  238. package/src/presentation/screen/use_smile_id_document_preview_screen.tsx +1 -1
  239. package/src/presentation/screen/use_smile_id_preview_screen.tsx +13 -45
  240. package/src/presentation/screen/use_smile_id_processing_screen.tsx +1 -1
  241. package/src/presentation/utils/__tests__/locale_utils.test.ts +46 -5
  242. package/src/presentation/utils/locale_utils.ts +13 -4
  243. package/src/testing/__tests__/fake_face_analyzer.test.ts +42 -0
  244. package/src/testing/__tests__/scenario_expectations.test.ts +110 -0
  245. package/src/testing/__tests__/scenario_loader.test.ts +64 -0
  246. package/src/testing/fake_face_analyzer.ts +82 -0
  247. package/src/testing/index.ts +15 -0
  248. package/src/testing/scenario_expectations.ts +87 -0
  249. package/src/testing/scenario_loader.ts +83 -0
  250. package/src/testing/scripted_scan_results.ts +66 -0
  251. package/dist/presentation/components/use_smile_id_face_silhouette_overlay.d.ts +0 -15
  252. package/dist/presentation/components/use_smile_id_face_silhouette_overlay.d.ts.map +0 -1
  253. package/dist/presentation/components/use_smile_id_face_silhouette_overlay.js +0 -19
  254. package/dist/presentation/components/use_smile_id_face_silhouette_overlay.js.map +0 -1
  255. 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.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.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.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.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.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.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.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.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.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.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 (`head_pose` when enhanced
169
- * liveness is on, else `smile`), the version, and the selfie origin (always
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: { enableEnhancedLiveness: boolean } | undefined;
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?.enableEnhancedLiveness ? "head_pose" : "smile",
195
+ activeLivenessType: activeLivenessTypeOf(selfie),
194
196
  activeLivenessVersion: "2.0.0",
195
- selfieImageOrigin: "front_camera",
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.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.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
- // Human-readable string with platform name + version. Examples:
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();