@incodetech/core 0.0.0-dev-20260224-fd86d93 → 0.0.0-dev-20260224-b38e10e
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-
|
|
8
|
+
import { a as FACE_ERROR_CODES, n as faceCaptureMachine, o as createFaceCaptureManager, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-BflAHwmc.esm.js";
|
|
9
9
|
|
|
10
10
|
//#region src/modules/authentication/authenticationErrorUtils.ts
|
|
11
11
|
const AUTH_ERROR_MAP = {
|
|
@@ -129,7 +129,8 @@ const _authenticationMachine = faceCaptureMachine.provide({
|
|
|
129
129
|
isTerminalUploadError: ({ context }) => {
|
|
130
130
|
const resp = context.uploadResponse;
|
|
131
131
|
return isTerminalAuthError(resp, context.attemptsRemaining);
|
|
132
|
-
}
|
|
132
|
+
},
|
|
133
|
+
isNoAttemptsTerminal: () => true
|
|
133
134
|
}
|
|
134
135
|
});
|
|
135
136
|
const authenticationMachine = _authenticationMachine;
|
|
@@ -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({
|
|
@@ -747,7 +759,8 @@ const _faceCaptureMachine = setup({
|
|
|
747
759
|
hasAttemptsRemaining: ({ context }) => context.attemptsRemaining > 0,
|
|
748
760
|
hasCapturedImage: ({ context }) => context.capturedImage !== void 0,
|
|
749
761
|
hasUploadValidationError: () => false,
|
|
750
|
-
isTerminalUploadError: () => false
|
|
762
|
+
isTerminalUploadError: () => false,
|
|
763
|
+
isNoAttemptsTerminal: () => false
|
|
751
764
|
}
|
|
752
765
|
}).createMachine({
|
|
753
766
|
id: "faceCapture",
|
|
@@ -773,7 +786,8 @@ const _faceCaptureMachine = setup({
|
|
|
773
786
|
resetDetection: void 0,
|
|
774
787
|
deepsightService: void 0,
|
|
775
788
|
encryptedBase64Image: void 0,
|
|
776
|
-
uploadRecordingId: void 0
|
|
789
|
+
uploadRecordingId: void 0,
|
|
790
|
+
manualCaptureTriggered: false
|
|
777
791
|
}),
|
|
778
792
|
on: { QUIT: { target: "#faceCapture.closed" } },
|
|
779
793
|
states: {
|
|
@@ -1073,12 +1087,13 @@ const _faceCaptureMachine = setup({
|
|
|
1073
1087
|
input: ({ context }) => ({
|
|
1074
1088
|
frameCapturer: context.frameCapturer,
|
|
1075
1089
|
provider: context.provider,
|
|
1076
|
-
config: context.config
|
|
1090
|
+
config: context.config,
|
|
1091
|
+
manualCaptureTriggered: context.manualCaptureTriggered
|
|
1077
1092
|
})
|
|
1078
1093
|
}
|
|
1079
1094
|
],
|
|
1080
1095
|
on: {
|
|
1081
|
-
DETECTION_UPDATE: { actions: "setDetectionStatusFromEvent" },
|
|
1096
|
+
DETECTION_UPDATE: { actions: ["setDetectionStatusFromEvent", "setManualCaptureTriggered"] },
|
|
1082
1097
|
DETECTION_FRAME: { actions: "setDebugFrameFromEvent" },
|
|
1083
1098
|
DETECTION_RESET_READY: { actions: "setResetDetectionFromEvent" },
|
|
1084
1099
|
DETECTION_SUCCESS: {
|
|
@@ -1147,15 +1162,23 @@ const _faceCaptureMachine = setup({
|
|
|
1147
1162
|
},
|
|
1148
1163
|
{ target: "success" }
|
|
1149
1164
|
] },
|
|
1150
|
-
uploadError: { on: { RETRY_CAPTURE:
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1165
|
+
uploadError: { on: { RETRY_CAPTURE: [
|
|
1166
|
+
{
|
|
1167
|
+
target: "checkingStream",
|
|
1168
|
+
guard: "hasAttemptsRemaining",
|
|
1169
|
+
actions: [
|
|
1170
|
+
"resetDetection",
|
|
1171
|
+
"clearUploadFailure",
|
|
1172
|
+
"clearStreamForRetry"
|
|
1173
|
+
]
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
target: "#faceCapture.error",
|
|
1177
|
+
guard: "isNoAttemptsTerminal",
|
|
1178
|
+
actions: ["setTerminalError"]
|
|
1179
|
+
},
|
|
1180
|
+
{ target: "#faceCapture.finished" }
|
|
1181
|
+
] } },
|
|
1159
1182
|
success: {
|
|
1160
1183
|
entry: "cleanup",
|
|
1161
1184
|
after: { 3e3: { target: "#faceCapture.processing" } }
|
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';
|
package/dist/selfie.esm.js
CHANGED
|
@@ -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-
|
|
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-BflAHwmc.esm.js";
|
|
9
9
|
|
|
10
10
|
//#region src/modules/selfie/selfieErrorUtils.ts
|
|
11
11
|
const FACE_ERROR_CODE_VALUES = Object.values(FACE_ERROR_CODES);
|