@incodetech/core 0.0.0-dev-20260224-8cae674 → 0.0.0-dev-20260224-54eec90

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.
@@ -5,7 +5,7 @@ import { a as fromPromise, o as createActor, r as assign, t as endpoints } from
5
5
  import "./deepsightService-Bn05rSAa.esm.js";
6
6
  import { t as api } from "./api-DlSxxyGw.esm.js";
7
7
  import "./stats-GJMiTm5k.esm.js";
8
- import { a as FACE_ERROR_CODES, n as faceCaptureMachine, o as createFaceCaptureManager, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-Dx-uEurp.esm.js";
8
+ import { a as FACE_ERROR_CODES, n as faceCaptureMachine, o as createFaceCaptureManager, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-CdGC6c86.esm.js";
9
9
 
10
10
  //#region src/modules/authentication/authenticationErrorUtils.ts
11
11
  const AUTH_ERROR_MAP = {
@@ -547,6 +547,13 @@ const _faceCaptureMachine = setup({
547
547
  });
548
548
  return () => {};
549
549
  }
550
+ if (input.manualCaptureTriggered) {
551
+ sendBack({
552
+ type: "DETECTION_UPDATE",
553
+ status: "manualCapture"
554
+ });
555
+ return () => {};
556
+ }
550
557
  const { cleanup, reset } = startDetection({
551
558
  config: input.config,
552
559
  capturer: input.frameCapturer,
@@ -663,7 +670,8 @@ const _faceCaptureMachine = setup({
663
670
  uploadError: void 0,
664
671
  permissionResult: void 0,
665
672
  resetDetection: void 0,
666
- deepsightService: void 0
673
+ deepsightService: void 0,
674
+ manualCaptureTriggered: false
667
675
  })),
668
676
  resetDetection: ({ context }) => {
669
677
  context.resetDetection?.();
@@ -703,11 +711,15 @@ const _faceCaptureMachine = setup({
703
711
  setPermissionRefresh: assign({ permissionResult: () => "refresh" }),
704
712
  setDeepsightServiceFromEvent: assign({ deepsightService: ({ event }) => event.output }),
705
713
  setErrorFromEvent: assign({ error: ({ event }) => String(event.error) }),
706
- setDetectionStatusDetecting: assign({ detectionStatus: () => "detecting" }),
714
+ setDetectionStatusDetecting: assign({ detectionStatus: ({ context }) => context.manualCaptureTriggered ? "manualCapture" : "detecting" }),
707
715
  setRecordingServiceFromEvent: assign({ recordingService: ({ context, event }) => {
708
716
  return event.output ?? context.recordingService;
709
717
  } }),
710
718
  setDetectionStatusFromEvent: assign({ detectionStatus: ({ event }) => event.status }),
719
+ setManualCaptureTriggered: assign({ manualCaptureTriggered: ({ context, event }) => {
720
+ const status = event.status;
721
+ return context.manualCaptureTriggered || status === "manualCapture";
722
+ } }),
711
723
  setDebugFrameFromEvent: assign({ debugFrame: ({ event }) => event.frame }),
712
724
  setResetDetectionFromEvent: assign({ resetDetection: ({ event }) => event.reset }),
713
725
  setCapturedImageFromEvent: assign({
@@ -773,7 +785,8 @@ const _faceCaptureMachine = setup({
773
785
  resetDetection: void 0,
774
786
  deepsightService: void 0,
775
787
  encryptedBase64Image: void 0,
776
- uploadRecordingId: void 0
788
+ uploadRecordingId: void 0,
789
+ manualCaptureTriggered: false
777
790
  }),
778
791
  on: { QUIT: { target: "#faceCapture.closed" } },
779
792
  states: {
@@ -1073,12 +1086,13 @@ const _faceCaptureMachine = setup({
1073
1086
  input: ({ context }) => ({
1074
1087
  frameCapturer: context.frameCapturer,
1075
1088
  provider: context.provider,
1076
- config: context.config
1089
+ config: context.config,
1090
+ manualCaptureTriggered: context.manualCaptureTriggered
1077
1091
  })
1078
1092
  }
1079
1093
  ],
1080
1094
  on: {
1081
- DETECTION_UPDATE: { actions: "setDetectionStatusFromEvent" },
1095
+ DETECTION_UPDATE: { actions: ["setDetectionStatusFromEvent", "setManualCaptureTriggered"] },
1082
1096
  DETECTION_FRAME: { actions: "setDebugFrameFromEvent" },
1083
1097
  DETECTION_RESET_READY: { actions: "setResetDetectionFromEvent" },
1084
1098
  DETECTION_SUCCESS: {
@@ -380,7 +380,7 @@ async function getExtraImages(params) {
380
380
  }
381
381
  const getRealQualityValue = (value) => (1 - value) * 100;
382
382
  async function uploadIdImage(params) {
383
- const { type, image, onProgress, signal, metadata, ageAssurance, glare, sharpness, shouldSkipGlareBack, analyticsProvider, imageData, isSecondId } = params;
383
+ const { type, image, onProgress, signal, metadata, ageAssurance, glare, sharpness, shouldSkipGlareBack, analyticsProvider, imageData, isSecondId, onlyFront } = params;
384
384
  addEvent({
385
385
  code: "captureAttemptFinished",
386
386
  module: eventModuleNames.id,
@@ -407,6 +407,7 @@ async function uploadIdImage(params) {
407
407
  metadata: finalMetadata
408
408
  };
409
409
  const queryParams = { imageType: "id" };
410
+ if (onlyFront && type === "front") queryParams.onlyFront = true;
410
411
  if (shouldSkipGlareBack && type === "back") queryParams.glare = 0;
411
412
  else if (glare !== void 0) queryParams.glare = getRealQualityValue(glare);
412
413
  if (sharpness !== void 0) queryParams.sharpness = getRealQualityValue(sharpness);
@@ -860,7 +861,8 @@ const uploadIdImageActor = fromPromise(async ({ input, signal }) => {
860
861
  metadata,
861
862
  analyticsProvider: input.analyticsProvider,
862
863
  imageData,
863
- isSecondId: input.isSecondId
864
+ isSecondId: input.isSecondId,
865
+ onlyFront: input.onlyFront
864
866
  });
865
867
  });
866
868
  const processIdActor = fromPromise(async ({ input, signal }) => {
@@ -942,6 +944,14 @@ function performTrackTutorialId() {
942
944
  });
943
945
  }
944
946
  function performTrackContinue() {}
947
+ function performTrackCameraId(context) {
948
+ const isBack = context.currentMode === "back";
949
+ addEvent({
950
+ code: isBack ? "cameraBackId" : "cameraFrontId",
951
+ module: eventModuleNames.id,
952
+ payload: isBack ? { cameraBackId: true } : { cameraFrontId: true }
953
+ });
954
+ }
945
955
  function performStopMediaRecording(context) {
946
956
  if (context.recordingSession) stopRecording(context.recordingSession);
947
957
  }
@@ -1141,7 +1151,7 @@ function getCurrentModeFromEvent(context, event) {
1141
1151
  //#endregion
1142
1152
  //#region src/modules/id/idCaptureGuards.ts
1143
1153
  const hasShowTutorialGuard = ({ context }) => context.config.showTutorial;
1144
- const hasShowDocumentChooserGuard = ({ context }) => context.config.showDocumentChooserScreen ?? false;
1154
+ const hasShowDocumentChooserGuard = ({ context }) => !context.config.onlyBack && (context.config.showDocumentChooserScreen ?? false);
1145
1155
  const isPermissionGrantedGuard = ({ event }) => {
1146
1156
  if ("output" in event) return event.output === "granted";
1147
1157
  return false;
@@ -1283,6 +1293,9 @@ const _idCaptureMachine = setup({
1283
1293
  trackContinue: () => {
1284
1294
  /* @__PURE__ */ performTrackContinue();
1285
1295
  },
1296
+ trackCameraId: ({ context }) => {
1297
+ performTrackCameraId(context);
1298
+ },
1286
1299
  resetContext: assign(({ context }) => getResetContextValues(context)),
1287
1300
  resetDetection: ({ context }) => {
1288
1301
  performResetDetection(context);
@@ -1647,6 +1660,7 @@ const _idCaptureMachine = setup({
1647
1660
  },
1648
1661
  capture: {
1649
1662
  initial: "checkingStream",
1663
+ entry: "trackCameraId",
1650
1664
  exit: ["stopMediaRecording", "clearRecordingSession"],
1651
1665
  on: { SET_FRAME_RECT: { actions: "setFrameRect" } },
1652
1666
  states: {
@@ -1809,7 +1823,8 @@ const _idCaptureMachine = setup({
1809
1823
  },
1810
1824
  deepsightService: context.deepsightService,
1811
1825
  stream: context.stream,
1812
- isSecondId: context.config.isSecondId ?? false
1826
+ isSecondId: context.config.isSecondId ?? false,
1827
+ onlyFront: context.config.onlyFront
1813
1828
  };
1814
1829
  },
1815
1830
  onDone: {
package/dist/id.esm.js CHANGED
@@ -4,7 +4,7 @@ import "./src-t0pt3B2r.esm.js";
4
4
  import "./endpoints-DXp63GM6.esm.js";
5
5
  import "./deepsightService-Bn05rSAa.esm.js";
6
6
  import "./api-DlSxxyGw.esm.js";
7
- import { a as processId, c as stopStream, d as ID_ERROR_CODES, i as initializeIdCapture, l as uploadIdImage, n as createIdCaptureActor, o as startRecordingSession, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-DCe_Br2-.esm.js";
7
+ import { a as processId, c as stopStream, d as ID_ERROR_CODES, i as initializeIdCapture, l as uploadIdImage, n as createIdCaptureActor, o as startRecordingSession, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-CDh0aJOJ.esm.js";
8
8
  import "./stats-GJMiTm5k.esm.js";
9
9
 
10
10
  export { ID_ERROR_CODES, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
package/dist/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import { O as createApi_default, o as warmupWasm, r as WasmUtilProvider } from "
4
4
  import "./endpoints-DXp63GM6.esm.js";
5
5
  import "./deepsightService-Bn05rSAa.esm.js";
6
6
  import { a as resetApi, n as getApi, o as setClient, s as setToken, t as api } from "./api-DlSxxyGw.esm.js";
7
- import { _ as createSession, a as processId, c as stopStream, d as ID_ERROR_CODES, f as getDisableIpify, g as resetSessionInit, h as isSessionInitialized, i as initializeIdCapture, l as uploadIdImage, m as initializeSession, n as createIdCaptureActor, o as startRecordingSession, p as getSessionFeatures, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-DCe_Br2-.esm.js";
7
+ import { _ as createSession, a as processId, c as stopStream, d as ID_ERROR_CODES, f as getDisableIpify, g as resetSessionInit, h as isSessionInitialized, i as initializeIdCapture, l as uploadIdImage, m as initializeSession, n as createIdCaptureActor, o as startRecordingSession, p as getSessionFeatures, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-CDh0aJOJ.esm.js";
8
8
  import "./stats-GJMiTm5k.esm.js";
9
9
 
10
10
  //#region src/setup.ts
package/dist/selfie.d.ts CHANGED
@@ -301,6 +301,7 @@ type FaceCaptureContext = {
301
301
  deepsightService: DeepsightService | undefined;
302
302
  encryptedBase64Image: string | undefined;
303
303
  uploadRecordingId: string | null | undefined;
304
+ manualCaptureTriggered: boolean;
304
305
  };
305
306
  type FaceCaptureEvent = {
306
307
  type: 'LOAD';
@@ -5,7 +5,7 @@ import { a as fromPromise, o as createActor, r as assign } from "./endpoints-DXp
5
5
  import "./deepsightService-Bn05rSAa.esm.js";
6
6
  import "./api-DlSxxyGw.esm.js";
7
7
  import "./stats-GJMiTm5k.esm.js";
8
- import { a as FACE_ERROR_CODES, i as uploadSelfie, n as faceCaptureMachine, o as createFaceCaptureManager, r as processFace, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-Dx-uEurp.esm.js";
8
+ import { a as FACE_ERROR_CODES, i as uploadSelfie, n as faceCaptureMachine, o as createFaceCaptureManager, r as processFace, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-CdGC6c86.esm.js";
9
9
 
10
10
  //#region src/modules/selfie/selfieErrorUtils.ts
11
11
  const FACE_ERROR_CODE_VALUES = Object.values(FACE_ERROR_CODES);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "0.0.0-dev-20260224-8cae674",
3
+ "version": "0.0.0-dev-20260224-54eec90",
4
4
  "type": "module",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",