@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
package/dist/session.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as GetFinishStatusFn, r as getFinishStatus, t as FinishStatus } from "./flowCompletionService-De8JDo87.js";
1
+ import { n as GetFinishStatusFn, r as getFinishStatus, t as FinishStatus } from "./flowCompletionService-C_CShl_d.js";
2
2
  export { type FinishStatus, type GetFinishStatusFn, getFinishStatus };
@@ -1,5 +1,5 @@
1
- import "./api-G4JA8CXK.esm.js";
1
+ import "./api-3fZO5bmj.esm.js";
2
2
  import "./endpoints-CCuj1KZH.esm.js";
3
- import { t as getFinishStatus } from "./flowCompletionService-Bkaerugt.esm.js";
3
+ import { t as getFinishStatus } from "./flowCompletionService-CBvXiMKa.esm.js";
4
4
 
5
5
  export { getFinishStatus };
@@ -1,7 +1,7 @@
1
- import { f as Manager, i as SignaturePadOptions, n as PointGroup, r as SignaturePad, t as BasicPoint } from "./index-BTaLQSj9.js";
1
+ import "./Actor-phIcsUhv.js";
2
+ import { t as Manager } from "./Manager-BndLda4_.js";
2
3
 
3
4
  //#region src/modules/signature/types.d.ts
4
-
5
5
  /**
6
6
  * Configuration options for Signature.
7
7
  * The flow is always: initials (Continue) → full signature (Done), then success.
@@ -88,4 +88,4 @@ declare function createSignatureManager(options: CreateSignatureActorOptions): M
88
88
  };
89
89
  type SignatureManager = ReturnType<typeof createSignatureManager>;
90
90
  //#endregion
91
- export { type BasicPoint, type CapturePhase, type PointGroup, type SignatureCaptureState, type SignatureConfig, type SignatureManager, SignaturePad, type SignaturePadOptions, type SignatureState, createSignatureManager, signatureMachine };
91
+ export { type CapturePhase, type SignatureCaptureState, type SignatureConfig, type SignatureManager, type SignatureState, createSignatureManager, signatureMachine };
@@ -1,6 +1,5 @@
1
- import { S as createActor, h as addEvent, n as eventModuleNames, o as createManagerInstrumentation, r as eventScreenNames, v as setup, x as fromPromise, y as assign } from "./events-Cc1xUUgF.esm.js";
2
- import { M as createManager, t as SignaturePad } from "./src-8rn6DoH7.esm.js";
3
- import { t as api } from "./api-G4JA8CXK.esm.js";
1
+ import { t as api } from "./api-3fZO5bmj.esm.js";
2
+ import { C as fromPromise, b as setup, g as addEvent, i as eventScreenNames, r as eventModuleNames, s as createManagerInstrumentation, t as createManager, w as createActor, x as assign } from "./Manager-D_DMzMWz.esm.js";
4
3
  import { t as endpoints } from "./endpoints-CCuj1KZH.esm.js";
5
4
 
6
5
  //#region src/modules/signature/signatureServices.ts
@@ -237,4 +236,4 @@ function createSignatureManager(options) {
237
236
  }
238
237
 
239
238
  //#endregion
240
- export { SignaturePad, createSignatureManager, signatureMachine };
239
+ export { createSignatureManager, signatureMachine };
@@ -1,4 +1,4 @@
1
- import { t as api } from "./api-G4JA8CXK.esm.js";
1
+ import { t as api } from "./api-3fZO5bmj.esm.js";
2
2
 
3
3
  //#region src/modules/stats/statsServices.ts
4
4
  /**
package/dist/stats.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./api-G4JA8CXK.esm.js";
2
- import { t as addDeviceStats } from "./stats-D0m3TvIg.esm.js";
1
+ import "./api-3fZO5bmj.esm.js";
2
+ import { t as addDeviceStats } from "./stats-D4C7iDy1.esm.js";
3
3
 
4
4
  export { addDeviceStats };
@@ -1,4 +1,4 @@
1
- import { d as CameraStream } from "./index-BTaLQSj9.js";
1
+ import { t as CameraStream } from "./camera-Dv2WEhGe.js";
2
2
 
3
3
  //#region src/modules/document-upload/types.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
- import { t as DocumentUploadConfig } from "./types-oveF7RrS.js";
1
+ import { t as DocumentUploadConfig } from "./types-BWGxcjiZ.js";
2
2
 
3
3
  //#region src/modules/flow/types.d.ts
4
4
  type EmptyConfig = Record<string, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "0.0.0-dev-20260402-682edb5",
3
+ "version": "0.0.0-dev-20260402-7cf9db4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,24 +0,0 @@
1
- import { d as VisibilityProvider, m as MotionSensorProvider, s as WasmUtilProvider, x as BrowserEnvironmentProvider } from "./src-8rn6DoH7.esm.js";
2
- import "./browserSimulation-C8gNnn5p.esm.js";
3
- import "./api-G4JA8CXK.esm.js";
4
- import { t as createDeepsightService } from "./deepsightService-CLUMQ5ee.esm.js";
5
- import "./stats-D0m3TvIg.esm.js";
6
-
7
- //#region src/internal/deepsight/deepsightLoader.ts
8
- const SDK_VERSION = "2.0.0";
9
- async function loadDeepsightSession(options) {
10
- await options.storage.set("ds", options.ds ? 1 : 0);
11
- const service = createDeepsightService({
12
- sdkVersion: SDK_VERSION,
13
- wasmUtil: await WasmUtilProvider.getInstance(),
14
- visibility: new VisibilityProvider(),
15
- browserEnv: new BrowserEnvironmentProvider(),
16
- motionSensor: new MotionSensorProvider()
17
- });
18
- await service.initialize(options.disableIpify);
19
- await service.startMotionSensors();
20
- return service;
21
- }
22
-
23
- //#endregion
24
- export { loadDeepsightSession };
@@ -1,235 +0,0 @@
1
- import { A as requestCameraAccess, D as IncodeCanvas, E as createHiddenVideoElement, F as getDeviceInfo, L as getUserAgent, j as stopCameraStream } from "./src-8rn6DoH7.esm.js";
2
- import { t as isBrowserSimulation } from "./browserSimulation-C8gNnn5p.esm.js";
3
- import { t as api } from "./api-G4JA8CXK.esm.js";
4
- import { t as addDeviceStats } from "./stats-D0m3TvIg.esm.js";
5
-
6
- //#region src/internal/deepsight/metadataService.ts
7
- const IP_PROVIDER_URL = "https://api.ipify.org?format=json";
8
- async function fetchPublicIp(browserEnv) {
9
- return (await browserEnv.fetchJson(IP_PROVIDER_URL, 3e3))?.ip || "";
10
- }
11
- function createMetadataService(wasmUtil, visibility, browserEnv) {
12
- return {
13
- async initialize(sdkVersion, disableIpify = false) {
14
- wasmUtil.setSdkPlatform("WEBAPP");
15
- wasmUtil.setSdkVersion(sdkVersion);
16
- const ua = getUserAgent();
17
- const isMobile = /Android|iPhone|iPad|iPod/i.test(ua);
18
- const deviceInfo = getDeviceInfo();
19
- const visitorId = browserEnv.generateCanvasFingerprint();
20
- const ip = disableIpify ? "" : await fetchPublicIp(browserEnv);
21
- const screenDimensions = browserEnv.getScreenDimensions();
22
- const deviceMetadata = {
23
- kind: isMobile ? "mobile" : "desktop",
24
- model: "",
25
- os: void 0,
26
- osVersion: void 0,
27
- screenDimensions,
28
- numTouchPoints: deviceInfo.maxTouchPoints,
29
- fingerprintHash: visitorId,
30
- ip,
31
- backgroundMode: false
32
- };
33
- wasmUtil.setDeviceInfo(deviceMetadata);
34
- const navigatorPrefixes = browserEnv.getNavigatorPrefixes();
35
- const browserInfo = {
36
- userAgent: ua,
37
- getUserMediaAvailability: {
38
- webkit: navigatorPrefixes.webkit,
39
- moz: navigatorPrefixes.moz,
40
- o: navigatorPrefixes.o,
41
- ms: navigatorPrefixes.ms
42
- },
43
- webglFingerprint: browserEnv.getWebGLRenderer(),
44
- inspectorOpened: false,
45
- isMockedBrowser: isBrowserSimulation(browserEnv)
46
- };
47
- wasmUtil.setBrowserInfo(browserInfo, false);
48
- },
49
- updateCameraInfo(videoTrack) {
50
- const settings = videoTrack.getSettings();
51
- const capabilities = videoTrack.getCapabilities?.() ?? {};
52
- const labels = videoTrack.label ? [videoTrack.label] : [];
53
- const cameraInfo = {
54
- facingMode: settings.facingMode === "user" ? "frontal" : settings.facingMode === "environment" ? "back" : settings.facingMode || "unknown",
55
- settings,
56
- capabilities,
57
- labels
58
- };
59
- wasmUtil.setCameraInfo(cameraInfo);
60
- },
61
- async checkForVirtualCameraByLabel(videoTrack = null) {
62
- try {
63
- if (!videoTrack) {
64
- const labels = await browserEnv.enumerateVideoDeviceLabels();
65
- for (const label of labels) if (wasmUtil.isVirtualCamera(label)) return true;
66
- }
67
- if (videoTrack && wasmUtil.isVirtualCamera(videoTrack.label)) return true;
68
- return false;
69
- } catch {
70
- return false;
71
- }
72
- },
73
- async analyzeFrame(imageData) {
74
- await wasmUtil.analyzeFrame(imageData);
75
- },
76
- setMotionStatus(status) {
77
- wasmUtil.setMotionStatus(status);
78
- },
79
- setBackgroundMode(backgroundMode) {
80
- wasmUtil.setBackgroundMode(backgroundMode || visibility.wasBackgrounded);
81
- visibility.reset();
82
- },
83
- estimatePerformance() {
84
- return wasmUtil.estimatePerformance();
85
- },
86
- getMetadata() {
87
- return wasmUtil.getMetadata();
88
- },
89
- getCheck() {
90
- return wasmUtil.getCheck();
91
- },
92
- getPipelineState() {
93
- return wasmUtil.getPipelineState();
94
- },
95
- preparePipelineState() {
96
- wasmUtil.getPipelineState();
97
- }
98
- };
99
- }
100
-
101
- //#endregion
102
- //#region src/internal/deepsight/motionStatusService.ts
103
- function createMotionStatusService(motionSensor) {
104
- return {
105
- async requestPermission() {
106
- return motionSensor.requestPermission();
107
- },
108
- async start() {
109
- await motionSensor.start();
110
- },
111
- stop() {
112
- motionSensor.stop();
113
- },
114
- check() {
115
- return motionSensor.check();
116
- },
117
- get isRunning() {
118
- return motionSensor.isRunning;
119
- },
120
- get hasPermission() {
121
- return motionSensor.hasPermission;
122
- }
123
- };
124
- }
125
-
126
- //#endregion
127
- //#region src/internal/virtualCameraCheck.ts
128
- /**
129
- * Sends the analyzed frame image to the backend for logging.
130
- */
131
- async function logFrame({ source, base64Image, token }) {
132
- try {
133
- return (await api.post("/omni/log/frame/v2", { base64Image }, {
134
- query: { source },
135
- headers: { "X-Incode-Hardware-Id": token }
136
- })).data;
137
- } catch {
138
- return;
139
- }
140
- }
141
- /**
142
- * Runs the WASM virtual camera check and handles logging and stats.
143
- */
144
- async function runVirtualCameraCheck({ wasmUtil, source, token }) {
145
- const output = {
146
- canvas: null,
147
- itr: null,
148
- skipped: null
149
- };
150
- await wasmUtil.poc(output);
151
- if (output.skipped !== false) return;
152
- if (output.canvas && token) {
153
- const base64Image = new IncodeCanvas(output.canvas).getBase64Image();
154
- if (base64Image) await logFrame({
155
- source,
156
- base64Image,
157
- token
158
- });
159
- }
160
- if (output.itr === true) {
161
- addDeviceStats({ virtualCameraDetected: true });
162
- wasmUtil.setZc("FAIL");
163
- } else if (output.itr === false) wasmUtil.setZc("PASS");
164
- }
165
-
166
- //#endregion
167
- //#region src/internal/deepsight/deepsightService.ts
168
- function createDeepsightService(config) {
169
- const metadata = createMetadataService(config.wasmUtil, config.visibility, config.browserEnv);
170
- const motion = createMotionStatusService(config.motionSensor);
171
- return {
172
- metadata,
173
- motion,
174
- async initialize(disableIpify = false) {
175
- await metadata.initialize(config.sdkVersion, disableIpify);
176
- metadata.estimatePerformance();
177
- },
178
- async requestMotionPermission() {
179
- return motion.requestPermission();
180
- },
181
- async startMotionSensors() {
182
- await motion.start();
183
- },
184
- stopMotionSensors() {
185
- motion.stop();
186
- },
187
- async checkVirtualCamera(videoTrack) {
188
- metadata.updateCameraInfo(videoTrack);
189
- return metadata.checkForVirtualCameraByLabel(videoTrack);
190
- },
191
- async performVirtualCameraCheck(sessionToken, source) {
192
- await runVirtualCameraCheck({
193
- wasmUtil: config.wasmUtil,
194
- source,
195
- token: sessionToken
196
- });
197
- },
198
- async performPrcCheck(params) {
199
- const prcStream = await requestCameraAccess(params.constraints);
200
- const hiddenVideo = createHiddenVideoElement(prcStream);
201
- try {
202
- await config.wasmUtil.prc();
203
- } finally {
204
- hiddenVideo.dispose();
205
- stopCameraStream(prcStream);
206
- }
207
- },
208
- async analyzeFrame(imageData) {
209
- await metadata.analyzeFrame(imageData);
210
- metadata.preparePipelineState();
211
- const motionStatus = motion.check();
212
- metadata.setMotionStatus(motionStatus);
213
- metadata.getCheck();
214
- metadata.setBackgroundMode(false);
215
- },
216
- getMetadata() {
217
- return metadata.getMetadata();
218
- },
219
- getMotionStatus() {
220
- return motion.check();
221
- },
222
- getAnalysisStatus() {
223
- return metadata.getCheck();
224
- },
225
- getPipelineState() {
226
- return metadata.getPipelineState();
227
- },
228
- cleanup() {
229
- motion.stop();
230
- }
231
- };
232
- }
233
-
234
- //#endregion
235
- export { createDeepsightService as t };
@@ -1,219 +0,0 @@
1
- import { ActorRefFrom as ActorRefFrom$1, AnyStateMachine, StateMachine, createActor, fromPromise } from "xstate";
2
- import SignaturePad, { BasicPoint, Options as SignaturePadOptions, PointGroup } from "signature_pad";
3
-
4
- //#region ../infra/src/media/canvas.d.ts
5
- /**
6
- * Class representing a canvas element for image capture and manipulation.
7
- */
8
- declare class IncodeCanvas {
9
- canvas: HTMLCanvasElement;
10
- private base64Image;
11
- private blobData;
12
- /**
13
- * Creates an {@link IncodeCanvas} from a raw {@link ImageData} frame.
14
- * @param imageData - Frame pixels in RGBA format
15
- * @returns An {@link IncodeCanvas} containing the provided pixels
16
- */
17
- static fromImageData(imageData: ImageData): IncodeCanvas;
18
- /**
19
- * Create a new canvas element.
20
- * @param canvas_ - The canvas element to clone.
21
- */
22
- constructor(canvas_: HTMLCanvasElement);
23
- /**
24
- * Check if the current canvas is valid.
25
- */
26
- private checkCanvas;
27
- /**
28
- * Disposes of resources, including revoking object URLs to prevent memory leaks.
29
- */
30
- dispose(): void;
31
- /**
32
- * Release the data stored by IncodeCanvas.
33
- */
34
- release(): void;
35
- /**
36
- * Revokes the object URL if one exists, preventing memory leaks.
37
- * Use this when you no longer need the preview image URL.
38
- */
39
- revokeObjectURL(): void;
40
- /**
41
- * Get the width of the canvas.
42
- */
43
- width(): number | null;
44
- /**
45
- * Get the height of the canvas.
46
- */
47
- height(): number | null;
48
- /**
49
- * Set the width of the canvas.
50
- */
51
- setWidth(width: number): void;
52
- /**
53
- * Set the height of the canvas.
54
- */
55
- setHeight(height: number): void;
56
- /**
57
- * Clone the current canvas.
58
- */
59
- clone(): IncodeCanvas | null;
60
- /**
61
- * Deep clone the current IncodeCanvas including blob data.
62
- */
63
- deepClone(): Promise<IncodeCanvas | null>;
64
- /**
65
- * Returns the drawing context on the canvas.
66
- */
67
- getContext(contextId: '2d', contextAttributes?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;
68
- /**
69
- * Retrieves the image data from the canvas.
70
- */
71
- getImageData(): ImageData | null;
72
- /**
73
- * Updates the base64 representation of the current canvas image.
74
- */
75
- updateBase64Image(jpegQuality?: number): void;
76
- /**
77
- * Converts the current canvas element to a base64 string.
78
- */
79
- getBase64Image(jpegQuality?: number, includeDataURLPrefix?: boolean): string | null;
80
- /**
81
- * Sets the base64 representation of the current canvas image.
82
- */
83
- setBase64Image(base64Image: string | null): void;
84
- /**
85
- * Updates the Blob representation of the current canvas image.
86
- */
87
- updateBlob(jpegQuality?: number, includeDataURLPrefix?: boolean): void;
88
- /**
89
- * Converts a base64 string to a Blob and creates a URL for it.
90
- */
91
- static base64ToBlob(base64: string): {
92
- blob: Blob;
93
- url: string;
94
- } | null;
95
- /**
96
- * Retrieves the Blob data and its URL from the current canvas.
97
- */
98
- getBlobData(jpegQuality?: number, includeDataURLPrefix?: boolean): {
99
- blob: Blob;
100
- url: string;
101
- } | null;
102
- /**
103
- * Sets the Blob data of the current canvas image.
104
- */
105
- setBlobData(blobData: {
106
- blob: Blob;
107
- url: string;
108
- }): Promise<void>;
109
- /**
110
- * Returns a resized canvas according to video element size.
111
- */
112
- getResizedCanvas(videoElementWidth: number, videoElementHeight: number): IncodeCanvas | null;
113
- }
114
- //#endregion
115
- //#region ../infra/src/http/types.d.ts
116
- type CreateApiConfig = {
117
- apiURL: string;
118
- customHeaders?: Record<string, string>;
119
- timeout?: number;
120
- };
121
- type RequestConfig = {
122
- method?: string;
123
- url: string;
124
- headers?: Record<string, string>;
125
- query?: Record<string, string | number | boolean | undefined>;
126
- params?: Record<string, string | number | boolean | undefined>;
127
- body?: unknown;
128
- signal?: AbortSignal;
129
- timeout?: number;
130
- parse?: 'json' | 'text' | 'blob' | 'arrayBuffer' | 'response';
131
- onUploadProgress?: (progress: number) => void;
132
- };
133
- type HttpResponse<T = unknown> = {
134
- ok: boolean;
135
- status: number;
136
- statusText: string;
137
- url: string;
138
- headers: Record<string, string>;
139
- data: T;
140
- };
141
- type HttpClient = {
142
- defaults: {
143
- baseURL: string;
144
- headers: Record<string, string>;
145
- };
146
- request<T = unknown>(config: RequestConfig): Promise<HttpResponse<T>>;
147
- get<T = unknown>(url: string, config?: Omit<RequestConfig, 'method' | 'url'>): Promise<HttpResponse<T>>;
148
- post<T = unknown>(url: string, body?: unknown, config?: Omit<RequestConfig, 'method' | 'url' | 'body'>): Promise<HttpResponse<T>>;
149
- put<T = unknown>(url: string, body?: unknown, config?: Omit<RequestConfig, 'method' | 'url' | 'body'>): Promise<HttpResponse<T>>;
150
- patch<T = unknown>(url: string, body?: unknown, config?: Omit<RequestConfig, 'method' | 'url' | 'body'>): Promise<HttpResponse<T>>;
151
- delete<T = unknown>(url: string, config?: Omit<RequestConfig, 'method' | 'url'>): Promise<HttpResponse<T>>;
152
- head<T = unknown>(url: string, config?: Omit<RequestConfig, 'method' | 'url'>): Promise<HttpResponse<T>>;
153
- options<T = unknown>(url: string, config?: Omit<RequestConfig, 'method' | 'url'>): Promise<HttpResponse<T>>;
154
- setHeader(name: string, value: string): void;
155
- };
156
- //#endregion
157
- //#region ../infra/src/http/createApi.d.ts
158
- declare const createApi: (config: CreateApiConfig) => HttpClient;
159
- //#endregion
160
- //#region ../infra/src/manager/Manager.d.ts
161
- /**
162
- * Base manager interface providing state access, subscriptions, and lifecycle control.
163
- * @template TPublicState - The public state type exposed to consumers
164
- */
165
- type Manager<TPublicState> = {
166
- /** Returns the current mapped public state */
167
- getState(): TPublicState;
168
- /**
169
- * Subscribes to state changes.
170
- * @param listener - Callback invoked on every state change
171
- * @returns Unsubscribe function to stop receiving updates
172
- */
173
- subscribe(listener: (state: TPublicState) => void): () => void;
174
- /** Stops the underlying actor and cleans up resources */
175
- stop(): void;
176
- };
177
- //#endregion
178
- //#region ../infra/src/media/camera.d.ts
179
- type CameraStream = MediaStream;
180
- //#endregion
181
- //#region ../infra/src/media/StreamCanvasCapture.d.ts
182
- type StreamCanvasCaptureOptions = {
183
- fps?: number;
184
- width?: number;
185
- height?: number;
186
- };
187
- type StreamCanvasCaptureEventMap = {
188
- frame: Event;
189
- };
190
- declare class StreamCanvasCapture {
191
- private video;
192
- private canvas;
193
- private ctx;
194
- private rafId;
195
- private lastFrameTimeSeconds;
196
- private lastTickTimeMs;
197
- private hasFrame;
198
- private disposed;
199
- private eventTarget;
200
- constructor(stream: CameraStream, options?: StreamCanvasCaptureOptions);
201
- addEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
202
- removeEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
203
- /**
204
- * Returns the latest cached frame as an {@link IncodeCanvas}.
205
- */
206
- getLatestCanvas(): IncodeCanvas | null;
207
- /**
208
- * Returns the latest cached frame as raw {@link ImageData}.
209
- */
210
- getLatestFrame(): ImageData | null;
211
- /**
212
- * Disposes internal resources and stops the capture loop.
213
- */
214
- dispose(): void;
215
- private rafLoop;
216
- private tick;
217
- }
218
- //#endregion
219
- export { AnyStateMachine as a, ActorRefFrom$1 as c, CameraStream as d, Manager as f, IncodeCanvas as g, HttpResponse as h, SignaturePadOptions as i, createActor as l, HttpClient as m, PointGroup as n, StateMachine as o, createApi as p, SignaturePad as r, fromPromise as s, BasicPoint as t, StreamCanvasCapture as u };
@@ -1,122 +0,0 @@
1
- import { A as requestCameraAccess, F as getDeviceInfo, L as getUserAgent, T as queryCameraPermission, V as isIPad, j as stopCameraStream, m as MotionSensorProvider } from "./src-8rn6DoH7.esm.js";
2
- import { t as api } from "./api-G4JA8CXK.esm.js";
3
- import { t as endpoints } from "./endpoints-CCuj1KZH.esm.js";
4
-
5
- //#region src/internal/device/getBrowser.ts
6
- function getBrowser() {
7
- const userAgent = getUserAgent();
8
- if (!userAgent) return "other";
9
- const ua = userAgent.toLowerCase();
10
- if (ua.includes("edg/") || ua.includes("edgios/")) return "edge";
11
- if (ua.includes("samsungbrowser/")) return "samsung_browser";
12
- if (ua.includes("opr/") || ua.includes("opera") || ua.includes("opios/") || ua.includes("opt/")) return "opera";
13
- if (ua.includes("chrome") || ua.includes("crios")) return "chrome";
14
- if (ua.includes("firefox") || ua.includes("fxios")) return "firefox";
15
- if (ua.includes("safari")) return "safari";
16
- return "other";
17
- }
18
-
19
- //#endregion
20
- //#region src/internal/device/getDeviceClass.ts
21
- function getDeviceClass() {
22
- const { userAgent, platform, maxTouchPoints } = getDeviceInfo();
23
- if (!userAgent) return "desktop";
24
- const ua = userAgent.toLowerCase();
25
- if (/iphone|ipad|ipod/.test(ua) || platform === "MacIntel" && maxTouchPoints > 1) return "ios";
26
- if (/android/.test(ua)) return "android";
27
- return "desktop";
28
- }
29
-
30
- //#endregion
31
- //#region src/internal/device/screenOrientation.ts
32
- function createScreenOrientationObserver(provider, deviceClass) {
33
- const getIsLandscapeMobile = () => deviceClass !== "desktop" && !isIPad() && provider.current === "landscape";
34
- return {
35
- get isLandscapeMobile() {
36
- return getIsLandscapeMobile();
37
- },
38
- subscribe(callback) {
39
- return provider.subscribe(() => {
40
- callback(getIsLandscapeMobile());
41
- });
42
- },
43
- cleanup: () => provider.cleanup()
44
- };
45
- }
46
-
47
- //#endregion
48
- //#region src/internal/manualReview/manualReviewService.ts
49
- async function flagFaceManualReview() {
50
- try {
51
- await api.put(endpoints.updateSession, { manualSelfieCheckNeeded: true });
52
- } catch {}
53
- }
54
- async function flagIdManualReview() {
55
- try {
56
- await api.put(endpoints.updateSession, { manualIdCheckNeeded: true });
57
- } catch {}
58
- }
59
-
60
- //#endregion
61
- //#region src/internal/permissions/permissionServices.ts
62
- /**
63
- * Checks the current camera permission state without prompting the user.
64
- */
65
- async function checkPermission() {
66
- return queryCameraPermission();
67
- }
68
- /**
69
- * Requests motion sensor permission. Must be called during a user gesture on iOS.
70
- * Returns the permission result.
71
- */
72
- async function requestMotionPermission() {
73
- return new MotionSensorProvider().requestPermission();
74
- }
75
- /**
76
- * Requests camera permission by attempting to access the camera, then immediately
77
- * stops the obtained stream. Also requests motion sensor permission (required on iOS
78
- * to be called during a user gesture). This function does not keep or return the stream.
79
- */
80
- async function requestPermission() {
81
- try {
82
- await requestMotionPermission();
83
- stopCameraStream(await requestCameraAccess({ video: true }));
84
- return "granted";
85
- } catch (error) {
86
- const name = error instanceof Error ? error.name : void 0;
87
- if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
88
- return "prompt";
89
- }
90
- }
91
-
92
- //#endregion
93
- //#region src/internal/recordings/recordingsRepository.ts
94
- async function createRecordingSession(type) {
95
- return (await api.post(endpoints.recordingCreateSessionV2, { type })).data;
96
- }
97
- async function startRecording(params) {
98
- return (await api.post(endpoints.recordingStartV2, {
99
- videoRecordingId: params.videoRecordingId,
100
- frameRate: 30,
101
- outputMode: "COMPOSED",
102
- resolution: params.resolution,
103
- type: params.type,
104
- hasAudio: params.hasAudio ?? false
105
- })).data;
106
- }
107
- async function stopRecording(videoRecordingId) {
108
- return (await api.post(endpoints.recordingStopV2, { videoRecordingId })).data;
109
- }
110
- async function uploadDeepsightVideo(encryptedVideo, token) {
111
- try {
112
- return (await api.post(endpoints.deepsightVideoImport, {
113
- video: encryptedVideo,
114
- type: "selfie"
115
- }, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
116
- } catch {
117
- return "";
118
- }
119
- }
120
-
121
- //#endregion
122
- export { checkPermission as a, flagIdManualReview as c, getBrowser as d, uploadDeepsightVideo as i, createScreenOrientationObserver as l, startRecording as n, requestPermission as o, stopRecording as r, flagFaceManualReview as s, createRecordingSession as t, getDeviceClass as u };