@incodetech/core 2.0.0-alpha.10 → 2.0.0-alpha.12

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 (33) hide show
  1. package/dist/{OpenViduLogger-CQyDxBvM.esm.js → OpenViduLogger-CRbRNZA7.esm.js} +1 -1
  2. package/dist/OpenViduLogger-Dy5P806a.esm.js +3 -0
  3. package/dist/{warmup-CEJTfxQr.d.ts → StateMachine-pi8byl8C.d.ts} +4 -1
  4. package/dist/{addEvent-W0ORK0jT.esm.js → addEvent-BGKc_lHF.esm.js} +1 -1
  5. package/dist/deepsightLoader-B36_XZ7r.esm.js +25 -0
  6. package/dist/deepsightService-BWxcc4OC.esm.js +225 -0
  7. package/dist/email.d.ts +1 -1
  8. package/dist/email.esm.js +3 -3
  9. package/dist/{endpoints-BSTFaHYo.esm.js → endpoints-D9TGnxRK.esm.js} +966 -22
  10. package/dist/flow.d.ts +4 -303
  11. package/dist/flow.esm.js +4 -5
  12. package/dist/id-CJKLe8HS.esm.js +1818 -0
  13. package/dist/id.d.ts +6 -0
  14. package/dist/id.esm.js +8 -0
  15. package/dist/index-CbF_uI-x.d.ts +618 -0
  16. package/dist/index.d.ts +8 -3
  17. package/dist/index.esm.js +7 -3
  18. package/dist/{lib-Bu9XGMBW.esm.js → lib-BJoLTN_W.esm.js} +2 -2
  19. package/dist/phone.d.ts +1 -1
  20. package/dist/phone.esm.js +3 -3
  21. package/dist/recordingsRepository-D5MURoVB.esm.js +40 -0
  22. package/dist/selfie.d.ts +77 -317
  23. package/dist/selfie.esm.js +165 -62
  24. package/dist/{permissionServices-I6vX6DBy.esm.js → streamingEvents-B3hNanPl.esm.js} +34 -9
  25. package/dist/types-BpCrZLU6.d.ts +302 -0
  26. package/dist/types-DZbrbPgj.d.ts +335 -0
  27. package/package.json +6 -2
  28. package/dist/OpenViduLogger-BdPfiZO6.esm.js +0 -3
  29. package/dist/StateMachine-DRE1oH2B.d.ts +0 -2
  30. package/dist/types-iZi2rawo.d.ts +0 -5
  31. /package/dist/{Manager-BGfxEmyv.d.ts → Manager-BZUZTRPx.d.ts} +0 -0
  32. /package/dist/{chunk-C_Yo44FK.esm.js → chunk-FbsBJI8u.esm.js} +0 -0
  33. /package/dist/{xstate.esm-B_rda9yU.esm.js → xstate.esm-2hDiAXvZ.esm.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as __commonJS } from "./chunk-C_Yo44FK.esm.js";
1
+ import { t as __commonJS } from "./chunk-FbsBJI8u.esm.js";
2
2
 
3
3
  //#region ../../node_modules/.pnpm/jsnlog@2.30.0/node_modules/jsnlog/jsnlog.js
4
4
  var require_jsnlog = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jsnlog@2.30.0/node_modules/jsnlog/jsnlog.js": ((exports) => {
@@ -0,0 +1,3 @@
1
+ import { t as require_OpenViduLogger } from "./OpenViduLogger-CRbRNZA7.esm.js";
2
+
3
+ export default require_OpenViduLogger();
@@ -1,4 +1,7 @@
1
+ import { AnyStateMachine, StateMachine } from "xstate";
2
+
1
3
  //#region ../infra/src/wasm/warmup.d.ts
4
+
2
5
  /**
3
6
  * All available ML pipelines in the SDK.
4
7
  * - 'selfie' - Face detection for selfie capture
@@ -52,4 +55,4 @@ interface WarmupConfig {
52
55
  */
53
56
  declare function warmupWasm(config: WarmupConfig): Promise<void>;
54
57
  //#endregion
55
- export { warmupWasm as n, WasmPipeline as t };
58
+ export { warmupWasm as i, StateMachine as n, WasmPipeline as r, AnyStateMachine as t };
@@ -1,4 +1,4 @@
1
- import { n as api, t as endpoints } from "./endpoints-BSTFaHYo.esm.js";
1
+ import { n as api, t as endpoints } from "./endpoints-D9TGnxRK.esm.js";
2
2
 
3
3
  //#region src/internal/events/addEvent.ts
4
4
  function addEvent(event) {
@@ -0,0 +1,25 @@
1
+ import { _ as DeepsightRecordingProvider, g as MotionSensorProvider, m as VisibilityProvider, u as WasmUtilProvider } from "./endpoints-D9TGnxRK.esm.js";
2
+ import { i as uploadDeepsightVideo } from "./recordingsRepository-D5MURoVB.esm.js";
3
+ import { t as createDeepsightService } from "./deepsightService-BWxcc4OC.esm.js";
4
+
5
+ //#region src/modules/selfie/deepsightLoader.ts
6
+ const SDK_VERSION = "2.0.0";
7
+ async function loadDeepsightSession() {
8
+ const service = createDeepsightService({
9
+ sdkVersion: SDK_VERSION,
10
+ wasmUtil: await WasmUtilProvider.getInstance(),
11
+ visibility: new VisibilityProvider(),
12
+ motionSensor: new MotionSensorProvider(),
13
+ recorder: new DeepsightRecordingProvider(),
14
+ uploadVideo: async (encryptedVideo, token) => {
15
+ return await uploadDeepsightVideo(encryptedVideo, token);
16
+ }
17
+ });
18
+ await service.initialize();
19
+ await service.requestMotionPermission();
20
+ await service.startMotionSensors();
21
+ return service;
22
+ }
23
+
24
+ //#endregion
25
+ export { loadDeepsightSession };
@@ -0,0 +1,225 @@
1
+ import { a as getUserAgent } from "./recordingsRepository-D5MURoVB.esm.js";
2
+
3
+ //#region src/internal/deepsight/metadataService.ts
4
+ function getWebGLFingerprint() {
5
+ try {
6
+ const canvas = document.createElement("canvas");
7
+ const gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
8
+ if (!gl) return "";
9
+ const debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
10
+ if (!debugInfo) return "";
11
+ return gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) || "";
12
+ } catch {
13
+ return "";
14
+ }
15
+ }
16
+ function isBrowserSimulation() {
17
+ const win = window;
18
+ const nav = navigator;
19
+ return !!(win.callPhantom || win._phantom || win.phantom || win.__nightmare || nav.webdriver || win.domAutomation || win.domAutomationController);
20
+ }
21
+ async function getFingerPrint(disableIpify = false) {
22
+ let visitorId = "";
23
+ let ip = "";
24
+ try {
25
+ const canvas = document.createElement("canvas");
26
+ const ctx = canvas.getContext("2d");
27
+ if (ctx) {
28
+ ctx.textBaseline = "top";
29
+ ctx.font = "14px Arial";
30
+ ctx.fillText("fingerprint", 2, 2);
31
+ visitorId = canvas.toDataURL().slice(-50);
32
+ }
33
+ } catch {}
34
+ if (!disableIpify) try {
35
+ const controller = new AbortController();
36
+ const timeoutId = setTimeout(() => controller.abort(), 3e3);
37
+ const response = await fetch("https://api.ipify.org?format=json", { signal: controller.signal });
38
+ clearTimeout(timeoutId);
39
+ ip = (await response.json()).ip || "";
40
+ } catch {}
41
+ return {
42
+ visitorId,
43
+ ip
44
+ };
45
+ }
46
+ function createMetadataService(wasmUtil, visibility) {
47
+ return {
48
+ async initialize(sdkVersion, disableIpify = false) {
49
+ wasmUtil.setSdkPlatform("WEBAPP");
50
+ wasmUtil.setSdkVersion(sdkVersion);
51
+ const ua = getUserAgent();
52
+ const isMobile = /Android|iPhone|iPad|iPod/i.test(ua);
53
+ const fingerPrint = await getFingerPrint(disableIpify).catch(() => ({
54
+ visitorId: "",
55
+ ip: ""
56
+ }));
57
+ const deviceMetadata = {
58
+ kind: isMobile ? "mobile" : "desktop",
59
+ model: "",
60
+ os: void 0,
61
+ osVersion: void 0,
62
+ screenDimensions: {
63
+ width: screen.width,
64
+ height: screen.height
65
+ },
66
+ numTouchPoints: navigator.maxTouchPoints,
67
+ fingerprintHash: fingerPrint.visitorId || "",
68
+ ip: fingerPrint.ip || "",
69
+ backgroundMode: false
70
+ };
71
+ wasmUtil.setDeviceInfo(deviceMetadata);
72
+ const nav = navigator;
73
+ const browserInfo = {
74
+ userAgent: ua,
75
+ getUserMediaAvailability: {
76
+ webkit: nav.webkitGetUserMedia !== void 0,
77
+ moz: nav.mozGetUserMedia !== void 0,
78
+ o: nav.oGetUserMedia !== void 0,
79
+ ms: nav.msGetUserMedia !== void 0
80
+ },
81
+ webglFingerprint: getWebGLFingerprint(),
82
+ inspectorOpened: false,
83
+ isMockedBrowser: isBrowserSimulation()
84
+ };
85
+ wasmUtil.setBrowserInfo(browserInfo, false);
86
+ },
87
+ updateCameraInfo(videoTrack) {
88
+ const settings = videoTrack.getSettings();
89
+ const capabilities = videoTrack.getCapabilities?.() ?? {};
90
+ const labels = videoTrack.label ? [videoTrack.label] : [];
91
+ const cameraInfo = {
92
+ facingMode: settings.facingMode === "user" ? "frontal" : settings.facingMode === "environment" ? "back" : settings.facingMode || "unknown",
93
+ settings,
94
+ capabilities,
95
+ labels
96
+ };
97
+ wasmUtil.setCameraInfo(cameraInfo);
98
+ },
99
+ async checkForVirtualCameraByLabel(videoTrack = null) {
100
+ try {
101
+ if (!videoTrack) {
102
+ const devices = await navigator.mediaDevices.enumerateDevices();
103
+ for (const device of devices) if (device.kind === "videoinput" && wasmUtil.isVirtualCamera(device.label)) return true;
104
+ }
105
+ if (videoTrack && wasmUtil.isVirtualCamera(videoTrack.label)) return true;
106
+ return false;
107
+ } catch {
108
+ return false;
109
+ }
110
+ },
111
+ async analyzeFrame(imageData) {
112
+ await wasmUtil.analyzeFrame(imageData);
113
+ },
114
+ setMotionStatus(status) {
115
+ wasmUtil.setMotionStatus(status);
116
+ },
117
+ setBackgroundMode(backgroundMode) {
118
+ wasmUtil.setBackgroundMode(backgroundMode || visibility.wasBackgrounded);
119
+ visibility.reset();
120
+ },
121
+ estimatePerformance() {
122
+ return wasmUtil.estimatePerformance();
123
+ },
124
+ getMetadata() {
125
+ return wasmUtil.getMetadata();
126
+ },
127
+ getCheck() {
128
+ return wasmUtil.getCheck();
129
+ }
130
+ };
131
+ }
132
+
133
+ //#endregion
134
+ //#region src/internal/deepsight/motionStatusService.ts
135
+ function createMotionStatusService(motionSensor) {
136
+ return {
137
+ async requestPermission() {
138
+ return motionSensor.requestPermission();
139
+ },
140
+ async start() {
141
+ await motionSensor.start();
142
+ },
143
+ stop() {
144
+ motionSensor.stop();
145
+ },
146
+ check() {
147
+ return motionSensor.check();
148
+ },
149
+ get isRunning() {
150
+ return motionSensor.isRunning;
151
+ },
152
+ get hasPermission() {
153
+ return motionSensor.hasPermission;
154
+ }
155
+ };
156
+ }
157
+
158
+ //#endregion
159
+ //#region src/internal/deepsight/deepsightService.ts
160
+ function createDeepsightService(config) {
161
+ const metadata = createMetadataService(config.wasmUtil, config.visibility);
162
+ const motion = createMotionStatusService(config.motionSensor);
163
+ return {
164
+ metadata,
165
+ motion,
166
+ recorder: config.recorder,
167
+ async initialize(disableIpify = false) {
168
+ await metadata.initialize(config.sdkVersion, disableIpify);
169
+ metadata.estimatePerformance();
170
+ },
171
+ async requestMotionPermission() {
172
+ return motion.requestPermission();
173
+ },
174
+ async startMotionSensors() {
175
+ await motion.start();
176
+ },
177
+ stopMotionSensors() {
178
+ motion.stop();
179
+ },
180
+ startRecording(stream) {
181
+ config.recorder.startRecording(stream);
182
+ },
183
+ async checkVirtualCamera(videoTrack) {
184
+ metadata.updateCameraInfo(videoTrack);
185
+ return metadata.checkForVirtualCameraByLabel(videoTrack);
186
+ },
187
+ async performVirtualCameraCheck() {
188
+ const output = {
189
+ canvas: null,
190
+ itr: null,
191
+ skipped: null
192
+ };
193
+ await config.wasmUtil.poc(output);
194
+ if (output?.skipped === false) config.wasmUtil.setZc(output?.itr === true ? "FAIL" : "PASS");
195
+ },
196
+ async performCapture(sessionToken, imageData) {
197
+ let recordingId = null;
198
+ if (config.recorder.isRecording) {
199
+ const result = await config.recorder.stopRecording(10, (base64) => config.wasmUtil.encryptImage(base64), (buffer) => config.wasmUtil.ckvcks(buffer));
200
+ try {
201
+ recordingId = await config.uploadVideo(result.encryptedVideo, sessionToken);
202
+ } catch (error) {
203
+ console.error("[DeepsightService] Failed to upload video:", error);
204
+ }
205
+ }
206
+ await this.performVirtualCameraCheck();
207
+ await metadata.analyzeFrame(imageData);
208
+ const motionStatus = motion.check();
209
+ metadata.setMotionStatus(motionStatus);
210
+ metadata.getCheck();
211
+ metadata.setBackgroundMode(false);
212
+ return {
213
+ metadata: metadata.getMetadata(),
214
+ recordingId
215
+ };
216
+ },
217
+ cleanup() {
218
+ motion.stop();
219
+ config.recorder.reset();
220
+ }
221
+ };
222
+ }
223
+
224
+ //#endregion
225
+ export { createDeepsightService as t };
package/dist/email.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Manager } from "./Manager-BGfxEmyv.js";
1
+ import { t as Manager } from "./Manager-BZUZTRPx.js";
2
2
 
3
3
  //#region src/modules/email/types.d.ts
4
4
 
package/dist/email.esm.js CHANGED
@@ -1,6 +1,6 @@
1
- import { g as createManager, n as api, t as endpoints } from "./endpoints-BSTFaHYo.esm.js";
2
- import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-B_rda9yU.esm.js";
3
- import { t as addEvent } from "./addEvent-W0ORK0jT.esm.js";
1
+ import { E as createManager, n as api, t as endpoints } from "./endpoints-D9TGnxRK.esm.js";
2
+ import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-2hDiAXvZ.esm.js";
3
+ import { t as addEvent } from "./addEvent-BGKc_lHF.esm.js";
4
4
 
5
5
  //#region src/modules/email/emailServices.ts
6
6
  async function fetchEmail(signal) {