@incodetech/core 0.0.0-dev-20261002-be08227a → 0.0.0-dev-20261002-7e68ce7a
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.
- package/dist/{FaceDetectionProvider-DTEH2hRO.esm.js → FaceDetectionProvider-BIgdSkHs.esm.js} +85 -5
- package/dist/ae-signature.esm.js +1 -1
- package/dist/{apiError-WxmpMFyE.esm.js → apiError-B7C2i04b.esm.js} +1 -1
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-B3rrHM0R.esm.js → authenticationManager-BboXPVJ4.esm.js} +3 -3
- package/dist/{authenticationStateMachine-Ypuf362T.esm.js → authenticationStateMachine-DvPvONji.esm.js} +3 -3
- package/dist/consent.d.ts +1 -1
- package/dist/{consentManager-DgzWQpAR.d.ts → consentManager-Cv_0QKLD.d.ts} +9 -9
- package/dist/{createCameraCycleOwnership-26-cuXnc.esm.js → createCameraCycleOwnership-CVNcIL95.esm.js} +23 -5
- package/dist/{deepsightLoader-Cp620xVt.esm.js → deepsightLoader-D9O6b45T.esm.js} +3 -3
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-C3ZlUYMz.esm.js → dynamicFormsManager-DnCnvG1a.esm.js} +1 -1
- package/dist/{dynamicFormsStateMachine-DChQu8sG.esm.js → dynamicFormsStateMachine-CYXP2bWn.esm.js} +1 -1
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-D8yIc-An.esm.js → ekybManager-q-VSUBUQ.esm.js} +1 -1
- package/dist/{ekybStateMachine-Dfg9eimK.esm.js → ekybStateMachine-Dhio1vn7.esm.js} +1 -1
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-CEhXjbaR.esm.js → electronicSignatureManager-DydLFTCX.esm.js} +1 -1
- package/dist/extensibility.d.ts +4 -4
- package/dist/extensibility.esm.js +10 -10
- package/dist/{faceCaptureManagerFactory-uwKSRwvp.esm.js → faceCaptureManagerFactory-CHNVNEP_.esm.js} +1 -1
- package/dist/{faceCaptureSetup-DvN05Fik.esm.js → faceCaptureSetup-BzG44cuD.esm.js} +12 -9
- package/dist/{feature-management-Iccy3Pud.esm.js → feature-management-DClH0UkN.esm.js} +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/flow.esm.js +3 -3
- package/dist/{flowCompletionService-CnEzBkv0.esm.js → flowCompletionService-DRpB7aag.esm.js} +1 -1
- package/dist/{flowServices-BHt7yheb.esm.js → flowServices-BABr3Ov8.esm.js} +4 -4
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-BRq_f7lG.esm.js → geolocationManager-DykhXCSG.esm.js} +1 -1
- package/dist/{geolocationStateMachine-CxRpGoq1.esm.js → geolocationStateMachine-DtQJPfbx.esm.js} +1 -1
- package/dist/id-ocr.d.ts +1 -1
- package/dist/id-selfie-flow.esm.js +7 -8
- package/dist/id.esm.js +3 -3
- package/dist/{idCaptureDefaults-Cwd4dOoi.esm.js → idCaptureDefaults-BmgACU-z.esm.js} +1 -1
- package/dist/{idCaptureManager-Bbcx53L_.esm.js → idCaptureManager-CQkzCUxv.esm.js} +3 -3
- package/dist/{idCaptureServices-Cuznp3D4.esm.js → idCaptureServices-BVTu_jJW.esm.js} +3 -3
- package/dist/{idCaptureStateMachine-Cw_F05UA.esm.js → idCaptureStateMachine-DfyGv-pZ.esm.js} +10 -10
- package/dist/{idOcrManager-BTdHlJ9D.d.ts → idOcrManager-DT3kPIB3.d.ts} +1 -1
- package/dist/identity-reuse.d.ts +1 -1
- package/dist/{identityReuseManager-ooAbp6Kc.d.ts → identityReuseManager-B1birg5X.d.ts} +4 -4
- package/dist/index.esm.js +1 -1
- package/dist/mandatory-consent.d.ts +1 -1
- package/dist/{mandatoryConsentManager-BWZbg1Hl.d.ts → mandatoryConsentManager-CdBVHXGB.d.ts} +5 -5
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{runChildModule-DiBvktp5.esm.js → runChildModule-CZbSjlSO.esm.js} +1 -1
- package/dist/{sdkVersion-DnnSgaug.esm.js → sdkVersion-CEzq0bPr.esm.js} +1 -1
- package/dist/selfie.esm.js +7 -7
- package/dist/selfieErrorUtils-C9O4yx2t.esm.js +21 -0
- package/dist/{selfieManager-C0UDpaTP.esm.js → selfieManager-B331XzBJ.esm.js} +3 -3
- package/dist/{selfieStateMachine-CXEyjZ0q.esm.js → selfieStateMachine-DbCcOMzb.esm.js} +3 -3
- package/dist/{session-CoPYQelz.esm.js → session-DHMyVkCm.esm.js} +3 -3
- package/dist/session.esm.js +4 -4
- package/dist/{sessionInitializer-CjnAAND-.esm.js → sessionInitializer-Dkb386bz.esm.js} +3 -3
- package/dist/{setup-pvMooZFs.esm.js → setup-BIKgMZ9N.esm.js} +4 -4
- package/dist/{trueSightService-B4aCBXnZ.esm.js → trueSightService-DsHApmSr.esm.js} +1 -1
- package/dist/video-selfie.esm.js +3 -3
- package/dist/{videoSelfieCameraWarmer-Dc5ZDf7a.esm.js → videoSelfieCameraWarmer-Ds3B8RK_.esm.js} +4 -4
- package/dist/wasm.esm.js +2 -2
- package/dist/workflow.esm.js +14 -14
- package/package.json +1 -1
- package/dist/selfieErrorUtils-CLXOOKJT.esm.js +0 -90
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { t as api } from "./api-Bx3gKW_y.esm.js";
|
|
2
|
-
import { t as endpoints } from "./endpoints-Bs3D8B_G.esm.js";
|
|
3
|
-
import { t as addDeviceStats } from "./stats-Dz3XWA64.esm.js";
|
|
4
|
-
import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
|
|
5
|
-
import { t as getDeviceClass } from "./getDeviceClass-bsWdEDxP.esm.js";
|
|
6
|
-
//#region src/modules/selfie/selfieUploadService.ts
|
|
7
|
-
/**
|
|
8
|
-
* Uploads a selfie image to the backend.
|
|
9
|
-
*/
|
|
10
|
-
async function uploadSelfie({ encryptedBase64Image, faceCoordinates, signal, metadata, recordingId, imageType = "selfie", deepsightService }) {
|
|
11
|
-
try {
|
|
12
|
-
const payload = {
|
|
13
|
-
base64Image: encryptedBase64Image,
|
|
14
|
-
faceCoordinates: faceCoordinates ?? void 0,
|
|
15
|
-
encrypted: true,
|
|
16
|
-
clientInfo: { deviceClass: getDeviceClass() },
|
|
17
|
-
metadata: metadata ?? void 0
|
|
18
|
-
};
|
|
19
|
-
const query = { imageType };
|
|
20
|
-
if (recordingId) query.recordingId = recordingId;
|
|
21
|
-
const res = await api.post(endpoints.selfie, payload, {
|
|
22
|
-
signal,
|
|
23
|
-
query
|
|
24
|
-
});
|
|
25
|
-
if (!res.ok) throw new Error(`POST ${endpoints.selfie} failed: ${res.status} ${res.statusText}`);
|
|
26
|
-
if (deepsightService) addDeviceStats({
|
|
27
|
-
frontIdStatsAnalysisStatus: "",
|
|
28
|
-
backIdStatsAnalysisStatus: "",
|
|
29
|
-
selfieStatsAnalysisStatus: deepsightService.getAnalysisStatus(),
|
|
30
|
-
motionStatus: deepsightService.getMotionStatus()
|
|
31
|
-
});
|
|
32
|
-
return res.data;
|
|
33
|
-
} catch (error) {
|
|
34
|
-
const errorCode = getFaceErrorCodeFromHttpError(error);
|
|
35
|
-
throw withTransportStatus(new Error(errorCode ?? FACE_ERROR_CODES.SERVER), error);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Copies the HTTP status of `source` onto `target`. The code alone cannot say
|
|
40
|
-
* whether the request got a verdict or never reached the backend — a network
|
|
41
|
-
* failure and a 5xx both map to `SERVER_ERROR` — so a caller that retries
|
|
42
|
-
* transport failures needs the status to survive this mapping.
|
|
43
|
-
*/
|
|
44
|
-
function withTransportStatus(target, source) {
|
|
45
|
-
if (typeof source === "object" && source !== null && "status" in source && typeof source.status === "number") return Object.assign(target, { status: source.status });
|
|
46
|
-
return target;
|
|
47
|
-
}
|
|
48
|
-
const getFaceErrorCodeFromHttpError = (error) => {
|
|
49
|
-
const err = error;
|
|
50
|
-
if (err.ok !== false || typeof err.status !== "number") return;
|
|
51
|
-
if (err.status !== 400) return FACE_ERROR_CODES.SERVER;
|
|
52
|
-
if (typeof err.data?.status !== "number") return FACE_ERROR_CODES.BAD_REQUEST;
|
|
53
|
-
return {
|
|
54
|
-
3004: FACE_ERROR_CODES.FACE_NOT_FOUND,
|
|
55
|
-
3005: FACE_ERROR_CODES.FACE_NOT_FOUND,
|
|
56
|
-
3006: FACE_ERROR_CODES.TOO_BLURRY,
|
|
57
|
-
3007: FACE_ERROR_CODES.TOO_DARK,
|
|
58
|
-
4010: FACE_ERROR_CODES.MULTIPLE_FACES,
|
|
59
|
-
4019: FACE_ERROR_CODES.FACE_NOT_FOUND,
|
|
60
|
-
4077: FACE_ERROR_CODES.BAD_PHOTO_QUALITY,
|
|
61
|
-
4078: FACE_ERROR_CODES.FACE_OCCLUDED
|
|
62
|
-
}[err.data.status] ?? FACE_ERROR_CODES.BAD_REQUEST;
|
|
63
|
-
};
|
|
64
|
-
async function processFace(imageType = "selfie", signal) {
|
|
65
|
-
return (await api.post(endpoints.processFace, {}, {
|
|
66
|
-
query: { imageType },
|
|
67
|
-
signal
|
|
68
|
-
})).data;
|
|
69
|
-
}
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/modules/selfie/selfieErrorUtils.ts
|
|
72
|
-
const FACE_ERROR_CODE_VALUES = Object.values(FACE_ERROR_CODES);
|
|
73
|
-
const isFaceErrorCode = (value) => {
|
|
74
|
-
return FACE_ERROR_CODE_VALUES.includes(value);
|
|
75
|
-
};
|
|
76
|
-
const getFaceErrorCodeFromUnknown = (value) => {
|
|
77
|
-
if (value instanceof Error && typeof value.message === "string") return isFaceErrorCode(value.message) ? value.message : void 0;
|
|
78
|
-
if (typeof value === "string") return isFaceErrorCode(value) ? value : void 0;
|
|
79
|
-
};
|
|
80
|
-
const validateUploadResponse = ({ config, response }) => {
|
|
81
|
-
if (!response) return FACE_ERROR_CODES.SERVER;
|
|
82
|
-
if (response.confidence !== 0) return FACE_ERROR_CODES.LIVENESS;
|
|
83
|
-
if (config.validateBrightness && !response.isBright) return FACE_ERROR_CODES.BRIGHTNESS;
|
|
84
|
-
if (config.validateLenses && response.hasLenses) return FACE_ERROR_CODES.LENSES;
|
|
85
|
-
if (config.validateFaceMask && response.hasFaceMask) return FACE_ERROR_CODES.MASK;
|
|
86
|
-
if (config.validateClosedEyes && response.hasClosedEyes) return FACE_ERROR_CODES.CLOSED_EYES;
|
|
87
|
-
if (config.validateHeadCover && response.hasHeadCover) return FACE_ERROR_CODES.HEAD_COVER;
|
|
88
|
-
};
|
|
89
|
-
//#endregion
|
|
90
|
-
export { uploadSelfie as i, validateUploadResponse as n, processFace as r, getFaceErrorCodeFromUnknown as t };
|