@incodetech/core 0.0.0-dev-20260403-eccc51c → 0.0.0-dev-20260407-4677d7f
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/dist/{BaseWasmProvider--AzPfwOm.esm.js → BaseWasmProvider-CQgeReKV.esm.js} +1 -785
- package/dist/MotionSensorProvider-BTDLt08l.esm.js +254 -0
- package/dist/StateMachine-8d441d6x.d.ts +2 -0
- package/dist/{WasmUtilProvider-BonqBWdj.esm.js → WasmUtilProvider-C45HStLj.esm.js} +1 -1
- package/dist/{addressSearch-DC5By0cC.esm.js → addressSearch-C5qzDvkN.esm.js} +15 -8
- package/dist/antifraud.d.ts +1 -1
- package/dist/antifraud.esm.js +3 -3
- package/dist/authentication.d.ts +11 -9
- package/dist/authentication.esm.js +18 -13
- package/dist/{authenticationManager-B4gSCgrO.esm.js → authenticationManager-CW4qxgcq.esm.js} +7 -6
- package/dist/{authenticationManager-Bd10YGSO.d.ts → authenticationManager-CiXsOTdM.d.ts} +2 -2
- package/dist/{backCameraStream-DF_d7hTz.esm.js → backCameraStream-CUo1USCT.esm.js} +2 -2
- package/dist/camera.d.ts +16 -0
- package/dist/camera.esm.js +5 -0
- package/dist/consent.d.ts +52 -52
- package/dist/consent.esm.js +3 -3
- package/dist/curp-validation.d.ts +5 -5
- package/dist/curp-validation.esm.js +3 -3
- package/dist/{deepsightLoader-DKgEdLIS.esm.js → deepsightLoader-Bs5jHgca.esm.js} +10 -7
- package/dist/deepsightService-C3gQ_9Ml.esm.js +493 -0
- package/dist/{deepsightService-Ciu0atv5.d.ts → deepsightService-CMAtxAC9.d.ts} +193 -197
- package/dist/device.d.ts +46 -0
- package/dist/device.esm.js +106 -0
- package/dist/document-capture.d.ts +78 -78
- package/dist/document-capture.esm.js +6 -6
- package/dist/document-upload.d.ts +53 -53
- package/dist/document-upload.esm.js +6 -6
- package/dist/ekyb.d.ts +3 -3
- package/dist/ekyb.esm.js +11 -10
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +104 -22
- package/dist/email.d.ts +3 -3
- package/dist/email.esm.js +5 -5
- package/dist/{emailManager-CpAwvP3v.esm.js → emailManager-CZ2IGW0g.esm.js} +4 -4
- package/dist/{emailManager-BQPIJR_O.d.ts → emailManager-DEIxY7l6.d.ts} +2 -2
- package/dist/events-BlVGS-8F.esm.js +472 -0
- package/dist/events.d.ts +232 -0
- package/dist/events.esm.js +4 -0
- package/dist/extensibility.d.ts +15 -13
- package/dist/extensibility.esm.js +25 -20
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +3 -3
- package/dist/{faceCaptureManagerFactory-CdwpYykv.d.ts → faceCaptureManagerFactory-CWj-nXdx.d.ts} +8 -6
- package/dist/{faceCaptureSetup-DbXgtcp7.esm.js → faceCaptureSetup-DIE5cftl.esm.js} +13 -10
- package/dist/flow.d.ts +7 -6
- package/dist/flow.esm.js +8 -8
- package/dist/{flowCompletionService-TnWijsSw.esm.js → flowCompletionService-N6-xypy-.esm.js} +2 -2
- package/dist/{flowServices-CO2sIR3D.esm.js → flowServices-xgqnJ64L.esm.js} +3 -3
- package/dist/geolocation.d.ts +2 -2
- package/dist/geolocation.esm.js +4 -4
- package/dist/getBrowser-B800KRAi.esm.js +41 -0
- package/dist/getDeviceClass-BKd2FOAf.esm.js +14 -0
- package/dist/government-validation.d.ts +2 -2
- package/dist/government-validation.esm.js +4 -4
- package/dist/http.d.ts +57 -0
- package/dist/http.esm.js +3 -0
- package/dist/id.d.ts +11 -10
- package/dist/id.esm.js +19 -15
- package/dist/{idCaptureManager-IdqsAASp.d.ts → idCaptureManager-H-rkXnbK.d.ts} +7 -6
- package/dist/{idCaptureManager-DaLU1ug7.esm.js → idCaptureManager-SHBRQ-X_.esm.js} +15 -11
- package/dist/index.d.ts +3 -611
- package/dist/index.esm.js +10 -562
- package/dist/{lib-i-4qLKdG.esm.js → lib-Cq5Wc-Hd.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +58 -58
- package/dist/mandatory-consent.esm.js +3 -3
- package/dist/permissionServices-CDqkkway.esm.js +50 -0
- package/dist/phone.d.ts +3 -3
- package/dist/phone.esm.js +5 -5
- package/dist/{phoneManager-DA8WUJtl.d.ts → phoneManager-Clfbrs6b.d.ts} +2 -2
- package/dist/{phoneManager-BAPHSXx8.esm.js → phoneManager-CscgaER2.esm.js} +4 -4
- package/dist/{StreamCanvasCapture-DkpkIgyL.esm.js → recordingsRepository-blYn-iKZ.esm.js} +157 -215
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/redirect-to-mobile.esm.js +4 -4
- package/dist/selfie.d.ts +11 -9
- package/dist/selfie.esm.js +18 -13
- package/dist/{selfieManager-BSkzncsa.esm.js → selfieManager-DeGqD5aN.esm.js} +5 -4
- package/dist/{selfieManager-Dft5wZQ_.d.ts → selfieManager-h_hhEefT.d.ts} +2 -2
- package/dist/{session-OglUYC9l.esm.js → session-PLjFj_T3.esm.js} +5 -19
- package/dist/session.d.ts +46 -2
- package/dist/session.esm.js +7 -4
- package/dist/setup-DJ3dFl5k.d.ts +120 -0
- package/dist/setup-fvDWE7f8.esm.js +450 -0
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +3 -3
- package/dist/{stats-BVigf5Rn.esm.js → stats-BZ1kFW4p.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/dist/{types-CiLyvJGb.d.ts → types-T0VjZW3T.d.ts} +1 -1
- package/dist/types-qhLxpptI.d.ts +5 -0
- package/dist/{types-D8Y1faI5.d.ts → types-zH5PDmSe.d.ts} +1 -1
- package/dist/{StateMachine-CM_aOfNL.d.ts → warmup-CEOVQKby.d.ts} +1 -4
- package/dist/wasm.d.ts +15 -0
- package/dist/wasm.esm.js +10 -0
- package/dist/{Manager-C6AGXEq_.esm.js → xstate.esm-BXrcOcSC.esm.js} +103 -507
- package/package.json +18 -2
- package/dist/endpoints-CI5-28jT.esm.js +0 -69
- package/dist/id-CzDAG_kM.esm.js +0 -0
- package/dist/index-BuVKc9bv.d.ts +0 -1
- /package/dist/{Actor-By8WNHi-.d.ts → Actor-C-jivmFF.d.ts} +0 -0
- /package/dist/{BrowserEnvironmentProvider-BECjyw3_.esm.js → BrowserEnvironmentProvider--xQUs3sg.esm.js} +0 -0
- /package/dist/{BrowserTimerProvider-CIqH6hJp.esm.js → BrowserTimerProvider-CkHEwJFa.esm.js} +0 -0
- /package/dist/{Manager-CCT_-HuZ.d.ts → Manager-BqFybBV-.d.ts} +0 -0
- /package/dist/{api-C2uzxrpN.esm.js → api-CyI8qTie.esm.js} +0 -0
- /package/dist/{browserSimulation-DYAk0Ipe.esm.js → browserSimulation-yzDdWSBf.esm.js} +0 -0
- /package/dist/{camera-6XJdOeBF.d.ts → camera-CKsQVNlH.d.ts} +0 -0
- /package/dist/{camera-DAuRUvnp.esm.js → camera-CsT06Zqy.esm.js} +0 -0
- /package/dist/{chunk-D6hkk-hd.esm.js → chunk-BcQWkoAq.esm.js} +0 -0
- /package/dist/{displayErrors-CGJwvrTl.d.ts → displayErrors-CjMXlBnu.d.ts} +0 -0
- /package/dist/{flowCompletionService-BOd4Rk8n.d.ts → flowCompletionService-BV6ThEJ1.d.ts} +0 -0
- /package/dist/{platform-DdhkonXk.esm.js → platform-Dcuv6w60.esm.js} +0 -0
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
import { i as isApiConfigured, r as getToken, t as api } from "./api-CyI8qTie.esm.js";
|
|
2
|
+
|
|
3
|
+
//#region ../infra/src/capabilities/IBrowserEnvironmentCapability.ts
|
|
4
|
+
function getTimestamp() {
|
|
5
|
+
return Date.now();
|
|
6
|
+
}
|
|
7
|
+
function revokeObjectURL(url) {
|
|
8
|
+
URL.revokeObjectURL(url);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/internal/http/endpoints.ts
|
|
13
|
+
const endpoints = {
|
|
14
|
+
createSession: "/omni/start",
|
|
15
|
+
flow: "/omni/onboarding/flow",
|
|
16
|
+
events: "/omni/interview-events",
|
|
17
|
+
selfie: "/omni/add/face",
|
|
18
|
+
authenticate: "/omni/onboarding-authentications/authenticate",
|
|
19
|
+
recordingCreateSessionV2: "/omni/recordings/create-session/v2",
|
|
20
|
+
recordingStartV2: "/omni/recordings/record-start/v2",
|
|
21
|
+
recordingStopV2: "/omni/recordings/record-stop/v2",
|
|
22
|
+
deepsightVideoImport: "/omni/recordings/import",
|
|
23
|
+
phone: "/omni/add/phone",
|
|
24
|
+
phoneInstant: "/omni/instant/add/phone",
|
|
25
|
+
getPhone: "/omni/get/phone",
|
|
26
|
+
startInfo: "/omni/start-info",
|
|
27
|
+
sendSmsOtp: "/omni/send/sms-otp",
|
|
28
|
+
compareOtp: "/omni/compare/otp",
|
|
29
|
+
email: "/omni/add/email",
|
|
30
|
+
getEmail: "/omni/get/email",
|
|
31
|
+
frontId: "/omni/add/front-id/v2",
|
|
32
|
+
backId: "/omni/add/back-id/v2",
|
|
33
|
+
frontSecondId: "/omni/add/front-second-id/v2",
|
|
34
|
+
backSecondId: "/omni/add/back-second-id/v2",
|
|
35
|
+
getImages: "/omni/get/images",
|
|
36
|
+
getImagesV2: "/omni/get/images/v2",
|
|
37
|
+
getScore: "/omni/get/score",
|
|
38
|
+
getImagesSecondId: "/omni/get/images-second-id",
|
|
39
|
+
processId: "/omni/process/id",
|
|
40
|
+
processSecondId: "/omni/process/second-id",
|
|
41
|
+
processFace: "/omni/process/face",
|
|
42
|
+
governmentValidation: "/omni/process/government-validation",
|
|
43
|
+
deviceStats: "/omni/device/stats",
|
|
44
|
+
featureConfig: "/omni/feature-config",
|
|
45
|
+
deviceFingerprint: "/omni/add/device-fingerprint",
|
|
46
|
+
onboardingStatus: "/omni/get/onboarding/status",
|
|
47
|
+
customFields: "/omni/get/custom-fields",
|
|
48
|
+
deviceRiskClientId: "/omni/device-risk-client-id",
|
|
49
|
+
ocrData: "/omni/get/ocr-data",
|
|
50
|
+
addCurp: "/omni/add/curp",
|
|
51
|
+
addCurpV2: "/omni/add/curp/v2",
|
|
52
|
+
addGeolocation: "/omni/add/geolocation",
|
|
53
|
+
ekycSubmit: "/omni/externalVerification/ekyc",
|
|
54
|
+
ekybSubmit: "/omni/externalVerification/ekyb",
|
|
55
|
+
getCombinedConsent: "/omni/get/combined-consent",
|
|
56
|
+
signCombinedConsent: "/omni/sign-combined-consent",
|
|
57
|
+
getConsents: "/omni/consents",
|
|
58
|
+
submitMlConsent: "/omni/consents/submit",
|
|
59
|
+
addressAutocomplete: "/omni/externalVerification/addressAutocomplete",
|
|
60
|
+
otpStatus: "/omni/session/otp-status",
|
|
61
|
+
moduleConfig: "/omni/flow/onboarding/configuration",
|
|
62
|
+
addDocument: "/omni/add/document/v2",
|
|
63
|
+
addressStatement: "/omni/add/address-statement/v2",
|
|
64
|
+
documentV3: "/omni/add/document/v3",
|
|
65
|
+
finalizeDocument: "/omni/finalize/document",
|
|
66
|
+
documentLegacy: "/omni/add/document",
|
|
67
|
+
cfdi: "/omni/process/cfdi",
|
|
68
|
+
finishStatus: "/omni/finish-status",
|
|
69
|
+
updateSession: "/omni/update",
|
|
70
|
+
onboardingUrl: "/omni/onboarding-url",
|
|
71
|
+
sendRedirectSms: "/omni/notify/send-sms",
|
|
72
|
+
qrRefreshUuid: "/omni/qr/refresh",
|
|
73
|
+
addSignature: "/omni/add/signature",
|
|
74
|
+
addSignatureV2: "/omni/add/signature/v2",
|
|
75
|
+
addInitials: "/omni/add/initial",
|
|
76
|
+
processAntifraud: "/omni/process/antifraud"
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/internal/events/addEvent.ts
|
|
81
|
+
const INTERVIEW_EVENTS_MAX_SCREEN_LENGTH = 50;
|
|
82
|
+
function normalizeScreenForInterviewEventsApi(screenValue) {
|
|
83
|
+
const limit = INTERVIEW_EVENTS_MAX_SCREEN_LENGTH;
|
|
84
|
+
if (screenValue.length <= limit) return screenValue;
|
|
85
|
+
const head = screenValue.slice(0, limit);
|
|
86
|
+
const lastDot = head.lastIndexOf(".");
|
|
87
|
+
const lastPlus = head.lastIndexOf("+");
|
|
88
|
+
const lastBoundary = Math.max(lastDot, lastPlus);
|
|
89
|
+
if (lastBoundary > 0) return head.slice(0, lastBoundary);
|
|
90
|
+
return head;
|
|
91
|
+
}
|
|
92
|
+
const eventsQueue = [];
|
|
93
|
+
const eventSubscribers = [];
|
|
94
|
+
/**
|
|
95
|
+
* Subscribes to all SDK events for logging, debugging, or custom analytics.
|
|
96
|
+
* Returns an unsubscribe function.
|
|
97
|
+
*
|
|
98
|
+
* @param listener - Callback function that receives each event
|
|
99
|
+
* @returns Unsubscribe function to remove the listener
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* const unsubscribe = subscribeEvent((event) => {
|
|
104
|
+
* console.log('[Event]', event.code, event.module);
|
|
105
|
+
* });
|
|
106
|
+
*
|
|
107
|
+
* // Later
|
|
108
|
+
* unsubscribe();
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
function subscribeEvent(listener) {
|
|
112
|
+
eventSubscribers.push(listener);
|
|
113
|
+
return () => {
|
|
114
|
+
const index = eventSubscribers.indexOf(listener);
|
|
115
|
+
if (index > -1) eventSubscribers.splice(index, 1);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function notifySubscribers(event) {
|
|
119
|
+
eventSubscribers.forEach((listener) => {
|
|
120
|
+
try {
|
|
121
|
+
listener(event);
|
|
122
|
+
} catch (_error) {}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Sends an event to the dashboard for tracking.
|
|
127
|
+
* Fire-and-forget: never blocks, never throws.
|
|
128
|
+
* Events are queued if SDK is not configured yet.
|
|
129
|
+
*/
|
|
130
|
+
function addEvent(event) {
|
|
131
|
+
notifySubscribers(event);
|
|
132
|
+
const token = getToken();
|
|
133
|
+
if (!isApiConfigured() || !token) {
|
|
134
|
+
eventsQueue.push(event);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const screenForApi = event.screen !== void 0 ? normalizeScreenForInterviewEventsApi(event.screen) : void 0;
|
|
138
|
+
api.post(endpoints.events, [{
|
|
139
|
+
code: event.code,
|
|
140
|
+
module: event.module,
|
|
141
|
+
screen: screenForApi,
|
|
142
|
+
clientTimestamp: event.clientTimestamp ?? getTimestamp(),
|
|
143
|
+
payload: event.payload ?? {}
|
|
144
|
+
}]).catch(() => {});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Flushes any queued events that were sent before SDK was configured.
|
|
148
|
+
* Called automatically by setup() after token is set.
|
|
149
|
+
*/
|
|
150
|
+
function flushEventQueue() {
|
|
151
|
+
if (!isApiConfigured() || !getToken()) return;
|
|
152
|
+
const queuedEvents = [...eventsQueue];
|
|
153
|
+
eventsQueue.length = 0;
|
|
154
|
+
for (const event of queuedEvents) addEvent(event);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/internal/events/helpers.ts
|
|
159
|
+
function screenEvent(params) {
|
|
160
|
+
addEvent({
|
|
161
|
+
code: params.code,
|
|
162
|
+
module: params.module,
|
|
163
|
+
screen: params.screen,
|
|
164
|
+
clientTimestamp: getTimestamp(),
|
|
165
|
+
payload: params.payload
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function moduleOpened(module, screen, payload) {
|
|
169
|
+
screenEvent({
|
|
170
|
+
module,
|
|
171
|
+
screen,
|
|
172
|
+
code: "moduleOpened",
|
|
173
|
+
payload
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function moduleClosed(module, screen, payload) {
|
|
177
|
+
screenEvent({
|
|
178
|
+
module,
|
|
179
|
+
screen,
|
|
180
|
+
code: "moduleClosed",
|
|
181
|
+
payload
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function screenOpened(module, screen, payload) {
|
|
185
|
+
screenEvent({
|
|
186
|
+
module,
|
|
187
|
+
screen,
|
|
188
|
+
code: "screenOpened",
|
|
189
|
+
payload
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function screenClosed(module, screen, payload) {
|
|
193
|
+
screenEvent({
|
|
194
|
+
module,
|
|
195
|
+
screen,
|
|
196
|
+
code: "screenClosed",
|
|
197
|
+
payload
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function errorTriggered(module, screen, payload) {
|
|
201
|
+
screenEvent({
|
|
202
|
+
module,
|
|
203
|
+
screen,
|
|
204
|
+
code: "errorTriggered",
|
|
205
|
+
payload
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function elementClicked(module, screen, payload) {
|
|
209
|
+
screenEvent({
|
|
210
|
+
module,
|
|
211
|
+
screen,
|
|
212
|
+
code: "elementClicked",
|
|
213
|
+
payload
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
function captureAttemptFinished(module, screen, payload) {
|
|
217
|
+
screenEvent({
|
|
218
|
+
module,
|
|
219
|
+
screen,
|
|
220
|
+
code: "captureAttemptFinished",
|
|
221
|
+
payload
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region src/internal/events/managerInstrumentation.ts
|
|
227
|
+
function normalizeSegment(segment) {
|
|
228
|
+
if (typeof segment !== "string") return "";
|
|
229
|
+
return segment.trim().replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
230
|
+
}
|
|
231
|
+
function normalizeDottedPath(path) {
|
|
232
|
+
return path.split("+").map((branch) => branch.split(".").map((segment) => normalizeSegment(segment)).filter((segment) => segment.length > 0).join(".")).filter((branch) => branch.length > 0).join("+");
|
|
233
|
+
}
|
|
234
|
+
function stateValueToScreenSegment(value) {
|
|
235
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
236
|
+
const segment = normalizeSegment(String(value));
|
|
237
|
+
return segment.length > 0 ? segment : void 0;
|
|
238
|
+
}
|
|
239
|
+
if (typeof value !== "object" || value === null) return;
|
|
240
|
+
const entries = Object.entries(value).sort(([left], [right]) => {
|
|
241
|
+
if (left < right) return -1;
|
|
242
|
+
if (left > right) return 1;
|
|
243
|
+
return 0;
|
|
244
|
+
});
|
|
245
|
+
if (entries.length === 0) return;
|
|
246
|
+
const branches = entries.map(([key, nestedValue]) => {
|
|
247
|
+
const normalizedKey = normalizeSegment(key);
|
|
248
|
+
const nestedSegment = stateValueToScreenSegment(nestedValue);
|
|
249
|
+
if (normalizedKey.length === 0) return nestedSegment;
|
|
250
|
+
if (nestedSegment === void 0) return normalizedKey;
|
|
251
|
+
return `${normalizedKey}.${nestedSegment}`;
|
|
252
|
+
}).filter((branch) => branch !== void 0 && branch.length > 0);
|
|
253
|
+
if (branches.length === 0) return;
|
|
254
|
+
return branches.join("+");
|
|
255
|
+
}
|
|
256
|
+
function buildScreenName(moduleName, screenName) {
|
|
257
|
+
const normalizedModuleName = typeof moduleName === "string" ? moduleName.trim() : "";
|
|
258
|
+
const normalizedScreen = normalizeDottedPath(screenName);
|
|
259
|
+
if (normalizedModuleName.length === 0) return normalizedScreen;
|
|
260
|
+
if (normalizedScreen.length === 0) return normalizedModuleName;
|
|
261
|
+
return `${normalizedModuleName}.${normalizedScreen}`;
|
|
262
|
+
}
|
|
263
|
+
function getDefaultManagerScreenName(snapshot) {
|
|
264
|
+
return stateValueToScreenSegment(snapshot.value);
|
|
265
|
+
}
|
|
266
|
+
function getManagerScreenName(moduleName, snapshot, options) {
|
|
267
|
+
const mappedScreen = options?.getScreenName?.(snapshot) ?? getDefaultManagerScreenName(snapshot);
|
|
268
|
+
if (mappedScreen === void 0) return;
|
|
269
|
+
return buildScreenName(moduleName, mappedScreen);
|
|
270
|
+
}
|
|
271
|
+
function isErrorLikeSegment(segment) {
|
|
272
|
+
return segment === "error" || segment.includes("error") || segment.includes("failed") || segment.includes("failure");
|
|
273
|
+
}
|
|
274
|
+
function getDefaultManagerErrorName(snapshot) {
|
|
275
|
+
const screenSegment = stateValueToScreenSegment(snapshot.value);
|
|
276
|
+
if (screenSegment === void 0) return;
|
|
277
|
+
const normalizedSegment = normalizeDottedPath(screenSegment);
|
|
278
|
+
if (normalizedSegment.length === 0) return;
|
|
279
|
+
if (normalizedSegment === "error") return "error.unknown";
|
|
280
|
+
if (!isErrorLikeSegment(normalizedSegment)) return;
|
|
281
|
+
return `error.${normalizedSegment}`;
|
|
282
|
+
}
|
|
283
|
+
function createManagerInstrumentation(moduleName, options) {
|
|
284
|
+
return {
|
|
285
|
+
moduleName,
|
|
286
|
+
onModuleOpened: moduleOpened,
|
|
287
|
+
onModuleClosed: moduleClosed,
|
|
288
|
+
onScreenOpened: screenOpened,
|
|
289
|
+
onScreenClosed: screenClosed,
|
|
290
|
+
onErrorTriggered: errorTriggered,
|
|
291
|
+
onElementClicked: (moduleName$1, screenName, payload) => elementClicked(moduleName$1, screenName, payload),
|
|
292
|
+
onCaptureAttemptFinished: (moduleName$1, screenName, payload) => captureAttemptFinished(moduleName$1, screenName, payload),
|
|
293
|
+
getScreenName: (snapshot) => getManagerScreenName(moduleName, snapshot, { getScreenName: options?.getScreenName }),
|
|
294
|
+
getErrorName: (snapshot) => {
|
|
295
|
+
const mappedError = options?.getErrorName?.(snapshot) ?? getDefaultManagerErrorName(snapshot);
|
|
296
|
+
if (mappedError === void 0) return;
|
|
297
|
+
return buildScreenName(moduleName, mappedError);
|
|
298
|
+
},
|
|
299
|
+
getErrorPayload: (snapshot) => options?.getErrorPayload?.(snapshot)
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/internal/events/types.ts
|
|
305
|
+
const eventModuleNames = {
|
|
306
|
+
selfie: "SELFIE",
|
|
307
|
+
authentication: "AUTHENTICATION",
|
|
308
|
+
authFace: "AUTH_FACE",
|
|
309
|
+
mlConsent: "ML_CONSENT",
|
|
310
|
+
combinedConsent: "COMBINED_CONSENT",
|
|
311
|
+
curpValidation: "CURP_VALIDATION",
|
|
312
|
+
faceMatch: "FACE_MATCH",
|
|
313
|
+
qr: "QR",
|
|
314
|
+
videoSelfie: "VIDEO_ONBOARDING",
|
|
315
|
+
passport: "ID",
|
|
316
|
+
front: "ID",
|
|
317
|
+
back: "ID",
|
|
318
|
+
id: "ID",
|
|
319
|
+
document: "DOCUMENT_CAPTURE",
|
|
320
|
+
creditCard: "CREDIT_CARD_FRONT",
|
|
321
|
+
creditCardBack: "CREDIT_CARD_BACK",
|
|
322
|
+
conference: "CONFERENCE",
|
|
323
|
+
otp: "OTP",
|
|
324
|
+
signature: "SIGNATURE",
|
|
325
|
+
ekyc: "EXTERNAL_VERIFICATION",
|
|
326
|
+
globalWatchList: "GLOBAL_WATCHLIST",
|
|
327
|
+
customWatchList: "CUSTOM_WATCHLIST",
|
|
328
|
+
email: "EMAIL",
|
|
329
|
+
phone: "PHONE",
|
|
330
|
+
instantVerifyEmail: "INSTANT_VERIFY_EMAIL",
|
|
331
|
+
instantVerifyConsent: "INSTANT_VERIFY_CONSENT",
|
|
332
|
+
forms: "FORMS",
|
|
333
|
+
customModule: "CUSTOM_MODULE",
|
|
334
|
+
geolocation: "GEOLOCATION",
|
|
335
|
+
ekyb: "EKYB",
|
|
336
|
+
antifraud: "ANTIFRAUD"
|
|
337
|
+
};
|
|
338
|
+
const eventScreenNames = {
|
|
339
|
+
faceMatch: "FACE_MATCH",
|
|
340
|
+
faceCaptureTutorial: "SELFIE_CAPTURE_TUTORIAL",
|
|
341
|
+
faceCaptureCamera: "SELFIE_CAMERA_CAPTURE",
|
|
342
|
+
faceCaptureError: "SELFIE_ATTEMPT_FAILED",
|
|
343
|
+
faceCaptureSuccess: "SELFIE_UPLOAD_SUCCEEDED",
|
|
344
|
+
faceCaptureUpload: "SELFIE_UPLOAD_PROGRESS",
|
|
345
|
+
mlConsent: "MACHINE_LEARNING_CONSENT",
|
|
346
|
+
combinedConsent: "COMBINED_CONSENT",
|
|
347
|
+
curpEnter: "ENTER_CURP",
|
|
348
|
+
curpValidate: "VALIDATE_CURP",
|
|
349
|
+
curpGenerate: "GENERATE_CURP",
|
|
350
|
+
curpValidation: "CURP_VALIDATION_PROGRESS",
|
|
351
|
+
curpValidationFailed: "CURP_VALIDATION_FAILED",
|
|
352
|
+
curpValidationSuccess: "CURP_VALIDATION_SUCCEEDED",
|
|
353
|
+
qrTutorial: "QR_TUTORIAL",
|
|
354
|
+
qrScan: "QR_SCAN",
|
|
355
|
+
smsOtp: "OTP",
|
|
356
|
+
simpleOTP: "OTP",
|
|
357
|
+
signatureInput: "SIGNATURE_INPUT",
|
|
358
|
+
signatureInitialsInput: "INITIALS_INPUT",
|
|
359
|
+
frontTutorial: "FRONT_ID_CAPTURE_TUTORIAL",
|
|
360
|
+
frontCameraCapture: "FRONT_ID_CAMERA_CAPTURE",
|
|
361
|
+
frontHelp: "FRONT_ID_HELP",
|
|
362
|
+
frontReviewPhoto: "FRONT_ID_REVIEW_PHOTO",
|
|
363
|
+
frontUploadProgress: "FRONT_ID_UPLOAD_PROGRESS",
|
|
364
|
+
frontAttemptFailed: "FRONT_ID_ATTEMPT_FAILED",
|
|
365
|
+
frontUploadSuccess: "FRONT_ID_UPLOAD_SUCCEEDED",
|
|
366
|
+
backTutorial: "BACK_ID_CAPTURE_TUTORIAL",
|
|
367
|
+
backCameraCapture: "BACK_ID_CAMERA_CAPTURE",
|
|
368
|
+
backReviewPhoto: "BACK_ID_REVIEW_PHOTO",
|
|
369
|
+
backUploadProgress: "BACK_ID_UPLOAD_PROGRESS",
|
|
370
|
+
backAttemptFailed: "BACK_ID_ATTEMPT_FAILED",
|
|
371
|
+
backUploadSuccess: "BACK_ID_UPLOAD_SUCCEEDED",
|
|
372
|
+
backHelp: "BACK_ID_HELP",
|
|
373
|
+
passportTutorial: "TUTORIAL_PASSPORT",
|
|
374
|
+
documentTutorial: "DOCUMENT_CAPTURE_TUTORIAL",
|
|
375
|
+
documentCameraCapture: "DOCUMENT_CAMERA_CAPTURE",
|
|
376
|
+
documentHelp: "DOCUMENT_HELP",
|
|
377
|
+
documentReviewPhoto: "DOCUMENT_REVIEW_PHOTO",
|
|
378
|
+
documentUploadProgress: "DOCUMENT_UPLOAD_IN_PROGRESS",
|
|
379
|
+
documentAttemptFailed: "DOCUMENT_ATTEMPT_FAILED",
|
|
380
|
+
documentUploadSuccess: "DOCUMENT_UPLOAD_SUCCEEDED",
|
|
381
|
+
conferenceWait: "CONFERENCE_WAIT",
|
|
382
|
+
conferenceVideoChat: "CONFERENCE_VIDEO_CHAT",
|
|
383
|
+
conferenceMessageChat: "CONFERENCE_MESSAGE_CHAT",
|
|
384
|
+
videoSelfieTutorial: "VIDEO_SELFIE_TUTORIAL",
|
|
385
|
+
videoSelfie: "VIDEO_SELFIE",
|
|
386
|
+
videoSelfieFaceCapture: "VIDEO_SELFIE_FACE_CAPTURE",
|
|
387
|
+
videoSelfieFaceUploadProgress: "VIDEO_SELFIE_FACE_UPLOAD_PROGRESS",
|
|
388
|
+
videoSelfieFaceAttemptFailed: "VIDEO_SELFIE_FACE_ATTEMPT_FAILED",
|
|
389
|
+
videoSelfieFaceUploadSucceeded: "VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED",
|
|
390
|
+
videoSelfieFrontIdCapture: "VIDEO_SELFIE_FRONT_ID_CAPTURE",
|
|
391
|
+
videoSelfieFrontIdUploadProgress: "VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS",
|
|
392
|
+
videoSelfieFrontIdAttemptFailed: "VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED",
|
|
393
|
+
videoSelfieFrontIdUploadSucceeded: "VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED",
|
|
394
|
+
videoSelfieBackIdCapture: "VIDEO_SELFIE_BACK_ID_CAPTURE",
|
|
395
|
+
videoSelfieBackIdUploadProgress: "VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS",
|
|
396
|
+
videoSelfieBackIdAttemptFailed: "VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED",
|
|
397
|
+
videoSelfieBackIdUploadSucceeded: "VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED",
|
|
398
|
+
videoSelfieDocumentCapture: "VIDEO_SELFIE_DOCUMENT_CAPTURE",
|
|
399
|
+
videoSelfieVoiceQuestion: "VIDEO_SELFIE_VOICE_QUESTION",
|
|
400
|
+
videoSelfieVoiceFinalQuestion: "VIDEO_SELFIE_VOICE_FINAL_QUESTION",
|
|
401
|
+
videoSelfieVideoUpload: "VIDEO SELFIE VIDEO UPLOAD",
|
|
402
|
+
ekycInput: "EKYC_INPUT",
|
|
403
|
+
ekycProgress: "EKYC_PROGRESS",
|
|
404
|
+
ekycSucceeded: "EKYC_SUCCEEDED",
|
|
405
|
+
ekycFailed: "EKYC_FAILED",
|
|
406
|
+
forms: "FORMS",
|
|
407
|
+
globalWatchListInput: "GLOBAL_WATCHLIST_INPUT",
|
|
408
|
+
globalWatchListProgress: "GLOBAL_WATCHLIST_PROGRESS",
|
|
409
|
+
globalWatchListSuccess: "GLOBAL_WATCHLIST_SUCCEEDED",
|
|
410
|
+
globalWatchListFailed: "GLOBAL_WATCHLIST_FAILED",
|
|
411
|
+
customWatchListInput: "CUSTOM_WATCHLIST_INPUT",
|
|
412
|
+
customWatchListProgress: "CUSTOM_WATCHLIST_PROGRESS",
|
|
413
|
+
customWatchListSuccess: "CUSTOM_WATCHLIST_SUCCEEDED",
|
|
414
|
+
customWatchListFailed: "CUSTOM_WATCHLIST_FAILED",
|
|
415
|
+
emailInput: "EMAIL_INPUT",
|
|
416
|
+
phoneInput: "PHONE_INPUT",
|
|
417
|
+
instantVerify: "INSTANT_VERIFY",
|
|
418
|
+
authFace: "AUTH_FACE",
|
|
419
|
+
authFaceError: "AUTH_FACE_ATTEMPT_FAILED",
|
|
420
|
+
authFaceUpload: "AUTH_FACE_UPLOAD_PROGRESS",
|
|
421
|
+
authFaceUploadSuccess: "AUTH_FACE_UPLOAD_SUCCEEDED",
|
|
422
|
+
authFaceUploadFailed: "AUTH_FACE_UPLOAD_FAILED",
|
|
423
|
+
customModuleCallback: "CUSTOM_MODULE_CALLBACK",
|
|
424
|
+
customModuleProcessing: "CUSTOM_MODULE_PROCESSING",
|
|
425
|
+
digitalIdFileSelection: "DIGITAL_ID_FILE_SELECTION",
|
|
426
|
+
digitalIdFileReview: "DIGITAL_ID_FILE_REVIEW",
|
|
427
|
+
digitalIdUploadProgress: "DIGITAL_ID_UPLOAD_PROGRESS",
|
|
428
|
+
digitalIdUploadSuccess: "DIGITAL_ID_UPLOAD_SUCCEEDED",
|
|
429
|
+
digitalIdUploadFailed: "DIGITAL_ID_UPLOAD_FAILED",
|
|
430
|
+
digitalIdAnalysisProgress: "DIGITAL_ID_ANALYSIS_PROGRESS",
|
|
431
|
+
digitalIdVerificationSuccess: "DIGITAL_ID_VERIFICATION_SUCCESS",
|
|
432
|
+
digitalIdVerificationFailed: "DIGITAL_ID_VERIFICATION_FAILED",
|
|
433
|
+
ekybForm: "EKYB_FORM"
|
|
434
|
+
};
|
|
435
|
+
const videoSelfieEvents = {
|
|
436
|
+
imageTooBlurry: "imageTooBlurry",
|
|
437
|
+
fillFrame: "fillFrame",
|
|
438
|
+
checkCameraOrLighting: "checkCameraOrLighting",
|
|
439
|
+
frontIdCaptureStarted: "frontIdCaptureStarted",
|
|
440
|
+
lookAtCamera: "lookAtCamera",
|
|
441
|
+
moveCloser: "moveCloser",
|
|
442
|
+
lookingForFrontId: "lookingForFrontId",
|
|
443
|
+
lookingForBackId: "lookingForBackId",
|
|
444
|
+
cameraSwitchToBack: "cameraSwitchToBack",
|
|
445
|
+
cameraSwitchToFront: "cameraSwitchToFront",
|
|
446
|
+
audioStreamOpened: "audioStreamOpened",
|
|
447
|
+
audioStreamClosed: "audioStreamClosed",
|
|
448
|
+
videoSelfieVideoUploadInProgress: "videoSelfieVideoUploadInProgress",
|
|
449
|
+
videoSelfieTosNotAccepted: "videoSelfieTosNotAccepted",
|
|
450
|
+
videoSelfieTosAccepted: "videoSelfieTosAccepted",
|
|
451
|
+
videoSelfieStreamCreated: "videoSelfieStreamCreated",
|
|
452
|
+
videoSelfieStreamDestroyed: "videoSelfieStreamDestroyed",
|
|
453
|
+
videoSelfieReconnecting: "videoSelfieReconnecting",
|
|
454
|
+
videoSelfieReconnected: "videoSelfieReconnected"
|
|
455
|
+
};
|
|
456
|
+
const tutorialScreenNamesMapper = {
|
|
457
|
+
passport: eventScreenNames.passportTutorial,
|
|
458
|
+
front: eventScreenNames.frontTutorial,
|
|
459
|
+
back: eventScreenNames.backTutorial,
|
|
460
|
+
selfie: eventScreenNames.faceCaptureTutorial
|
|
461
|
+
};
|
|
462
|
+
const cameraScreenNamesMapper = {
|
|
463
|
+
front: "front",
|
|
464
|
+
back: "back",
|
|
465
|
+
passport: "passport",
|
|
466
|
+
creditCard: "front",
|
|
467
|
+
creditCardBack: "back",
|
|
468
|
+
document: "document"
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
//#endregion
|
|
472
|
+
export { endpoints as _, videoSelfieEvents as a, elementClicked as c, screenClosed as d, screenEvent as f, subscribeEvent as g, flushEventQueue as h, tutorialScreenNamesMapper as i, moduleClosed as l, addEvent as m, eventModuleNames as n, createManagerInstrumentation as o, screenOpened as p, eventScreenNames as r, captureAttemptFinished as s, cameraScreenNamesMapper as t, moduleOpened as u, revokeObjectURL as v };
|