@incodetech/core 0.0.0-dev-20260224-e49e03c → 0.0.0-dev-20260226-4cb58f5

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 (49) hide show
  1. package/dist/authentication.d.ts +8 -7
  2. package/dist/authentication.esm.js +9 -8
  3. package/dist/{backCameraStream-CCvHeGHQ.esm.js → backCameraStream-Ly-xbK9L.esm.js} +2 -103
  4. package/dist/curp-validation.d.ts +3 -2
  5. package/dist/curp-validation.esm.js +4 -4
  6. package/dist/{deepsightLoader-UBRWJ3MQ.esm.js → deepsightLoader-nGQDTgVU.esm.js} +4 -4
  7. package/dist/{deepsightService-Bn05rSAa.esm.js → deepsightService-CpmpXOnj.esm.js} +3 -3
  8. package/dist/{deepsightService-Un1ZwAHH.d.ts → deepsightService-p7oLftiG.d.ts} +1 -1
  9. package/dist/document-upload.d.ts +329 -0
  10. package/dist/document-upload.esm.js +194 -0
  11. package/dist/email.d.ts +1 -1
  12. package/dist/email.esm.js +4 -4
  13. package/dist/{endpoints-DXp63GM6.esm.js → endpoints-BK1EjE1H.esm.js} +2 -1
  14. package/dist/{events-h8K9H3OM.esm.js → events-DuBPhaxY.esm.js} +2 -2
  15. package/dist/face-match.d.ts +1 -1
  16. package/dist/face-match.esm.js +4 -4
  17. package/dist/{faceCaptureManagerFactory-CWGzTGlG.d.ts → faceCaptureManagerFactory-5Blo_gz0.d.ts} +5 -4
  18. package/dist/{faceCaptureSetup-BflAHwmc.esm.js → faceCaptureSetup-JLWm8_vt.esm.js} +8 -7
  19. package/dist/flow.d.ts +6 -5
  20. package/dist/flow.esm.js +6 -10
  21. package/dist/geolocation.d.ts +1 -1
  22. package/dist/geolocation.esm.js +4 -4
  23. package/dist/government-validation.d.ts +1 -1
  24. package/dist/government-validation.esm.js +3 -3
  25. package/dist/{id-CDh0aJOJ.esm.js → id-Dc5SneKA.esm.js} +9 -8
  26. package/dist/id.d.ts +8 -7
  27. package/dist/id.esm.js +9 -8
  28. package/dist/{index-O5gB82Up.d.ts → index-B_VIYINf.d.ts} +7 -6
  29. package/dist/index.d.ts +9 -8
  30. package/dist/index.esm.js +9 -8
  31. package/dist/{lib-DtNtprlI.esm.js → lib-EkjqkOuB.esm.js} +1 -1
  32. package/dist/phone.d.ts +1 -1
  33. package/dist/phone.esm.js +4 -4
  34. package/dist/selfie.d.ts +8 -7
  35. package/dist/selfie.esm.js +9 -8
  36. package/dist/{src-t0pt3B2r.esm.js → src-Bjg2C1oP.esm.js} +2 -2
  37. package/dist/{stats-GJMiTm5k.esm.js → stats-Baxc8J0w.esm.js} +1 -1
  38. package/dist/stats.esm.js +2 -2
  39. package/dist/streamingEvents-BrVlVGe7.esm.js +104 -0
  40. package/dist/types-B3jgq_IJ.d.ts +24 -0
  41. package/dist/{types-ee3LkWku.d.ts → types-CLuw51tO.d.ts} +1 -4
  42. package/dist/{types-c0XgGLsM.d.ts → types-Skrj9_8y.d.ts} +3 -1
  43. package/package.json +8 -4
  44. /package/dist/{Actor-Chvt8rE9.d.ts → Actor-DYtyiYF1.d.ts} +0 -0
  45. /package/dist/{Manager-DM1NlCX4.d.ts → Manager-C647XkuZ.d.ts} +0 -0
  46. /package/dist/{StateMachine-B7tKroZs.d.ts → StateMachine-B3u4LjaP.d.ts} +0 -0
  47. /package/dist/{api-DlSxxyGw.esm.js → api-J0YE3G-C.esm.js} +0 -0
  48. /package/dist/{chunk-BcpNb8MJ.esm.js → chunk-3k-zyWo_.esm.js} +0 -0
  49. /package/dist/{warmup-BUv67ifS.d.ts → warmup-BIZ_8rAa.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { a as __toDynamicImportESM } from "./chunk-BcpNb8MJ.esm.js";
1
+ import { a as __toDynamicImportESM } from "./chunk-3k-zyWo_.esm.js";
2
2
 
3
3
  //#region ../infra/src/capabilities/platform.ts
4
4
  /**
@@ -4414,7 +4414,7 @@ var MotionSensorProvider = class {
4414
4414
  let openViduImport;
4415
4415
  async function loadOpenVidu() {
4416
4416
  if (openViduImport) return openViduImport;
4417
- openViduImport = import("./lib-DtNtprlI.esm.js").then(__toDynamicImportESM(1));
4417
+ openViduImport = import("./lib-EkjqkOuB.esm.js").then(__toDynamicImportESM(1));
4418
4418
  return openViduImport;
4419
4419
  }
4420
4420
 
@@ -1,4 +1,4 @@
1
- import { t as api } from "./api-DlSxxyGw.esm.js";
1
+ import { t as api } from "./api-J0YE3G-C.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-DlSxxyGw.esm.js";
2
- import { t as addDeviceStats } from "./stats-GJMiTm5k.esm.js";
1
+ import "./api-J0YE3G-C.esm.js";
2
+ import { t as addDeviceStats } from "./stats-Baxc8J0w.esm.js";
3
3
 
4
4
  export { addDeviceStats };
@@ -0,0 +1,104 @@
1
+ import { E as stopCameraStream, T as requestCameraAccess, b as queryCameraPermission, j as getUserAgent, k as getDeviceInfo, l as MotionSensorProvider } from "./src-Bjg2C1oP.esm.js";
2
+ import { t as endpoints } from "./endpoints-BK1EjE1H.esm.js";
3
+ import { t as api } from "./api-J0YE3G-C.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/")) return "edge";
11
+ if (ua.includes("opr/") || ua.includes("opera")) return "opera";
12
+ if (ua.includes("chrome") && !ua.includes("edg/")) return "chrome";
13
+ if (ua.includes("firefox")) return "firefox";
14
+ if (ua.includes("safari") && !ua.includes("chrome")) return "safari";
15
+ return "other";
16
+ }
17
+
18
+ //#endregion
19
+ //#region src/internal/device/getDeviceClass.ts
20
+ function getDeviceClass() {
21
+ const { userAgent, platform, maxTouchPoints } = getDeviceInfo();
22
+ if (!userAgent) return "desktop";
23
+ const ua = userAgent.toLowerCase();
24
+ if (/iphone|ipad|ipod/.test(ua) || platform === "MacIntel" && maxTouchPoints > 1) return "ios";
25
+ if (/android/.test(ua)) return "android";
26
+ return "desktop";
27
+ }
28
+
29
+ //#endregion
30
+ //#region src/internal/permissions/permissionServices.ts
31
+ /**
32
+ * Checks the current camera permission state without prompting the user.
33
+ */
34
+ async function checkPermission() {
35
+ return queryCameraPermission();
36
+ }
37
+ /**
38
+ * Requests motion sensor permission. Must be called during a user gesture on iOS.
39
+ * Returns the permission result.
40
+ */
41
+ async function requestMotionPermission() {
42
+ return new MotionSensorProvider().requestPermission();
43
+ }
44
+ /**
45
+ * Requests camera permission by attempting to access the camera, then immediately
46
+ * stops the obtained stream. Also requests motion sensor permission (required on iOS
47
+ * to be called during a user gesture). This function does not keep or return the stream.
48
+ */
49
+ async function requestPermission() {
50
+ try {
51
+ await requestMotionPermission();
52
+ stopCameraStream(await requestCameraAccess({ video: true }));
53
+ return "granted";
54
+ } catch (error) {
55
+ const name = error instanceof Error ? error.name : void 0;
56
+ if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
57
+ return "prompt";
58
+ }
59
+ }
60
+
61
+ //#endregion
62
+ //#region src/internal/recordings/recordingsRepository.ts
63
+ async function createRecordingSession(type) {
64
+ return (await api.post(endpoints.recordingCreateSessionV2, { type })).data;
65
+ }
66
+ async function startRecording(params) {
67
+ return (await api.post(endpoints.recordingStartV2, {
68
+ videoRecordingId: params.videoRecordingId,
69
+ frameRate: 30,
70
+ outputMode: "COMPOSED",
71
+ resolution: params.resolution,
72
+ type: params.type,
73
+ hasAudio: params.hasAudio ?? false
74
+ })).data;
75
+ }
76
+ async function stopRecording(videoRecordingId) {
77
+ return (await api.post(endpoints.recordingStopV2, { videoRecordingId })).data;
78
+ }
79
+ async function uploadDeepsightVideo(encryptedVideo, token) {
80
+ try {
81
+ return (await api.post(endpoints.deepsightVideoImport, {
82
+ video: encryptedVideo,
83
+ type: "selfie"
84
+ }, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
85
+ } catch {
86
+ return "";
87
+ }
88
+ }
89
+
90
+ //#endregion
91
+ //#region src/internal/recordings/streamingEvents.ts
92
+ const streamingEvents = {
93
+ strSessionDidConnect: "strSessionDidConnect",
94
+ strSessionDidDisconnect: "strSessionDidDisconnect",
95
+ strSessionDidFailWithError: "strSessionDidFailWithError",
96
+ strStreamVideoCaptureStart: "strStreamVideoCaptureStart",
97
+ strStreamVideoCaptureStop: "strStreamVideoCaptureStop",
98
+ strStreamPublisherCreated: "strStreamPublisherCreated",
99
+ strStreamPublisherDestroyed: "strStreamPublisherDestroyed",
100
+ strStreamPublisherDidFailWithError: "strStreamPublisherDidFailWithError"
101
+ };
102
+
103
+ //#endregion
104
+ export { uploadDeepsightVideo as a, getDeviceClass as c, stopRecording as i, getBrowser as l, createRecordingSession as n, checkPermission as o, startRecording as r, requestPermission as s, streamingEvents as t };
@@ -0,0 +1,24 @@
1
+ //#region ../infra/src/media/camera.d.ts
2
+ type CameraStream = MediaStream;
3
+ //#endregion
4
+ //#region src/modules/document-upload/types.d.ts
5
+ /**
6
+ * Configuration for document upload (e.g., third ID capture).
7
+ * The documentType determines the backend endpoint query parameter.
8
+ */
9
+ type DocumentUploadConfig = {
10
+ /** Document type for the upload endpoint (e.g., 'thirdId') */
11
+ documentType: string;
12
+ };
13
+ type DocumentUploadContext = {
14
+ config: DocumentUploadConfig;
15
+ stream: CameraStream | undefined;
16
+ imageBase64: string | undefined;
17
+ progress: number;
18
+ error: string | undefined;
19
+ };
20
+ type DocumentUploadInput = {
21
+ config: DocumentUploadConfig;
22
+ };
23
+ //#endregion
24
+ export { CameraStream as i, DocumentUploadContext as n, DocumentUploadInput as r, DocumentUploadConfig as t };
@@ -123,11 +123,8 @@ interface IStorageCapability {
123
123
  clear(): Promise<void>;
124
124
  }
125
125
  //#endregion
126
- //#region ../infra/src/media/camera.d.ts
127
- type CameraStream = MediaStream;
128
- //#endregion
129
126
  //#region src/internal/permissions/types.d.ts
130
127
  type PermissionResult = 'granted' | 'denied' | 'prompt';
131
128
  type PermissionStatus = 'idle' | 'requesting' | 'denied' | 'learnMore';
132
129
  //#endregion
133
- export { IRecordingCapability as a, MLProviderConfig as c, IStorageCapability as i, PermissionStatus as n, RecordingConnection as o, CameraStream as r, IMLProviderCapability as s, PermissionResult as t };
130
+ export { RecordingConnection as a, IRecordingCapability as i, PermissionStatus as n, IMLProviderCapability as o, IStorageCapability as r, MLProviderConfig as s, PermissionResult as t };
@@ -1,3 +1,5 @@
1
+ import { t as DocumentUploadConfig } from "./types-B3jgq_IJ.js";
2
+
1
3
  //#region src/modules/flow/types.d.ts
2
4
  type EmptyConfig = Record<string, never>;
3
5
  type RegulationTypes = 'US' | 'Worldwide' | 'Other' | 'US_Illinois' | 'US_Texas' | 'US_California' | 'US_Washington';
@@ -151,7 +153,7 @@ type FlowModuleConfig = {
151
153
  TUTORIAL_ID: TutorialIdConfig;
152
154
  ID: TutorialIdConfig;
153
155
  SECOND_ID: TutorialIdConfig;
154
- THIRD_ID: TutorialIdConfig;
156
+ THIRD_ID: DocumentUploadConfig;
155
157
  ID_OCR: {
156
158
  editableOcr: boolean;
157
159
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "0.0.0-dev-20260224-e49e03c",
3
+ "version": "0.0.0-dev-20260226-4cb58f5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -52,6 +52,10 @@
52
52
  "./geolocation": {
53
53
  "types": "./dist/geolocation.d.ts",
54
54
  "import": "./dist/geolocation.esm.js"
55
+ },
56
+ "./document-upload": {
57
+ "types": "./dist/document-upload.d.ts",
58
+ "import": "./dist/document-upload.esm.js"
55
59
  }
56
60
  },
57
61
  "files": [
@@ -62,8 +66,8 @@
62
66
  "tsdown": "^0.16.6",
63
67
  "typescript": "^5.9.3",
64
68
  "vitest": "^4.0.13",
65
- "@incodetech/config": "1.0.0",
66
- "@incodetech/infra": "1.0.0"
69
+ "@incodetech/infra": "1.0.0",
70
+ "@incodetech/config": "1.0.0"
67
71
  },
68
72
  "scripts": {
69
73
  "build": "tsdown -c tsdown.config.ts",
@@ -74,6 +78,6 @@
74
78
  "lint:fix": "eslint . --fix",
75
79
  "format": "prettier --write . --ignore-path ../../.prettierignore",
76
80
  "format:check": "prettier --check . --ignore-path ../../.prettierignore",
77
- "typecheck": "tsc -p tsconfig.json --noEmit"
81
+ "typecheck": "tsgo -p tsconfig.json --noEmit"
78
82
  }
79
83
  }