@incodetech/core 0.0.0-dev-20260323-d29613f → 0.0.0-dev-20260324-90ddcfd

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 (82) hide show
  1. package/dist/{addressSearch-B3sA8vgs.esm.js → addressSearch-DCaEdoev.esm.js} +4 -4
  2. package/dist/authentication.d.ts +10 -10
  3. package/dist/authentication.esm.js +11 -10
  4. package/dist/{authenticationManager-BjTgDn8A.d.ts → authenticationManager-C-Mmg1uU.d.ts} +2 -2
  5. package/dist/{authenticationManager-CVEXKvB3.esm.js → authenticationManager-CEGYyu8r.esm.js} +6 -6
  6. package/dist/{backCameraStream-BxXYKUoc.esm.js → backCameraStream-BPzo60FO.esm.js} +1 -1
  7. package/dist/browserSimulation-DYAk0Ipe.esm.js +20 -0
  8. package/dist/consent.d.ts +56 -56
  9. package/dist/consent.esm.js +4 -4
  10. package/dist/curp-validation.d.ts +4 -4
  11. package/dist/curp-validation.esm.js +4 -4
  12. package/dist/{deepsightLoader-CF1OkQt_.esm.js → deepsightLoader-ErxPZUBZ.esm.js} +5 -4
  13. package/dist/{deepsightService-tFm-XfrF.esm.js → deepsightService-BcdwWkYD.esm.js} +11 -23
  14. package/dist/{deepsightService-CdGGD_BP.d.ts → deepsightService-C47Uyf6m.d.ts} +3 -1
  15. package/dist/document-capture.d.ts +60 -60
  16. package/dist/document-capture.esm.js +5 -5
  17. package/dist/document-upload.d.ts +52 -52
  18. package/dist/document-upload.esm.js +5 -5
  19. package/dist/ekyb.d.ts +2 -2
  20. package/dist/ekyb.esm.js +8 -6
  21. package/dist/ekyc.d.ts +2 -2
  22. package/dist/ekyc.esm.js +5 -5
  23. package/dist/email.d.ts +3 -3
  24. package/dist/email.esm.js +5 -5
  25. package/dist/{emailManager-CtSwZTSn.esm.js → emailManager-1W2Uh6du.esm.js} +4 -4
  26. package/dist/{emailManager-lUXVfa0R.d.ts → emailManager-CN9sSCz6.d.ts} +2 -2
  27. package/dist/{endpoints-Bydn-Ave.esm.js → endpoints-b2PxFIku.esm.js} +2 -0
  28. package/dist/{events-c-r7jhs3.esm.js → events-CbNkXF2Q.esm.js} +12 -3
  29. package/dist/extensibility.d.ts +14 -14
  30. package/dist/extensibility.esm.js +16 -14
  31. package/dist/face-match.d.ts +1 -1
  32. package/dist/face-match.esm.js +4 -4
  33. package/dist/{faceCaptureManagerFactory-BulU7xFu.d.ts → faceCaptureManagerFactory-UFhWTbej.d.ts} +10 -7
  34. package/dist/{faceCaptureSetup-yPrsOQES.esm.js → faceCaptureSetup-CoeOjXeo.esm.js} +13 -9
  35. package/dist/flow.d.ts +7 -7
  36. package/dist/flow.esm.js +8 -6
  37. package/dist/{flowCompletionService-C-pC9OZ9.esm.js → flowCompletionService-DkbMP576.esm.js} +2 -2
  38. package/dist/{flowServices-Cc1HxYIC.esm.js → flowServices-jrv5Zxbr.esm.js} +48 -4
  39. package/dist/geolocation.d.ts +1 -1
  40. package/dist/geolocation.esm.js +4 -4
  41. package/dist/government-validation.d.ts +1 -1
  42. package/dist/government-validation.esm.js +4 -4
  43. package/dist/id.d.ts +9 -9
  44. package/dist/id.esm.js +12 -10
  45. package/dist/{idCaptureManager-Dkzxvhrt.esm.js → idCaptureManager-BniIgM20.esm.js} +50 -228
  46. package/dist/{idCaptureManager-DCXMoCXo.d.ts → idCaptureManager-Dn7_eHt9.d.ts} +25 -8
  47. package/dist/index.d.ts +24 -11
  48. package/dist/index.esm.js +13 -11
  49. package/dist/{lib-3ivDs79I.esm.js → lib-VFNBaz_7.esm.js} +1 -1
  50. package/dist/mandatory-consent.d.ts +411 -0
  51. package/dist/mandatory-consent.esm.js +198 -0
  52. package/dist/phone.d.ts +3 -3
  53. package/dist/phone.esm.js +5 -5
  54. package/dist/{phoneManager-pTIOvlCD.d.ts → phoneManager-B0MT8wYz.d.ts} +2 -2
  55. package/dist/{phoneManager-D18wCI69.esm.js → phoneManager-Cvp5LFN7.esm.js} +4 -4
  56. package/dist/{recordingsRepository-CIzyj6XC.esm.js → recordingsRepository-DGWSMj-_.esm.js} +3 -3
  57. package/dist/redirect-to-mobile.d.ts +1 -1
  58. package/dist/redirect-to-mobile.esm.js +4 -4
  59. package/dist/selfie.d.ts +10 -10
  60. package/dist/selfie.esm.js +11 -10
  61. package/dist/{selfieManager-5_CouEZs.esm.js → selfieManager-BxwT4tDD.esm.js} +3 -3
  62. package/dist/{selfieManager-BqX2VFj1.d.ts → selfieManager-DSn8EPLE.d.ts} +2 -2
  63. package/dist/session-4QVMNIs5.esm.js +243 -0
  64. package/dist/session.d.ts +1 -1
  65. package/dist/session.esm.js +3 -3
  66. package/dist/{src-DevpZoey.esm.js → src-BX-m0lbm.esm.js} +5 -2
  67. package/dist/{stats-D76Thmqp.esm.js → stats-BaWAv541.esm.js} +1 -1
  68. package/dist/stats.esm.js +2 -2
  69. package/dist/{types-DSJflCEU.d.ts → types-0A1THNYO.d.ts} +5 -2
  70. package/dist/{types-CHzupruc.d.ts → types-BYFeUhw0.d.ts} +1 -1
  71. package/package.json +5 -1
  72. /package/dist/{Actor-D6rhGxJy.d.ts → Actor-By8WNHi-.d.ts} +0 -0
  73. /package/dist/{Manager-CVDYGoSq.d.ts → Manager-BWqHEUjI.d.ts} +0 -0
  74. /package/dist/{StateMachine-BqtRw_hz.d.ts → StateMachine-dxjI9q0V.d.ts} +0 -0
  75. /package/dist/{api-3fZO5bmj.esm.js → api-C2uzxrpN.esm.js} +0 -0
  76. /package/dist/{camera-CVBwqx-j.d.ts → camera-BCRgkMoe.d.ts} +0 -0
  77. /package/dist/{chunk-C24vxluH.esm.js → chunk-NXK2ElUW.esm.js} +0 -0
  78. /package/dist/{displayErrors-BgtBHbfb.d.ts → displayErrors-CV7ux9Fr.d.ts} +0 -0
  79. /package/dist/{flowCompletionService-De8JDo87.d.ts → flowCompletionService-sG6KA8y2.d.ts} +0 -0
  80. /package/dist/{id-r_CoQ3r-.esm.js → id-C3aKMJhc.esm.js} +0 -0
  81. /package/dist/{index-LKrIp3Oo.d.ts → index-DGdyPh8A.d.ts} +0 -0
  82. /package/dist/{warmup-DoQLFT3z.d.ts → warmup-B_dntecl.d.ts} +0 -0
@@ -1,228 +1,12 @@
1
- import { S as revokeObjectURL, _ as setup, b as fromPromise, m as addEvent, n as eventModuleNames, o as createManagerInstrumentation, s as getDefaultManagerScreenName, v as assign, x as createActor, y as fromCallback } from "./events-c-r7jhs3.esm.js";
2
- import { t as getBackCameraStream } from "./backCameraStream-BxXYKUoc.esm.js";
3
- import { A as createManager, I as isDesktop, N as getWindowDimensions, S as StreamCanvasCapture, T as IncodeCanvas, _ as BrowserStorageProvider, d as OpenViduRecordingProvider, g as BrowserTimerProvider, h as FingerprintProvider, i as DEFAULT_ID_CAPTURE_THRESHOLDS, m as IpifyProvider, o as IdCaptureProvider, r as DEFAULT_ID_CAPTURE_MODEL_VERSION, v as BrowserInfoProvider, x as StreamCanvasProcessingSession, y as BrowserEnvironmentProvider } from "./src-DevpZoey.esm.js";
4
- import { a as checkPermission, c as getDeviceClass, n as startRecording, o as requestPermission, r as stopRecording$1, t as createRecordingSession } from "./recordingsRepository-CIzyj6XC.esm.js";
5
- import { n as isBrowserSimulation } from "./deepsightService-tFm-XfrF.esm.js";
6
- import { n as getApi, r as getToken, t as api } from "./api-3fZO5bmj.esm.js";
7
- import { t as endpoints } from "./endpoints-Bydn-Ave.esm.js";
8
- import { t as addDeviceStats } from "./stats-D76Thmqp.esm.js";
1
+ import { C as revokeObjectURL, S as createActor, b as fromCallback, n as eventModuleNames, o as createManagerInstrumentation, s as getDefaultManagerScreenName, v as setup, x as fromPromise, y as assign } from "./events-CbNkXF2Q.esm.js";
2
+ import { t as getBackCameraStream } from "./backCameraStream-BPzo60FO.esm.js";
3
+ import { A as createManager, I as isDesktop, N as getWindowDimensions, S as StreamCanvasCapture, T as IncodeCanvas, _ as BrowserStorageProvider, d as OpenViduRecordingProvider, g as BrowserTimerProvider, i as DEFAULT_ID_CAPTURE_THRESHOLDS, o as IdCaptureProvider, r as DEFAULT_ID_CAPTURE_MODEL_VERSION, x as StreamCanvasProcessingSession } from "./src-BX-m0lbm.esm.js";
4
+ import { a as checkPermission, c as getDeviceClass, n as startRecording, o as requestPermission, r as stopRecording$1, t as createRecordingSession } from "./recordingsRepository-DGWSMj-_.esm.js";
5
+ import { r as getToken, t as api } from "./api-C2uzxrpN.esm.js";
6
+ import { t as endpoints } from "./endpoints-b2PxFIku.esm.js";
7
+ import { t as getDisableIpify } from "./session-4QVMNIs5.esm.js";
8
+ import { t as addDeviceStats } from "./stats-BaWAv541.esm.js";
9
9
 
10
- //#region src/internal/session/sessionService.ts
11
- /**
12
- * Creates a new onboarding session.
13
- *
14
- * @param apiKey - The API key from the Incode dashboard
15
- * @param options - Session creation options
16
- * @param signal - Optional AbortSignal for request cancellation
17
- * @returns The created session with token
18
- *
19
- * @example
20
- * ```ts
21
- * const session = await createSession('your-api-key', {
22
- * configurationId: 'your-flow-id',
23
- * language: 'en-US',
24
- * });
25
- * console.log(session.token); // Use this token for subsequent API calls
26
- * ```
27
- */
28
- async function createSession(apiKey, options, signal) {
29
- const res = await getApi().post(endpoints.createSession, {
30
- configurationId: options.configurationId,
31
- externalId: options.externalId,
32
- externalCustomerId: options.externalCustomerId,
33
- language: options.language ?? "en-US",
34
- customFields: options.customFields,
35
- uuid: options.uuid ?? null,
36
- interviewId: options.interviewId ?? null
37
- }, {
38
- headers: {
39
- "x-api-key": apiKey,
40
- "api-version": "1.0"
41
- },
42
- signal
43
- });
44
- if (!res.ok) throw new Error(`POST ${endpoints.createSession} failed: ${res.status} ${res.statusText}`);
45
- return res.data;
46
- }
47
-
48
- //#endregion
49
- //#region src/internal/featureConfig/featureConfigService.ts
50
- let cachedFeatures$1 = null;
51
- /**
52
- * Checks if a feature is enabled in the feature config.
53
- */
54
- function isFeatureEnabled(feature, features) {
55
- return features?.find((f) => f.feature === feature)?.enabled ?? false;
56
- }
57
- /**
58
- * Fetches feature configuration from the backend.
59
- * Results are cached for the session lifetime.
60
- */
61
- async function fetchFeatureConfig(signal) {
62
- if (cachedFeatures$1) return cachedFeatures$1;
63
- const response = await api.get(endpoints.featureConfig, { signal });
64
- if (!response.ok) throw new Error(`Failed to fetch feature config: ${response.status} ${response.statusText}`);
65
- cachedFeatures$1 = response.data;
66
- return cachedFeatures$1;
67
- }
68
- /**
69
- * Resets the cached feature config (useful for testing).
70
- */
71
- function resetFeatureConfigCache() {
72
- cachedFeatures$1 = null;
73
- }
74
-
75
- //#endregion
76
- //#region src/internal/fingerprint/fingerprintService.ts
77
- const SDK_VERSION = "2.0.0";
78
- function formatOsVersion(os) {
79
- return `${os.name || "Unknown"} ${os.version || ""}`.trim();
80
- }
81
- function formatBrowser(browser) {
82
- if (!browser.name || !browser.version) return "Unknown";
83
- return `${browser.name} ${browser.version}`;
84
- }
85
- async function submitDeviceFingerprint(options = {}, dependencies) {
86
- const { disableIpify = false, hostingApp, signal } = options;
87
- const fingerprint = await dependencies.fingerprintProvider.getFingerprint(disableIpify);
88
- const hasLiedBrowser = isBrowserSimulation(dependencies.browserEnv);
89
- const payload = {
90
- hash: fingerprint.visitorId || "",
91
- ip: fingerprint.ip || "",
92
- deviceType: "WEBAPP",
93
- data: JSON.stringify(fingerprint),
94
- osVersion: formatOsVersion(fingerprint.deviceInfo.os),
95
- deviceModel: fingerprint.deviceInfo.device.model || "",
96
- browser: formatBrowser(fingerprint.deviceInfo.browser),
97
- hasLiedBrowser,
98
- sdkVersion: SDK_VERSION,
99
- hostingApp: hostingApp ?? "Web SDK"
100
- };
101
- const response = await api.post(endpoints.deviceFingerprint, payload, { signal });
102
- if (!response.ok) throw new Error(`Failed to submit fingerprint: ${response.status} ${response.statusText}`);
103
- return response.data;
104
- }
105
-
106
- //#endregion
107
- //#region src/internal/session/sessionInitializer.ts
108
- let sessionInitialized = false;
109
- let cachedFeatures = null;
110
- let cachedDisableIpify = false;
111
- /**
112
- * Initializes session-level services after the token is set.
113
- * This should be called once after createSession() or setToken().
114
- *
115
- * Performs:
116
- * 1. Fetches feature configuration from backend
117
- * 2. Submits device fingerprint
118
- *
119
- * Results are cached for the session lifetime.
120
- *
121
- * @param options - Optional configuration
122
- * @returns Session initialization result with feature config
123
- *
124
- * @example
125
- * ```ts
126
- * // After creating a session
127
- * const session = await createSession('api-key', options);
128
- * setup({ apiURL, token: session.token });
129
- * const { features } = await initializeSession();
130
- *
131
- * // Check feature flags
132
- * if (isFeatureEnabled('DISABLE_IPIFY', features.features)) {
133
- * // Handle disabled ipify
134
- * }
135
- * ```
136
- */
137
- async function initializeSession(options = {}) {
138
- const { hostingApp, signal } = options;
139
- if (sessionInitialized && cachedFeatures) return {
140
- features: cachedFeatures,
141
- disableIpify: cachedDisableIpify,
142
- fingerprintSuccess: true
143
- };
144
- let features;
145
- let disableIpify = false;
146
- try {
147
- features = await fetchFeatureConfig(signal);
148
- disableIpify = isFeatureEnabled("DISABLE_IPIFY", features.features);
149
- } catch {
150
- features = { sessionIdentifier: "" };
151
- }
152
- let fingerprintSuccess = false;
153
- try {
154
- const fingerprintProvider = new FingerprintProvider(new IpifyProvider());
155
- const browserEnv = new BrowserEnvironmentProvider();
156
- await submitDeviceFingerprint({
157
- disableIpify,
158
- hostingApp,
159
- signal
160
- }, {
161
- fingerprintProvider,
162
- browserEnv
163
- });
164
- fingerprintSuccess = true;
165
- } catch (error) {
166
- console.warn("Failed to submit device fingerprint:", error);
167
- }
168
- try {
169
- const browserInfo = new BrowserInfoProvider().getBrowserInfo();
170
- addEvent({
171
- code: "browser",
172
- payload: {
173
- userAgent: browserInfo.userAgent,
174
- isWebRtcSupported: browserInfo.isWebRtcSupported,
175
- browser: browserInfo.browser,
176
- os: browserInfo.os,
177
- device: browserInfo.device,
178
- engine: browserInfo.engine,
179
- cpu: browserInfo.cpu
180
- }
181
- });
182
- } catch (error) {
183
- console.warn("Failed to send browser info event:", error);
184
- }
185
- sessionInitialized = true;
186
- cachedFeatures = features;
187
- cachedDisableIpify = disableIpify;
188
- return {
189
- features,
190
- disableIpify,
191
- fingerprintSuccess
192
- };
193
- }
194
- /**
195
- * Gets the cached feature configuration.
196
- * Returns undefined if session hasn't been initialized.
197
- */
198
- function getSessionFeatures() {
199
- return cachedFeatures ?? void 0;
200
- }
201
- /**
202
- * Gets the cached disableIpify flag.
203
- * Returns false if session hasn't been initialized.
204
- */
205
- function getDisableIpify() {
206
- return cachedDisableIpify;
207
- }
208
- /**
209
- * Checks if the session has been initialized.
210
- */
211
- function isSessionInitialized() {
212
- return sessionInitialized;
213
- }
214
- /**
215
- * Resets session initialization state.
216
- * Useful for testing or when starting a new session.
217
- */
218
- function resetSessionInit() {
219
- sessionInitialized = false;
220
- cachedFeatures = null;
221
- cachedDisableIpify = false;
222
- resetFeatureConfigCache();
223
- }
224
-
225
- //#endregion
226
10
  //#region src/modules/id/idCaptureHelpers.ts
227
11
  /**
228
12
  * Map of config properties received from the backend to adjusted, internal document types.
@@ -774,6 +558,8 @@ const uploadIdImageActor = fromPromise(async ({ input, signal }) => {
774
558
  metadata = input.deepsightService.getMetadata();
775
559
  } catch {}
776
560
  const imageData = input.canvas?.getImageData() ?? void 0;
561
+ const logs = input.deepsightService?.getPipelineState() ?? "";
562
+ input.dependencies?.trackCaptureAttemptFinished?.({ logs });
777
563
  return uploadIdImage({
778
564
  image,
779
565
  type: input.type,
@@ -822,7 +608,7 @@ const checkMotionSensorActor = fromCallback(({ input, sendBack }) => {
822
608
  });
823
609
  const initializeDeepsightSessionActor = fromPromise(async ({ input }) => {
824
610
  if (!input.dependencies) return;
825
- const { loadDeepsightSession } = await import("./deepsightLoader-CF1OkQt_.esm.js");
611
+ const { loadDeepsightSession } = await import("./deepsightLoader-ErxPZUBZ.esm.js");
826
612
  return loadDeepsightSession({
827
613
  ds: input.ds,
828
614
  storage: input.dependencies.storage,
@@ -1098,6 +884,7 @@ const shouldContinueToBackGuard = ({ context }) => {
1098
884
  return true;
1099
885
  };
1100
886
  const shouldContinueToFrontGuard = ({ context }) => context.config.usSmartCapture === true && context.currentMode === "back" && context.uploadResponse?.forceFrontIdCapture === true;
887
+ const hasMandatoryConsentGuard = ({ context }) => context.uploadResponse?.showMandatoryConsent === true;
1101
888
  const isDeepsightEnabledGuard = ({ context }) => context.dependencies !== void 0;
1102
889
  const isDeepsightReadyGuard = ({ context }) => context.deepsightService !== void 0;
1103
890
  const needsDeepsightInitGuard = ({ context }) => context.dependencies !== void 0 && context.deepsightService === void 0 && !context.deepsightInitAttempted;
@@ -1279,6 +1066,7 @@ const _idCaptureMachine = setup({
1279
1066
  isOnlyFront: isOnlyFrontGuard,
1280
1067
  shouldContinueToBack: shouldContinueToBackGuard,
1281
1068
  shouldContinueToFront: shouldContinueToFrontGuard,
1069
+ hasMandatoryConsent: hasMandatoryConsentGuard,
1282
1070
  isDeepsightEnabled: isDeepsightEnabledGuard,
1283
1071
  isDeepsightReady: isDeepsightReadyGuard,
1284
1072
  needsDeepsightInit: needsDeepsightInitGuard
@@ -1733,7 +1521,8 @@ const _idCaptureMachine = setup({
1733
1521
  deepsightService: context.deepsightService,
1734
1522
  stream: context.stream,
1735
1523
  isSecondId: context.config.isSecondId ?? false,
1736
- onlyFront: context.config.onlyFront
1524
+ onlyFront: context.config.onlyFront,
1525
+ dependencies: context.dependencies
1737
1526
  };
1738
1527
  },
1739
1528
  onDone: {
@@ -1779,6 +1568,10 @@ const _idCaptureMachine = setup({
1779
1568
  { target: "#idCapture.processing" }
1780
1569
  ] } },
1781
1570
  success: { on: { NEXT_STEP: [
1571
+ {
1572
+ target: "#idCapture.mandatoryConsent",
1573
+ guard: "hasMandatoryConsent"
1574
+ },
1782
1575
  {
1783
1576
  target: "#idCapture.frontFinished",
1784
1577
  guard: "shouldContinueToBack"
@@ -1791,6 +1584,20 @@ const _idCaptureMachine = setup({
1791
1584
  ] } }
1792
1585
  }
1793
1586
  },
1587
+ mandatoryConsent: { on: {
1588
+ CONSENT_ACCEPT: [
1589
+ {
1590
+ target: "frontFinished",
1591
+ guard: "shouldContinueToBack"
1592
+ },
1593
+ {
1594
+ target: "backFinished",
1595
+ guard: "shouldContinueToFront"
1596
+ },
1597
+ { target: "processing" }
1598
+ ],
1599
+ CONSENT_CANCEL: { target: "closed" }
1600
+ } },
1794
1601
  frontFinished: {
1795
1602
  entry: ["stopMediaRecording", "resetForBackCapture"],
1796
1603
  type: "parallel",
@@ -2079,6 +1886,10 @@ function mapState(snapshot) {
2079
1886
  canRetry: context.attemptsRemaining > 0
2080
1887
  };
2081
1888
  }
1889
+ if (snapshot.matches("mandatoryConsent")) return {
1890
+ status: "mandatoryConsent",
1891
+ regulationType: context.uploadResponse?.regulationType ?? "Other"
1892
+ };
2082
1893
  if (snapshot.matches("frontFinished")) return { status: "frontFinished" };
2083
1894
  if (snapshot.matches("backFinished")) return { status: "backFinished" };
2084
1895
  if (snapshot.matches("processing")) return { status: "processing" };
@@ -2090,7 +1901,9 @@ function mapState(snapshot) {
2090
1901
  };
2091
1902
  return { status: "idle" };
2092
1903
  }
2093
- function createApi({ actor, trackElementClicked }) {
1904
+ function createApi({ actor, trackElementClicked, trackCaptureAttemptFinished }) {
1905
+ const snapshot = actor.getSnapshot();
1906
+ if (snapshot.context.dependencies) snapshot.context.dependencies.trackCaptureAttemptFinished = trackCaptureAttemptFinished;
2094
1907
  return {
2095
1908
  load() {
2096
1909
  actor.send({ type: "LOAD" });
@@ -2153,6 +1966,14 @@ function createApi({ actor, trackElementClicked }) {
2153
1966
  trackElementClicked?.("skipBack");
2154
1967
  actor.send({ type: "SKIP_BACK" });
2155
1968
  },
1969
+ acceptMandatoryConsent() {
1970
+ trackElementClicked?.("acceptMandatoryConsent");
1971
+ actor.send({ type: "CONSENT_ACCEPT" });
1972
+ },
1973
+ cancelMandatoryConsent() {
1974
+ trackElementClicked?.("cancelMandatoryConsent");
1975
+ actor.send({ type: "CONSENT_CANCEL" });
1976
+ },
2156
1977
  updateDetectionArea(detectionArea) {
2157
1978
  actor.send({
2158
1979
  type: "UPDATE_DETECTION_AREA",
@@ -2170,6 +1991,7 @@ function getTopLevelStateValue(value) {
2170
1991
  const SIDE_AWARE_STATES = new Set([
2171
1992
  "tutorial",
2172
1993
  "capture",
1994
+ "mandatoryConsent",
2173
1995
  "frontFinished",
2174
1996
  "backFinished",
2175
1997
  "processing",
@@ -2218,4 +2040,4 @@ function createIdCaptureManagerFromActor(actor) {
2218
2040
  }
2219
2041
 
2220
2042
  //#endregion
2221
- export { resetSessionInit as _, initializeIdCapture as a, stopRecording as c, validateUploadResponse as d, ID_ERROR_CODES as f, isSessionInitialized as g, initializeSession as h, idCaptureMachine as i, stopStream as l, getSessionFeatures as m, createIdCaptureManagerFromActor as n, processId as o, getDisableIpify as p, createIdCaptureActor as r, startRecordingSession as s, createIdCaptureManager as t, uploadIdImage as u, createSession as v };
2043
+ export { initializeIdCapture as a, stopRecording as c, validateUploadResponse as d, ID_ERROR_CODES as f, idCaptureMachine as i, stopStream as l, createIdCaptureManagerFromActor as n, processId as o, createIdCaptureActor as r, startRecordingSession as s, createIdCaptureManager as t, uploadIdImage as u };
@@ -1,9 +1,9 @@
1
- import { a as IStorageCapability, c as IMotionSensorCapability, d as IncodeCanvas, i as StreamCanvasCapture, l as IMLProviderCapability, n as PermissionResult, o as IRecordingCapability, r as PermissionStatus, s as RecordingConnection, t as DeepsightService, u as MLProviderConfig } from "./deepsightService-CdGGD_BP.js";
2
- import { t as Manager } from "./Manager-CVDYGoSq.js";
3
- import { t as CameraStream } from "./camera-CVBwqx-j.js";
4
- import { t as ActorRefFrom } from "./Actor-D6rhGxJy.js";
5
- import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-BqtRw_hz.js";
6
- import { i as TutorialIdConfig, t as Flow } from "./types-DSJflCEU.js";
1
+ import { a as IStorageCapability, c as IMotionSensorCapability, d as IncodeCanvas, i as StreamCanvasCapture, l as IMLProviderCapability, n as PermissionResult, o as IRecordingCapability, r as PermissionStatus, s as RecordingConnection, t as DeepsightService, u as MLProviderConfig } from "./deepsightService-C47Uyf6m.js";
2
+ import { t as Manager } from "./Manager-BWqHEUjI.js";
3
+ import { t as CameraStream } from "./camera-BCRgkMoe.js";
4
+ import { t as ActorRefFrom } from "./Actor-By8WNHi-.js";
5
+ import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-dxjI9q0V.js";
6
+ import { a as TutorialIdConfig, i as RegulationTypes, t as Flow } from "./types-0A1THNYO.js";
7
7
 
8
8
  //#region ../infra/src/capabilities/IAnalyticsCapability.d.ts
9
9
  interface IAnalyticsCapability {
@@ -170,7 +170,7 @@ type IdCaptureMode = 'front' | 'back' | 'passport';
170
170
  * Used for selection and for the list of available options derived from config.
171
171
  */
172
172
  type IdDocumentType = 'id' | 'passport' | 'manualIdUpload' | 'digitalIdUpload' | 'digitalId';
173
- type IdFlowStep = 'chooser' | 'tutorial' | 'permissions' | 'capture' | 'frontFinished' | 'backFinished' | 'success' | 'processing' | 'expired' | 'finished' | 'error' | 'closed' | 'manualIdUpload' | 'digitalIdUpload';
173
+ type IdFlowStep = 'chooser' | 'tutorial' | 'permissions' | 'capture' | 'mandatoryConsent' | 'frontFinished' | 'backFinished' | 'success' | 'processing' | 'expired' | 'finished' | 'error' | 'closed' | 'manualIdUpload' | 'digitalIdUpload';
174
174
  type DetectionStatus = 'idle' | 'detecting' | 'farAway' | 'blur' | 'glare' | 'wrongSide' | 'capturing' | 'manualCapture' | 'idNotDetected' | 'offline';
175
175
  /**
176
176
  * Represents the detection area dimensions in pixels.
@@ -253,6 +253,8 @@ type UploadIdResponse = {
253
253
  name: string;
254
254
  }>;
255
255
  forceFrontIdCapture?: boolean;
256
+ showMandatoryConsent?: boolean;
257
+ regulationType?: RegulationTypes;
256
258
  failReason?: string;
257
259
  side?: 'front' | 'back';
258
260
  };
@@ -400,6 +402,10 @@ type IdCaptureEvent = {
400
402
  type: 'PROCESS_COMPLETE';
401
403
  } | {
402
404
  type: 'PROCESS_EXPIRED';
405
+ } | {
406
+ type: 'CONSENT_ACCEPT';
407
+ } | {
408
+ type: 'CONSENT_CANCEL';
403
409
  } | {
404
410
  type: 'SKIP_BACK';
405
411
  } | {
@@ -427,6 +433,9 @@ type IdCaptureEvent = {
427
433
  };
428
434
  type IdCaptureDependencies = {
429
435
  storage: IStorageCapability;
436
+ trackCaptureAttemptFinished?: (payload: {
437
+ logs: string;
438
+ }) => void;
430
439
  };
431
440
  type IdCaptureInput = {
432
441
  config: IdCaptureConfig;
@@ -547,6 +556,10 @@ type IdCaptureCaptureState = {
547
556
  /** Whether retry is available (attemptsRemaining > 0) */
548
557
  canRetry: boolean;
549
558
  };
559
+ type IdCaptureMandatoryConsentState = {
560
+ status: 'mandatoryConsent';
561
+ regulationType: RegulationTypes;
562
+ };
550
563
  type IdCaptureFrontFinishedState = {
551
564
  status: 'frontFinished';
552
565
  };
@@ -569,7 +582,7 @@ type IdCaptureErrorState = {
569
582
  status: 'error';
570
583
  error: string;
571
584
  };
572
- type IdCaptureState = IdCaptureIdleState | IdCaptureChooserState | IdCaptureLoadingState | IdCaptureTutorialState | IdCapturePermissionsState | IdCaptureCaptureState | IdCaptureFrontFinishedState | IdCaptureBackFinishedState | IdCaptureProcessingState | IdCaptureExpiredState | IdCaptureFinishedState | IdCaptureClosedState | IdCaptureErrorState;
585
+ type IdCaptureState = IdCaptureIdleState | IdCaptureChooserState | IdCaptureLoadingState | IdCaptureTutorialState | IdCapturePermissionsState | IdCaptureCaptureState | IdCaptureMandatoryConsentState | IdCaptureFrontFinishedState | IdCaptureBackFinishedState | IdCaptureProcessingState | IdCaptureExpiredState | IdCaptureFinishedState | IdCaptureClosedState | IdCaptureErrorState;
573
586
  declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): Manager<IdCaptureState> & {
574
587
  load(): void;
575
588
  selectDocument(documentType: IdDocumentType): void;
@@ -586,6 +599,8 @@ declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): M
586
599
  continueToBack(): void;
587
600
  continueToFront(): void;
588
601
  skipBack(): void;
602
+ acceptMandatoryConsent(): void;
603
+ cancelMandatoryConsent(): void;
589
604
  /**
590
605
  * Updates the detection area used for WASM geometry calculation.
591
606
  * Call this when the UI detection area dimensions change (e.g., on resize or orientation change).
@@ -609,6 +624,8 @@ declare function createIdCaptureManagerFromActor(actor: IdCaptureActor): Manager
609
624
  continueToBack(): void;
610
625
  continueToFront(): void;
611
626
  skipBack(): void;
627
+ acceptMandatoryConsent(): void;
628
+ cancelMandatoryConsent(): void;
612
629
  /**
613
630
  * Updates the detection area used for WASM geometry calculation.
614
631
  * Call this when the UI detection area dimensions change (e.g., on resize or orientation change).
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { A as IdCaptureEvent, B as UploadIdResponse, C as CapturedImage, D as IdCaptureConfig, E as ID_ERROR_CODES, F as IdDocumentType, H as IdCaptureSettings, I as IdError, L as IdErrorCode, M as IdCaptureInput, N as IdCaptureMode, O as IdCaptureContext, P as IdCaptureThresholds, R as IdFlowStep, S as CaptureIdResponse, T as DetectionStatus, V as DetectionOrientation, _ as CreateIdCaptureActorOptions, a as IdCaptureInitResult, b as IdCaptureMachine, c as UploadIdImageParams, d as processId, f as startRecordingSession, g as validateUploadResponse, h as uploadIdImage, j as IdCaptureGeometry, k as IdCaptureDependencies, l as ValidationError, m as stopStream, n as IdCaptureState, o as InitializeIdCaptureParams, p as stopRecording, r as createIdCaptureManager, s as StartRecordingParams, t as IdCaptureManager, u as initializeIdCapture, v as IdCaptureActor, w as DetectionArea, x as idCaptureMachine, y as createIdCaptureActor, z as RecordingSession } from "./idCaptureManager-DCXMoCXo.js";
2
- import { n as PermissionResult, r as PermissionStatus } from "./deepsightService-CdGGD_BP.js";
3
- import { n as WasmPipeline, r as warmupWasm, t as WarmupConfig } from "./warmup-DoQLFT3z.js";
4
- import "./Manager-CVDYGoSq.js";
5
- import { t as CameraStream } from "./camera-CVBwqx-j.js";
6
- import "./Actor-D6rhGxJy.js";
7
- import "./StateMachine-BqtRw_hz.js";
8
- import "./types-CHzupruc.js";
9
- import "./types-DSJflCEU.js";
10
- import "./index-LKrIp3Oo.js";
1
+ import { A as IdCaptureEvent, B as UploadIdResponse, C as CapturedImage, D as IdCaptureConfig, E as ID_ERROR_CODES, F as IdDocumentType, H as IdCaptureSettings, I as IdError, L as IdErrorCode, M as IdCaptureInput, N as IdCaptureMode, O as IdCaptureContext, P as IdCaptureThresholds, R as IdFlowStep, S as CaptureIdResponse, T as DetectionStatus, V as DetectionOrientation, _ as CreateIdCaptureActorOptions, a as IdCaptureInitResult, b as IdCaptureMachine, c as UploadIdImageParams, d as processId, f as startRecordingSession, g as validateUploadResponse, h as uploadIdImage, j as IdCaptureGeometry, k as IdCaptureDependencies, l as ValidationError, m as stopStream, n as IdCaptureState, o as InitializeIdCaptureParams, p as stopRecording, r as createIdCaptureManager, s as StartRecordingParams, t as IdCaptureManager, u as initializeIdCapture, v as IdCaptureActor, w as DetectionArea, x as idCaptureMachine, y as createIdCaptureActor, z as RecordingSession } from "./idCaptureManager-Dn7_eHt9.js";
2
+ import { n as PermissionResult, r as PermissionStatus } from "./deepsightService-C47Uyf6m.js";
3
+ import { n as WasmPipeline, r as warmupWasm, t as WarmupConfig } from "./warmup-B_dntecl.js";
4
+ import "./Manager-BWqHEUjI.js";
5
+ import { t as CameraStream } from "./camera-BCRgkMoe.js";
6
+ import "./Actor-By8WNHi-.js";
7
+ import "./StateMachine-dxjI9q0V.js";
8
+ import "./types-BYFeUhw0.js";
9
+ import { i as RegulationTypes } from "./types-0A1THNYO.js";
10
+ import "./index-DGdyPh8A.js";
11
11
 
12
12
  //#region ../infra/src/capabilities/IScreenOrientationCapability.d.ts
13
13
  type ScreenOrientationState = 'portrait' | 'landscape';
@@ -189,6 +189,14 @@ type Features = {
189
189
  sessionIdentifier: string;
190
190
  };
191
191
  //#endregion
192
+ //#region src/internal/fingerprint/types.d.ts
193
+ type DeviceFingerprintResult = {
194
+ success: boolean;
195
+ sessionStatus: string;
196
+ showMandatoryConsent?: boolean;
197
+ regulationType?: RegulationTypes;
198
+ };
199
+ //#endregion
192
200
  //#region src/internal/session/sessionInitializer.d.ts
193
201
  type SessionInitOptions = {
194
202
  /** Custom hosting app name for fingerprint */
@@ -200,6 +208,7 @@ type SessionInitResult = {
200
208
  features: Features;
201
209
  disableIpify: boolean;
202
210
  fingerprintSuccess: boolean;
211
+ fingerprintResult: DeviceFingerprintResult | undefined;
203
212
  };
204
213
  /**
205
214
  * Initializes session-level services after the token is set.
@@ -575,11 +584,15 @@ type ElementClickedPayload = {
575
584
  action?: string;
576
585
  metadata?: Record<string, unknown>;
577
586
  };
587
+ type CaptureAttemptFinishedPayload = {
588
+ logs: string;
589
+ };
578
590
  declare function screenEvent(params: ScreenEventParams): void;
579
591
  declare function moduleOpened(module: EventModule | string, screen?: EventScreen | string, payload?: Record<string, unknown>): void;
580
592
  declare function moduleClosed(module: EventModule | string, screen?: EventScreen | string, payload?: Record<string, unknown>): void;
581
593
  declare function screenOpened(module: EventModule | string, screen: EventScreen | string, payload?: Record<string, unknown>): void;
582
594
  declare function screenClosed(module: EventModule | string, screen: EventScreen | string, payload?: Record<string, unknown>): void;
583
595
  declare function elementClicked(module: EventModule | string, screen: EventScreen | string | undefined, payload: ElementClickedPayload): void;
596
+ declare function captureAttemptFinished(module: EventModule | string, screen: EventScreen | string | undefined, payload: CaptureAttemptFinishedPayload): void;
584
597
  //#endregion
585
- export { type Browser, CameraStream, CaptureIdResponse, CapturedImage, CreateIdCaptureActorOptions, type CreateSessionOptions, DEFAULT_WASM_VERSION, DetectionArea, DetectionOrientation, DetectionStatus, type DeviceClass, type ElementClickedPayload, type Event, type EventModule, type EventScreen, type HttpClient, ID_ERROR_CODES, IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureDependencies, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, IdCaptureMachine, IdCaptureManager, IdCaptureMode, IdCaptureSettings, IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, type PermissionResult, type PermissionStatus, RecordingSession, type ScreenOrientationObserver, ScreenOrientationProvider, type Session, type SessionInitOptions, type SessionInitResult, type SetupOptions, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, type WasmConfig, type WasmPipeline, addEvent, api, buildDefaultWasmConfig, cameraScreenNamesMapper, checkPermission as checkCameraPermission, createApi, createIdCaptureActor, createIdCaptureManager, createScreenOrientationObserver, createSession, elementClicked, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, getDisableIpify, getSessionFeatures, idCaptureMachine, initializeIdCapture, initializeSession, initializeWasmUtil, isConfigured, isIPad, isSessionInitialized, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, resetSessionInit, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
598
+ export { type Browser, CameraStream, type CaptureAttemptFinishedPayload, CaptureIdResponse, CapturedImage, CreateIdCaptureActorOptions, type CreateSessionOptions, DEFAULT_WASM_VERSION, DetectionArea, DetectionOrientation, DetectionStatus, type DeviceClass, type ElementClickedPayload, type Event, type EventModule, type EventScreen, type HttpClient, ID_ERROR_CODES, IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureDependencies, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, IdCaptureMachine, IdCaptureManager, IdCaptureMode, IdCaptureSettings, IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, type PermissionResult, type PermissionStatus, RecordingSession, type ScreenOrientationObserver, ScreenOrientationProvider, type Session, type SessionInitOptions, type SessionInitResult, type SetupOptions, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, type WasmConfig, type WasmPipeline, addEvent, api, buildDefaultWasmConfig, cameraScreenNamesMapper, captureAttemptFinished, checkPermission as checkCameraPermission, createApi, createIdCaptureActor, createIdCaptureManager, createScreenOrientationObserver, createSession, elementClicked, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, getDisableIpify, getSessionFeatures, idCaptureMachine, initializeIdCapture, initializeSession, initializeWasmUtil, isConfigured, isIPad, isSessionInitialized, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, resetSessionInit, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
package/dist/index.esm.js CHANGED
@@ -1,13 +1,15 @@
1
- import { a as videoSelfieEvents, c as elementClicked, d as screenClosed, f as screenEvent, g as subscribeEvent, h as flushEventQueue, i as tutorialScreenNamesMapper, l as moduleClosed, m as addEvent, n as eventModuleNames, p as screenOpened, r as eventScreenNames, t as cameraScreenNamesMapper, u as moduleOpened } from "./events-c-r7jhs3.esm.js";
2
- import "./backCameraStream-BxXYKUoc.esm.js";
3
- import { R as isIPad, a as WasmUtilProvider, c as warmupWasm, j as createApi_default, n as buildDefaultWasmConfig, t as DEFAULT_WASM_VERSION, u as ScreenOrientationProvider } from "./src-DevpZoey.esm.js";
4
- import { a as checkPermission, c as getDeviceClass, l as getBrowser, o as requestPermission, s as createScreenOrientationObserver } from "./recordingsRepository-CIzyj6XC.esm.js";
5
- import "./deepsightService-tFm-XfrF.esm.js";
6
- import { a as resetApi, n as getApi, o as setClient, s as setToken, t as api } from "./api-3fZO5bmj.esm.js";
7
- import "./endpoints-Bydn-Ave.esm.js";
8
- import { _ as resetSessionInit, a as initializeIdCapture, c as stopRecording, d as validateUploadResponse, f as ID_ERROR_CODES, g as isSessionInitialized, h as initializeSession, i as idCaptureMachine, l as stopStream, m as getSessionFeatures, o as processId, p as getDisableIpify, r as createIdCaptureActor, s as startRecordingSession, t as createIdCaptureManager, u as uploadIdImage, v as createSession } from "./idCaptureManager-Dkzxvhrt.esm.js";
9
- import "./stats-D76Thmqp.esm.js";
10
- import "./id-r_CoQ3r-.esm.js";
1
+ import { _ as subscribeEvent, a as videoSelfieEvents, c as captureAttemptFinished, d as moduleOpened, f as screenClosed, g as flushEventQueue, h as addEvent, i as tutorialScreenNamesMapper, l as elementClicked, m as screenOpened, n as eventModuleNames, p as screenEvent, r as eventScreenNames, t as cameraScreenNamesMapper, u as moduleClosed } from "./events-CbNkXF2Q.esm.js";
2
+ import "./backCameraStream-BPzo60FO.esm.js";
3
+ import { R as isIPad, a as WasmUtilProvider, c as warmupWasm, j as createApi_default, n as buildDefaultWasmConfig, t as DEFAULT_WASM_VERSION, u as ScreenOrientationProvider } from "./src-BX-m0lbm.esm.js";
4
+ import { a as checkPermission, c as getDeviceClass, l as getBrowser, o as requestPermission, s as createScreenOrientationObserver } from "./recordingsRepository-DGWSMj-_.esm.js";
5
+ import "./browserSimulation-DYAk0Ipe.esm.js";
6
+ import { a as resetApi, n as getApi, o as setClient, s as setToken, t as api } from "./api-C2uzxrpN.esm.js";
7
+ import "./endpoints-b2PxFIku.esm.js";
8
+ import { a as isSessionInitialized, i as initializeSession, n as getSessionFeatures, o as resetSessionInit, s as createSession, t as getDisableIpify } from "./session-4QVMNIs5.esm.js";
9
+ import { a as initializeIdCapture, c as stopRecording, d as validateUploadResponse, f as ID_ERROR_CODES, i as idCaptureMachine, l as stopStream, o as processId, r as createIdCaptureActor, s as startRecordingSession, t as createIdCaptureManager, u as uploadIdImage } from "./idCaptureManager-BniIgM20.esm.js";
10
+ import "./deepsightService-BcdwWkYD.esm.js";
11
+ import "./stats-BaWAv541.esm.js";
12
+ import "./id-C3aKMJhc.esm.js";
11
13
 
12
14
  //#region src/setup.ts
13
15
  let wasmConfig;
@@ -120,4 +122,4 @@ function reset() {
120
122
  }
121
123
 
122
124
  //#endregion
123
- export { DEFAULT_WASM_VERSION, ID_ERROR_CODES, ScreenOrientationProvider, addEvent, api, buildDefaultWasmConfig, cameraScreenNamesMapper, checkPermission as checkCameraPermission, createApi_default as createApi, createIdCaptureActor, createIdCaptureManager, createScreenOrientationObserver, createSession, elementClicked, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, getDisableIpify, getSessionFeatures, idCaptureMachine, initializeIdCapture, initializeSession, initializeWasmUtil, isConfigured, isIPad, isSessionInitialized, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, resetSessionInit, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
125
+ export { DEFAULT_WASM_VERSION, ID_ERROR_CODES, ScreenOrientationProvider, addEvent, api, buildDefaultWasmConfig, cameraScreenNamesMapper, captureAttemptFinished, checkPermission as checkCameraPermission, createApi_default as createApi, createIdCaptureActor, createIdCaptureManager, createScreenOrientationObserver, createSession, elementClicked, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, getDisableIpify, getSessionFeatures, idCaptureMachine, initializeIdCapture, initializeSession, initializeWasmUtil, isConfigured, isIPad, isSessionInitialized, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, resetSessionInit, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
@@ -1,4 +1,4 @@
1
- import { i as __toCommonJS, n as __esm, r as __export, t as __commonJS } from "./chunk-C24vxluH.esm.js";
1
+ import { i as __toCommonJS, n as __esm, r as __export, t as __commonJS } from "./chunk-NXK2ElUW.esm.js";
2
2
 
3
3
  //#region ../../node_modules/.pnpm/jsnlog@2.30.0/node_modules/jsnlog/jsnlog.js
4
4
  var require_jsnlog = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jsnlog@2.30.0/node_modules/jsnlog/jsnlog.js": ((exports) => {