@incodetech/core 0.0.0-dev-20260407-4677d7f → 0.0.0-dev-20260407-ebd92aa
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/OpenViduRecordingProvider-PvkEhhDq.esm.js +87 -0
- package/dist/antifraud.d.ts +1 -1
- package/dist/authentication.d.ts +11 -11
- package/dist/authentication.esm.js +3 -3
- package/dist/{authenticationManager-CiXsOTdM.d.ts → authenticationManager-CXTPgE_2.d.ts} +2 -2
- package/dist/{authenticationManager-CW4qxgcq.esm.js → authenticationManager-D4esVx-z.esm.js} +2 -2
- package/dist/camera.d.ts +1 -1
- package/dist/consent.d.ts +49 -49
- package/dist/curp-validation.d.ts +5 -5
- package/dist/{deepsightService-CMAtxAC9.d.ts → deepsightService-CyEcAH-I.d.ts} +2 -2
- package/dist/document-capture.d.ts +70 -70
- package/dist/document-upload.d.ts +4 -4
- package/dist/ekyb.d.ts +3 -3
- package/dist/ekyc.d.ts +3 -3
- package/dist/email.d.ts +3 -3
- package/dist/{emailManager-DEIxY7l6.d.ts → emailManager-CtA6Tvry.d.ts} +2 -2
- package/dist/extensibility.d.ts +15 -15
- package/dist/extensibility.esm.js +5 -5
- package/dist/face-match.d.ts +1 -1
- package/dist/{faceCaptureManagerFactory-CWj-nXdx.d.ts → faceCaptureManagerFactory-Bp_mC9b2.d.ts} +8 -8
- package/dist/faceCaptureSetup-DzlTPjT9.esm.js +828 -0
- package/dist/flow.d.ts +17 -10
- package/dist/flow.esm.js +60 -13
- package/dist/geolocation.d.ts +2 -2
- package/dist/government-validation.d.ts +2 -2
- package/dist/id.d.ts +11 -11
- package/dist/id.esm.js +3 -3
- package/dist/{idCaptureManager-H-rkXnbK.d.ts → idCaptureManager-Bx298yFC.d.ts} +9 -8
- package/dist/{idCaptureManager-SHBRQ-X_.esm.js → idCaptureManager-bowLKHEs.esm.js} +61 -48
- package/dist/index.d.ts +2 -2
- package/dist/mandatory-consent.d.ts +52 -52
- package/dist/openviduLazy-BdsxPGgp.esm.js +12 -0
- package/dist/openviduLazy-NTgGtkeK.esm.js +3 -0
- package/dist/phone.d.ts +3 -3
- package/dist/{phoneManager-Clfbrs6b.d.ts → phoneManager-DlaiZtwZ.d.ts} +2 -2
- package/dist/recordingService-BDx_6XR9.esm.js +1024 -0
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/selfie.d.ts +11 -11
- package/dist/selfie.esm.js +3 -3
- package/dist/{selfieManager-DeGqD5aN.esm.js → selfieManager-DVvvlMMf.esm.js} +2 -2
- package/dist/{selfieManager-h_hhEefT.d.ts → selfieManager-UBgYgVnw.d.ts} +2 -2
- package/dist/session.d.ts +1 -1
- package/dist/{setup-DJ3dFl5k.d.ts → setup-DfinQjIF.d.ts} +1 -1
- package/dist/signature.d.ts +2 -2
- package/dist/{types-T0VjZW3T.d.ts → types-DcqFYowa.d.ts} +1 -1
- package/dist/{types-zH5PDmSe.d.ts → types-DufUK-_f.d.ts} +1 -1
- package/dist/wasm.d.ts +2 -2
- package/package.json +1 -1
- package/dist/faceCaptureSetup-DIE5cftl.esm.js +0 -1564
- package/dist/recordingsRepository-blYn-iKZ.esm.js +0 -352
- /package/dist/{Actor-C-jivmFF.d.ts → Actor-Cz_KnN47.d.ts} +0 -0
- /package/dist/{Manager-BqFybBV-.d.ts → Manager-N01KfnVA.d.ts} +0 -0
- /package/dist/{StateMachine-8d441d6x.d.ts → StateMachine-DU1S4Cik.d.ts} +0 -0
- /package/dist/{camera-CKsQVNlH.d.ts → camera-BcVDCZxW.d.ts} +0 -0
- /package/dist/{displayErrors-CjMXlBnu.d.ts → displayErrors-C0mf2glb.d.ts} +0 -0
- /package/dist/{flowCompletionService-BV6ThEJ1.d.ts → flowCompletionService-Dloh6J8n.d.ts} +0 -0
- /package/dist/{types-qhLxpptI.d.ts → types-UPqCMQKa.d.ts} +0 -0
- /package/dist/{warmup-CEOVQKby.d.ts → warmup-yzJJKXFi.d.ts} +0 -0
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import { a as __toDynamicImportESM } from "./chunk-BcQWkoAq.esm.js";
|
|
2
|
-
import { t as api } from "./api-CyI8qTie.esm.js";
|
|
3
|
-
import { _ as endpoints } from "./events-BlVGS-8F.esm.js";
|
|
4
|
-
import { n as IncodeCanvas } from "./deepsightService-C3gQ_9Ml.esm.js";
|
|
5
|
-
|
|
6
|
-
//#region ../infra/src/providers/browser/BrowserStorageProvider.ts
|
|
7
|
-
/**
|
|
8
|
-
* Browser-based storage provider wrapping localStorage.
|
|
9
|
-
* Handles JSON serialization/deserialization automatically.
|
|
10
|
-
*/
|
|
11
|
-
var BrowserStorageProvider = class {
|
|
12
|
-
/**
|
|
13
|
-
* Retrieves a value from localStorage.
|
|
14
|
-
* @param key - The storage key
|
|
15
|
-
* @returns The stored value or null if not found
|
|
16
|
-
* @throws Error if stored value is invalid JSON
|
|
17
|
-
*/
|
|
18
|
-
async get(key) {
|
|
19
|
-
try {
|
|
20
|
-
const item = localStorage.getItem(key);
|
|
21
|
-
if (item === null) return null;
|
|
22
|
-
return JSON.parse(item);
|
|
23
|
-
} catch (error) {
|
|
24
|
-
if (error instanceof SyntaxError) throw new Error(`Invalid JSON stored at key "${key}": ${error.message}`);
|
|
25
|
-
throw error;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Stores a value in localStorage.
|
|
30
|
-
* @param key - The storage key
|
|
31
|
-
* @param value - The value to store (will be serialized as JSON)
|
|
32
|
-
* @throws Error if value cannot be serialized or quota is exceeded
|
|
33
|
-
*/
|
|
34
|
-
async set(key, value) {
|
|
35
|
-
try {
|
|
36
|
-
const serialized = JSON.stringify(value);
|
|
37
|
-
localStorage.setItem(key, serialized);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
if ((error instanceof DOMException || error.name === "QuotaExceededError") && error.name === "QuotaExceededError") throw new Error(`Storage quota exceeded for key "${key}"`);
|
|
40
|
-
if (error instanceof TypeError) throw new Error(`Failed to serialize value for key "${key}": ${error.message}`);
|
|
41
|
-
throw error;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Removes a value from localStorage.
|
|
46
|
-
* @param key - The storage key to remove
|
|
47
|
-
*/
|
|
48
|
-
async remove(key) {
|
|
49
|
-
localStorage.removeItem(key);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Clears all values from localStorage.
|
|
53
|
-
*/
|
|
54
|
-
async clear() {
|
|
55
|
-
localStorage.clear();
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region ../infra/src/media/StreamCanvasCapture.ts
|
|
61
|
-
var StreamCanvasCapture = class {
|
|
62
|
-
constructor(stream, options) {
|
|
63
|
-
this.hasFrame = false;
|
|
64
|
-
this.disposed = false;
|
|
65
|
-
this.eventTarget = new EventTarget();
|
|
66
|
-
this.video = document.createElement("video");
|
|
67
|
-
this.video.srcObject = stream;
|
|
68
|
-
this.video.autoplay = true;
|
|
69
|
-
this.video.playsInline = true;
|
|
70
|
-
this.video.muted = true;
|
|
71
|
-
const settings = stream.getVideoTracks()[0]?.getSettings();
|
|
72
|
-
const initialWidth = options?.width ?? settings?.width ?? 1280;
|
|
73
|
-
const initialHeight = options?.height ?? settings?.height ?? 720;
|
|
74
|
-
this.canvas = document.createElement("canvas");
|
|
75
|
-
this.canvas.width = initialWidth;
|
|
76
|
-
this.canvas.height = initialHeight;
|
|
77
|
-
this.ctx = this.canvas.getContext("2d", { willReadFrequently: true });
|
|
78
|
-
const fps = options?.fps ?? 10;
|
|
79
|
-
const intervalMs = fps > 0 ? Math.max(16, Math.floor(1e3 / fps)) : 0;
|
|
80
|
-
this.video.addEventListener("loadedmetadata", () => {
|
|
81
|
-
if (this.video.videoWidth > 0 && this.video.videoHeight > 0) {
|
|
82
|
-
this.canvas.width = this.video.videoWidth;
|
|
83
|
-
this.canvas.height = this.video.videoHeight;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
try {
|
|
87
|
-
this.video.play();
|
|
88
|
-
} catch {}
|
|
89
|
-
this.rafLoop(intervalMs);
|
|
90
|
-
}
|
|
91
|
-
addEventListener(type, listener, options) {
|
|
92
|
-
this.eventTarget.addEventListener(type, listener, options);
|
|
93
|
-
}
|
|
94
|
-
removeEventListener(type, listener, options) {
|
|
95
|
-
this.eventTarget.removeEventListener(type, listener, options);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Returns the latest cached frame as an {@link IncodeCanvas}.
|
|
99
|
-
*/
|
|
100
|
-
getLatestCanvas() {
|
|
101
|
-
if (!this.hasFrame) this.tick();
|
|
102
|
-
if (!this.hasFrame) return null;
|
|
103
|
-
return new IncodeCanvas(this.canvas);
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Returns the latest cached frame as raw {@link ImageData}.
|
|
107
|
-
*/
|
|
108
|
-
getLatestFrame() {
|
|
109
|
-
if (!this.ctx) return null;
|
|
110
|
-
if (!this.hasFrame) this.tick();
|
|
111
|
-
if (!this.hasFrame) return null;
|
|
112
|
-
try {
|
|
113
|
-
return this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height);
|
|
114
|
-
} catch {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Disposes internal resources and stops the capture loop.
|
|
120
|
-
*/
|
|
121
|
-
dispose() {
|
|
122
|
-
if (this.disposed) return;
|
|
123
|
-
this.disposed = true;
|
|
124
|
-
if (this.rafId !== void 0) {
|
|
125
|
-
window.cancelAnimationFrame(this.rafId);
|
|
126
|
-
this.rafId = void 0;
|
|
127
|
-
}
|
|
128
|
-
this.video.srcObject = null;
|
|
129
|
-
this.canvas.width = 0;
|
|
130
|
-
this.canvas.height = 0;
|
|
131
|
-
this.hasFrame = false;
|
|
132
|
-
}
|
|
133
|
-
rafLoop(intervalMs) {
|
|
134
|
-
const loop = (timeMs) => {
|
|
135
|
-
if (this.disposed) return;
|
|
136
|
-
if (intervalMs <= 0 || this.lastTickTimeMs === void 0 || timeMs - this.lastTickTimeMs >= intervalMs) {
|
|
137
|
-
this.lastTickTimeMs = timeMs;
|
|
138
|
-
const previousFrameTimeSeconds = this.lastFrameTimeSeconds;
|
|
139
|
-
this.tick();
|
|
140
|
-
const currentFrameTimeSeconds = this.video.currentTime;
|
|
141
|
-
if (previousFrameTimeSeconds === void 0) {
|
|
142
|
-
if (this.hasFrame) {
|
|
143
|
-
this.lastFrameTimeSeconds = currentFrameTimeSeconds;
|
|
144
|
-
this.eventTarget.dispatchEvent(new Event("frame"));
|
|
145
|
-
}
|
|
146
|
-
} else if (this.hasFrame && currentFrameTimeSeconds !== previousFrameTimeSeconds) {
|
|
147
|
-
this.lastFrameTimeSeconds = currentFrameTimeSeconds;
|
|
148
|
-
this.eventTarget.dispatchEvent(new Event("frame"));
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
this.rafId = window.requestAnimationFrame(loop);
|
|
152
|
-
};
|
|
153
|
-
this.rafId = window.requestAnimationFrame(loop);
|
|
154
|
-
}
|
|
155
|
-
tick() {
|
|
156
|
-
if (!this.ctx) return;
|
|
157
|
-
if (this.video.readyState < HTMLMediaElement.HAVE_CURRENT_DATA) return;
|
|
158
|
-
const videoWidth = this.video.videoWidth;
|
|
159
|
-
const videoHeight = this.video.videoHeight;
|
|
160
|
-
if (videoWidth === 0 || videoHeight === 0) return;
|
|
161
|
-
if (this.canvas.width !== videoWidth || this.canvas.height !== videoHeight) {
|
|
162
|
-
this.canvas.width = videoWidth;
|
|
163
|
-
this.canvas.height = videoHeight;
|
|
164
|
-
}
|
|
165
|
-
try {
|
|
166
|
-
this.ctx.drawImage(this.video, 0, 0);
|
|
167
|
-
this.hasFrame = true;
|
|
168
|
-
} catch {
|
|
169
|
-
this.hasFrame = false;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/internal/manualReview/manualReviewService.ts
|
|
176
|
-
async function flagFaceManualReview() {
|
|
177
|
-
try {
|
|
178
|
-
await api.put(endpoints.updateSession, { manualSelfieCheckNeeded: true });
|
|
179
|
-
} catch {}
|
|
180
|
-
}
|
|
181
|
-
async function flagIdManualReview() {
|
|
182
|
-
try {
|
|
183
|
-
await api.put(endpoints.updateSession, { manualIdCheckNeeded: true });
|
|
184
|
-
} catch {}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
//#endregion
|
|
188
|
-
//#region ../infra/src/providers/browser/openviduLazy.ts
|
|
189
|
-
let openViduImport;
|
|
190
|
-
async function loadOpenVidu() {
|
|
191
|
-
if (openViduImport) return openViduImport;
|
|
192
|
-
openViduImport = import("./lib-Cq5Wc-Hd.esm.js").then(__toDynamicImportESM(1));
|
|
193
|
-
return openViduImport;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region ../infra/src/providers/browser/OpenViduRecordingProvider.ts
|
|
198
|
-
function createHiddenContainer() {
|
|
199
|
-
const id = `inc_rec_${Math.random().toString(36).slice(2)}`;
|
|
200
|
-
const existing = document.getElementById(id);
|
|
201
|
-
if (existing) return {
|
|
202
|
-
id,
|
|
203
|
-
element: existing
|
|
204
|
-
};
|
|
205
|
-
const div = document.createElement("div");
|
|
206
|
-
div.id = id;
|
|
207
|
-
div.style.display = "none";
|
|
208
|
-
document.body.appendChild(div);
|
|
209
|
-
return {
|
|
210
|
-
id,
|
|
211
|
-
element: div
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
var OpenViduRecordingProvider = class {
|
|
215
|
-
async connect(params) {
|
|
216
|
-
const { OpenVidu } = await loadOpenVidu();
|
|
217
|
-
const container = createHiddenContainer();
|
|
218
|
-
const ov = new OpenVidu();
|
|
219
|
-
const session = ov.initSession();
|
|
220
|
-
const videoTrack = params.stream.getVideoTracks()[0];
|
|
221
|
-
const audioTrack = params.stream.getAudioTracks()[0];
|
|
222
|
-
const hasAudio = audioTrack !== void 0;
|
|
223
|
-
const publisher = ov.initPublisher(container.id, {
|
|
224
|
-
publishAudio: hasAudio,
|
|
225
|
-
audioSource: hasAudio ? audioTrack : false,
|
|
226
|
-
videoSource: videoTrack ?? false,
|
|
227
|
-
frameRate: 30
|
|
228
|
-
});
|
|
229
|
-
session.on("exception", (event) => {
|
|
230
|
-
const e = event;
|
|
231
|
-
params.events?.onSessionException?.({
|
|
232
|
-
name: e?.name,
|
|
233
|
-
message: e?.message,
|
|
234
|
-
sessionId: session.sessionId
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
publisher.on("streamCreated", () => {
|
|
238
|
-
params.events?.onPublisherCreated?.({
|
|
239
|
-
sessionId: session.sessionId,
|
|
240
|
-
streamId: publisher.stream?.streamId
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
await session.connect(params.sessionToken);
|
|
244
|
-
params.events?.onSessionConnected?.(session.sessionId);
|
|
245
|
-
try {
|
|
246
|
-
await session.publish(publisher);
|
|
247
|
-
} catch (error) {
|
|
248
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
249
|
-
params.events?.onPublisherError?.({
|
|
250
|
-
message,
|
|
251
|
-
sessionId: session.sessionId,
|
|
252
|
-
streamId: publisher.stream?.streamId
|
|
253
|
-
});
|
|
254
|
-
throw error;
|
|
255
|
-
}
|
|
256
|
-
return {
|
|
257
|
-
sessionId: session.sessionId,
|
|
258
|
-
publisher: {
|
|
259
|
-
getStreamId: () => publisher.stream?.streamId,
|
|
260
|
-
replaceVideoTrack: async (track) => {
|
|
261
|
-
await publisher.replaceTrack(track);
|
|
262
|
-
},
|
|
263
|
-
destroy: () => {}
|
|
264
|
-
},
|
|
265
|
-
disconnect: async () => {
|
|
266
|
-
try {
|
|
267
|
-
session.disconnect();
|
|
268
|
-
params.stream.getTracks().forEach((t) => {
|
|
269
|
-
t.stop();
|
|
270
|
-
});
|
|
271
|
-
} finally {
|
|
272
|
-
params.events?.onSessionDisconnected?.(session.sessionId);
|
|
273
|
-
if (container.element.parentNode) container.element.parentNode.removeChild(container.element);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
//#endregion
|
|
281
|
-
//#region ../infra/src/media/StreamCanvasProcessingSession.ts
|
|
282
|
-
var StreamCanvasProcessingSession = class {
|
|
283
|
-
/**
|
|
284
|
-
* Creates a processing session that reacts to `StreamCanvasCapture` frame events
|
|
285
|
-
* and drives a provider's `processFrame()` method with backpressure.
|
|
286
|
-
*/
|
|
287
|
-
constructor(params) {
|
|
288
|
-
this.disposed = false;
|
|
289
|
-
this.isProcessing = false;
|
|
290
|
-
this.onFrameEvent = () => {
|
|
291
|
-
if (this.disposed || this.isProcessing) return;
|
|
292
|
-
const frame = this.capturer.getLatestFrame();
|
|
293
|
-
if (!frame) return;
|
|
294
|
-
this.onFrame?.(frame);
|
|
295
|
-
this.isProcessing = true;
|
|
296
|
-
this.provider.processFrame(frame).catch(() => {}).finally(() => {
|
|
297
|
-
this.isProcessing = false;
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
this.capturer = params.capturer;
|
|
301
|
-
this.provider = params.provider;
|
|
302
|
-
this.onFrame = params.onFrame;
|
|
303
|
-
this.capturer.addEventListener("frame", this.onFrameEvent);
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Unsubscribes from frame events and resets the provider.
|
|
307
|
-
*/
|
|
308
|
-
dispose() {
|
|
309
|
-
if (this.disposed) return;
|
|
310
|
-
this.disposed = true;
|
|
311
|
-
this.capturer.removeEventListener("frame", this.onFrameEvent);
|
|
312
|
-
this.provider.reset();
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Returns whether the session has been disposed.
|
|
316
|
-
*/
|
|
317
|
-
isDisposed() {
|
|
318
|
-
return this.disposed;
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
//#endregion
|
|
323
|
-
//#region src/internal/recordings/recordingsRepository.ts
|
|
324
|
-
async function createRecordingSession(type) {
|
|
325
|
-
return (await api.post(endpoints.recordingCreateSessionV2, { type })).data;
|
|
326
|
-
}
|
|
327
|
-
async function startRecording(params) {
|
|
328
|
-
return (await api.post(endpoints.recordingStartV2, {
|
|
329
|
-
videoRecordingId: params.videoRecordingId,
|
|
330
|
-
frameRate: 30,
|
|
331
|
-
outputMode: "COMPOSED",
|
|
332
|
-
resolution: params.resolution,
|
|
333
|
-
type: params.type,
|
|
334
|
-
hasAudio: params.hasAudio ?? false
|
|
335
|
-
})).data;
|
|
336
|
-
}
|
|
337
|
-
async function stopRecording(videoRecordingId) {
|
|
338
|
-
return (await api.post(endpoints.recordingStopV2, { videoRecordingId })).data;
|
|
339
|
-
}
|
|
340
|
-
async function uploadDeepsightVideo(encryptedVideo, token) {
|
|
341
|
-
try {
|
|
342
|
-
return (await api.post(endpoints.deepsightVideoImport, {
|
|
343
|
-
video: encryptedVideo,
|
|
344
|
-
type: "selfie"
|
|
345
|
-
}, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
|
|
346
|
-
} catch {
|
|
347
|
-
return "";
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
//#endregion
|
|
352
|
-
export { StreamCanvasProcessingSession as a, flagIdManualReview as c, uploadDeepsightVideo as i, StreamCanvasCapture as l, startRecording as n, OpenViduRecordingProvider as o, stopRecording as r, flagFaceManualReview as s, createRecordingSession as t, BrowserStorageProvider as u };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|