@incodetech/core 0.0.0-dev-20260402-682edb5 → 0.0.0-dev-20260402-7cf9db4

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 (91) hide show
  1. package/dist/Actor-phIcsUhv.d.ts +2 -0
  2. package/dist/BaseWasmProvider-BFXU7jj8.esm.js +1536 -0
  3. package/dist/BrowserEnvironmentProvider-DApG6lNu.esm.js +89 -0
  4. package/dist/BrowserTimerProvider-CRhCvln7.esm.js +22 -0
  5. package/dist/Manager-BndLda4_.d.ts +19 -0
  6. package/dist/{events-Cc1xUUgF.esm.js → Manager-D_DMzMWz.esm.js} +114 -11
  7. package/dist/{warmup-CzfSiaMj.d.ts → StateMachine-CGAi8x_b.d.ts} +4 -1
  8. package/dist/StreamCanvasCapture-9VAzOfOv.esm.js +410 -0
  9. package/dist/WasmUtilProvider-DctESPCy.esm.js +114 -0
  10. package/dist/{addressSearch-DzOdaNEA.esm.js → addressSearch-CYGzuJJ3.esm.js} +3 -3
  11. package/dist/authentication.d.ts +9 -7
  12. package/dist/authentication.esm.js +12 -10
  13. package/dist/{authenticationManager-TaI12wf3.d.ts → authenticationManager-B5Yv9bDw.d.ts} +2 -2
  14. package/dist/{authenticationManager-CBSPCdJc.esm.js → authenticationManager-C9iQ1d2a.esm.js} +5 -5
  15. package/dist/{backCameraStream-BGAbuvw1.esm.js → backCameraStream-BJwEXNl4.esm.js} +2 -1
  16. package/dist/camera-D-MPXRbZ.esm.js +22 -0
  17. package/dist/camera-Dv2WEhGe.d.ts +4 -0
  18. package/dist/consent.d.ts +55 -54
  19. package/dist/consent.esm.js +2 -3
  20. package/dist/curp-validation.d.ts +5 -3
  21. package/dist/curp-validation.esm.js +2 -3
  22. package/dist/deepsightLoader-D2MKmB5z.esm.js +48 -0
  23. package/dist/{deepsightService-DxA--87N.d.ts → deepsightService-CWnhwXLw.d.ts} +223 -17
  24. package/dist/document-capture.d.ts +58 -56
  25. package/dist/document-capture.esm.js +5 -4
  26. package/dist/document-upload.d.ts +47 -45
  27. package/dist/document-upload.esm.js +5 -4
  28. package/dist/ekyb.d.ts +3 -2
  29. package/dist/ekyb.esm.js +8 -7
  30. package/dist/ekyc.d.ts +3 -2
  31. package/dist/ekyc.esm.js +133 -123
  32. package/dist/email.d.ts +3 -2
  33. package/dist/email.esm.js +4 -4
  34. package/dist/{emailManager-DN_q_zxy.d.ts → emailManager-BIq6pJa8.d.ts} +11 -4
  35. package/dist/{emailManager-DSR9gQLX.esm.js → emailManager-C5GCSw78.esm.js} +43 -23
  36. package/dist/extensibility.d.ts +45 -43
  37. package/dist/extensibility.esm.js +26 -15
  38. package/dist/face-match.d.ts +1 -1
  39. package/dist/face-match.esm.js +2 -3
  40. package/dist/{faceCaptureManagerFactory-CGpkO_S3.d.ts → faceCaptureManagerFactory-CN5-GRxP.d.ts} +89 -142
  41. package/dist/{faceCaptureSetup-Rr7LUbBm.esm.js → faceCaptureSetup-DYRykM5Y.esm.js} +413 -7
  42. package/dist/flow.d.ts +6 -5
  43. package/dist/flow.esm.js +7 -7
  44. package/dist/{flowCompletionService-Bkaerugt.esm.js → flowCompletionService-CBvXiMKa.esm.js} +1 -1
  45. package/dist/{flowServices-Bt6lMLUI.esm.js → flowServices-CQ3rTJLE.esm.js} +2 -2
  46. package/dist/geolocation.d.ts +2 -1
  47. package/dist/geolocation.esm.js +16 -3
  48. package/dist/government-validation.d.ts +2 -1
  49. package/dist/government-validation.esm.js +3 -3
  50. package/dist/id.d.ts +9 -6
  51. package/dist/id.esm.js +14 -11
  52. package/dist/{idCaptureManager-Dc2NJMy_.d.ts → idCaptureManager-B1RWflj0.d.ts} +15 -12
  53. package/dist/{idCaptureManager-QyM4nIKM.esm.js → idCaptureManager-D5rjCu9r.esm.js} +178 -8
  54. package/dist/index.d.ts +68 -21
  55. package/dist/index.esm.js +440 -11
  56. package/dist/mandatory-consent.d.ts +58 -56
  57. package/dist/mandatory-consent.esm.js +2 -3
  58. package/dist/phone.d.ts +3 -2
  59. package/dist/phone.esm.js +4 -4
  60. package/dist/{phoneManager-D2A0hXXq.d.ts → phoneManager-Ba66ysK2.d.ts} +9 -2
  61. package/dist/{phoneManager-D2nZtu-b.esm.js → phoneManager-CQJim-Ky.esm.js} +32 -21
  62. package/dist/platform-B3nGssGZ.esm.js +83 -0
  63. package/dist/redirect-to-mobile.d.ts +2 -1
  64. package/dist/redirect-to-mobile.esm.js +3 -3
  65. package/dist/selfie.d.ts +9 -7
  66. package/dist/selfie.esm.js +12 -10
  67. package/dist/{selfieManager-B4Nnp7ws.d.ts → selfieManager-BnfnTPcx.d.ts} +2 -2
  68. package/dist/{selfieManager-CvE35L72.esm.js → selfieManager-DYW1C2GP.esm.js} +4 -3
  69. package/dist/session-TBPhHmyy.esm.js +3130 -0
  70. package/dist/session.d.ts +1 -1
  71. package/dist/session.esm.js +2 -2
  72. package/dist/signature.d.ts +3 -3
  73. package/dist/signature.esm.js +3 -4
  74. package/dist/{stats-D0m3TvIg.esm.js → stats-D4C7iDy1.esm.js} +1 -1
  75. package/dist/stats.esm.js +2 -2
  76. package/dist/{types-oveF7RrS.d.ts → types-BWGxcjiZ.d.ts} +1 -1
  77. package/dist/{types-mQLzH6uw.d.ts → types-BX1ZlbSR.d.ts} +1 -1
  78. package/package.json +1 -1
  79. package/dist/deepsightLoader-B93Oa9pS.esm.js +0 -24
  80. package/dist/deepsightService-CLUMQ5ee.esm.js +0 -235
  81. package/dist/index-BTaLQSj9.d.ts +0 -219
  82. package/dist/recordingsRepository-Djt_In2b.esm.js +0 -122
  83. package/dist/session-CUy9-Yzi.esm.js +0 -250
  84. package/dist/src-8rn6DoH7.esm.js +0 -6554
  85. /package/dist/{api-G4JA8CXK.esm.js → api-3fZO5bmj.esm.js} +0 -0
  86. /package/dist/{browserSimulation-C8gNnn5p.esm.js → browserSimulation-zWJAZ1vA.esm.js} +0 -0
  87. /package/dist/{displayErrors-BgtBHbfb.d.ts → displayErrors-DzzB3fcR.d.ts} +0 -0
  88. /package/dist/{flowCompletionService-De8JDo87.d.ts → flowCompletionService-C_CShl_d.d.ts} +0 -0
  89. /package/dist/{id-B30uqGbp.esm.js → id-Dv0it9CY.esm.js} +0 -0
  90. /package/dist/{index-LKrIp3Oo.d.ts → index-CuY8tqBC.d.ts} +0 -0
  91. /package/dist/{lib-qeMam2F_.esm.js → lib-B5byelWf.esm.js} +0 -0
@@ -1,250 +0,0 @@
1
- import { h as addEvent } from "./events-Cc1xUUgF.esm.js";
2
- import { _ as FingerprintProvider, b as BrowserInfoProvider, g as IpifyProvider, x as BrowserEnvironmentProvider } from "./src-8rn6DoH7.esm.js";
3
- import { t as isBrowserSimulation } from "./browserSimulation-C8gNnn5p.esm.js";
4
- import { n as getApi, t as api } from "./api-G4JA8CXK.esm.js";
5
- import { t as endpoints } from "./endpoints-CCuj1KZH.esm.js";
6
-
7
- //#region src/internal/session/sessionService.ts
8
- /**
9
- * Creates a new onboarding session.
10
- *
11
- * @param apiKey - The API key from the Incode dashboard
12
- * @param options - Session creation options
13
- * @param signal - Optional AbortSignal for request cancellation
14
- * @returns The created session with token
15
- *
16
- * @example
17
- * ```ts
18
- * const session = await createSession('your-api-key', {
19
- * configurationId: 'your-flow-id',
20
- * language: 'en-US',
21
- * });
22
- * console.log(session.token); // Use this token for subsequent API calls
23
- * ```
24
- */
25
- async function createSession(apiKey, options, signal) {
26
- const res = await getApi().post(endpoints.createSession, {
27
- configurationId: options.configurationId,
28
- externalId: options.externalId,
29
- externalCustomerId: options.externalCustomerId,
30
- language: options.language ?? "en-US",
31
- customFields: options.customFields,
32
- uuid: options.uuid ?? null,
33
- interviewId: options.interviewId ?? null
34
- }, {
35
- headers: {
36
- "x-api-key": apiKey,
37
- "api-version": "1.0"
38
- },
39
- signal
40
- });
41
- if (!res.ok) throw new Error(`POST ${endpoints.createSession} failed: ${res.status} ${res.statusText}`);
42
- return res.data;
43
- }
44
-
45
- //#endregion
46
- //#region src/internal/featureConfig/featureConfigService.ts
47
- let cachedFeatures$1 = null;
48
- /**
49
- * Checks if a feature is enabled in the feature config.
50
- */
51
- function isFeatureEnabled(feature, features) {
52
- return features?.find((f) => f.feature === feature)?.enabled ?? false;
53
- }
54
- /**
55
- * Fetches feature configuration from the backend.
56
- * Results are cached for the session lifetime.
57
- */
58
- async function fetchFeatureConfig(signal) {
59
- if (cachedFeatures$1) return cachedFeatures$1;
60
- const response = await api.get(endpoints.featureConfig, { signal });
61
- if (!response.ok) throw new Error(`Failed to fetch feature config: ${response.status} ${response.statusText}`);
62
- cachedFeatures$1 = response.data;
63
- return cachedFeatures$1;
64
- }
65
- /**
66
- * Resets the cached feature config (useful for testing).
67
- */
68
- function resetFeatureConfigCache() {
69
- cachedFeatures$1 = null;
70
- }
71
-
72
- //#endregion
73
- //#region src/internal/fingerprint/fingerprintApi.ts
74
- async function getFingerprint(disableIpify) {
75
- const shouldDisableIpify = disableIpify ?? getDisableIpify();
76
- return new FingerprintProvider(new IpifyProvider()).getFingerprint(shouldDisableIpify);
77
- }
78
-
79
- //#endregion
80
- //#region src/internal/fingerprint/fingerprintService.ts
81
- const SDK_VERSION = "2.0.0";
82
- function formatOsVersion(os) {
83
- return `${os.name || "Unknown"} ${os.version || ""}`.trim();
84
- }
85
- function formatBrowser(browser) {
86
- if (!browser.name || !browser.version) return "Unknown";
87
- return `${browser.name} ${browser.version}`;
88
- }
89
- async function submitDeviceFingerprint(options = {}, dependencies) {
90
- const { disableIpify = false, hostingApp, signal } = options;
91
- const fingerprint = await dependencies.fingerprintProvider.getFingerprint(disableIpify);
92
- const hasLiedBrowser = isBrowserSimulation(dependencies.browserEnv);
93
- const payload = {
94
- hash: fingerprint.visitorId || "",
95
- ip: fingerprint.ip || "",
96
- deviceType: "WEBAPP",
97
- data: JSON.stringify(fingerprint),
98
- osVersion: formatOsVersion(fingerprint.deviceInfo.os),
99
- deviceModel: fingerprint.deviceInfo.device.model || "",
100
- browser: formatBrowser(fingerprint.deviceInfo.browser),
101
- hasLiedBrowser,
102
- sdkVersion: SDK_VERSION,
103
- hostingApp: hostingApp ?? "Web SDK"
104
- };
105
- const response = await api.post(endpoints.deviceFingerprint, payload, { signal });
106
- if (!response.ok) throw new Error(`Failed to submit fingerprint: ${response.status} ${response.statusText}`);
107
- return response.data;
108
- }
109
-
110
- //#endregion
111
- //#region src/internal/session/sessionInitializer.ts
112
- let sessionInitialized = false;
113
- let cachedFeatures = null;
114
- let cachedDisableIpify = false;
115
- let cachedFingerprintSuccess = false;
116
- let cachedFingerprintResult;
117
- let sessionInitPromise = null;
118
- /**
119
- * Initializes session-level services after the token is set.
120
- * This should be called once after createSession() or setToken().
121
- *
122
- * Performs:
123
- * 1. Fetches feature configuration from backend
124
- * 2. Submits device fingerprint
125
- *
126
- * Results are cached for the session lifetime.
127
- *
128
- * @param options - Optional configuration
129
- * @returns Session initialization result with feature config
130
- *
131
- * @example
132
- * ```ts
133
- * // After creating a session
134
- * const session = await createSession('api-key', options);
135
- * setup({ apiURL, token: session.token });
136
- * const { features } = await initializeSession();
137
- *
138
- * // Check feature flags
139
- * if (isFeatureEnabled('DISABLE_IPIFY', features.features)) {
140
- * // Handle disabled ipify
141
- * }
142
- * ```
143
- */
144
- async function initializeSession(options = {}) {
145
- const { hostingApp, signal } = options;
146
- if (sessionInitialized && cachedFeatures) return {
147
- features: cachedFeatures,
148
- disableIpify: cachedDisableIpify,
149
- fingerprintSuccess: cachedFingerprintSuccess,
150
- fingerprintResult: cachedFingerprintResult
151
- };
152
- if (sessionInitPromise) return sessionInitPromise;
153
- sessionInitPromise = (async () => {
154
- let features;
155
- let disableIpify = false;
156
- try {
157
- features = await fetchFeatureConfig(signal);
158
- disableIpify = isFeatureEnabled("DISABLE_IPIFY", features.features);
159
- } catch {
160
- features = { sessionIdentifier: "" };
161
- }
162
- let fingerprintSuccess = false;
163
- let fingerprintResult;
164
- try {
165
- const fingerprintProvider = new FingerprintProvider(new IpifyProvider());
166
- const browserEnv = new BrowserEnvironmentProvider();
167
- fingerprintResult = await submitDeviceFingerprint({
168
- disableIpify,
169
- hostingApp,
170
- signal
171
- }, {
172
- fingerprintProvider,
173
- browserEnv
174
- });
175
- fingerprintSuccess = true;
176
- } catch (error) {
177
- console.warn("Failed to submit device fingerprint:", error);
178
- }
179
- try {
180
- const browserInfo = new BrowserInfoProvider().getBrowserInfo();
181
- addEvent({
182
- code: "browser",
183
- payload: {
184
- userAgent: browserInfo.userAgent,
185
- isWebRtcSupported: browserInfo.isWebRtcSupported,
186
- browser: browserInfo.browser,
187
- os: browserInfo.os,
188
- device: browserInfo.device,
189
- engine: browserInfo.engine,
190
- cpu: browserInfo.cpu
191
- }
192
- });
193
- } catch (error) {
194
- console.warn("Failed to send browser info event:", error);
195
- }
196
- sessionInitialized = true;
197
- cachedFeatures = features;
198
- cachedDisableIpify = disableIpify;
199
- cachedFingerprintSuccess = fingerprintSuccess;
200
- cachedFingerprintResult = fingerprintResult;
201
- return {
202
- features,
203
- disableIpify,
204
- fingerprintSuccess,
205
- fingerprintResult
206
- };
207
- })().finally(() => {
208
- sessionInitPromise = null;
209
- });
210
- return sessionInitPromise;
211
- }
212
- /**
213
- * Gets the cached feature configuration.
214
- * Returns undefined if session hasn't been initialized.
215
- */
216
- function getSessionFeatures() {
217
- return cachedFeatures ?? void 0;
218
- }
219
- /**
220
- * Gets the cached disableIpify flag.
221
- * Returns false if session hasn't been initialized.
222
- */
223
- function getDisableIpify() {
224
- return cachedDisableIpify;
225
- }
226
- function getSessionFingerprintResult() {
227
- return cachedFingerprintResult;
228
- }
229
- /**
230
- * Checks if the session has been initialized.
231
- */
232
- function isSessionInitialized() {
233
- return sessionInitialized;
234
- }
235
- /**
236
- * Resets session initialization state.
237
- * Useful for testing or when starting a new session.
238
- */
239
- function resetSessionInit() {
240
- sessionInitialized = false;
241
- cachedFeatures = null;
242
- cachedDisableIpify = false;
243
- cachedFingerprintSuccess = false;
244
- cachedFingerprintResult = void 0;
245
- sessionInitPromise = null;
246
- resetFeatureConfigCache();
247
- }
248
-
249
- //#endregion
250
- export { isSessionInitialized as a, createSession as c, initializeSession as i, getSessionFeatures as n, resetSessionInit as o, getSessionFingerprintResult as r, getFingerprint as s, getDisableIpify as t };