@privateid/ultrapass-web-sdk 1.3.1 → 1.3.2-1300478
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/README.md +75 -75
- package/dist/apiUtils.d.ts +46 -46
- package/dist/apiUtils.js +922 -922
- package/dist/application/index.d.ts +7 -7
- package/dist/application/index.js +27 -27
- package/dist/application/modules/core/document/DocumentService.d.ts +22 -22
- package/dist/application/modules/core/document/DocumentService.js +254 -254
- package/dist/application/modules/core/document/document.constants.d.ts +15 -15
- package/dist/application/modules/core/document/document.constants.js +21 -21
- package/dist/application/modules/core/document/document.domain.d.ts +7 -7
- package/dist/application/modules/core/document/document.domain.js +1 -1
- package/dist/application/modules/core/document/document.types.d.ts +17 -17
- package/dist/application/modules/core/document/document.types.js +1 -1
- package/dist/application/modules/core/document/document.utils.d.ts +3 -3
- package/dist/application/modules/core/document/document.utils.js +58 -58
- package/dist/application/modules/core/document/index.d.ts +3 -3
- package/dist/application/modules/core/document/index.js +1 -1
- package/dist/application/modules/core/face/FaceService.d.ts +33 -33
- package/dist/application/modules/core/face/FaceService.js +228 -221
- package/dist/application/modules/core/face/FaceService.js.map +1 -1
- package/dist/application/modules/core/face/face.constants.d.ts +53 -53
- package/dist/application/modules/core/face/face.constants.js +53 -53
- package/dist/application/modules/core/face/face.domain.d.ts +10 -10
- package/dist/application/modules/core/face/face.domain.js +1 -1
- package/dist/application/modules/core/face/face.types.d.ts +41 -38
- package/dist/application/modules/core/face/face.types.js +1 -1
- package/dist/application/modules/core/face/face.utils.d.ts +15 -15
- package/dist/application/modules/core/face/face.utils.js +101 -101
- package/dist/application/modules/core/face/index.d.ts +3 -3
- package/dist/application/modules/core/face/index.js +1 -1
- package/dist/application/modules/global/shared.constants.d.ts +2 -2
- package/dist/application/modules/global/shared.constants.js +2 -2
- package/dist/application/modules/global/shared.utils.d.ts +25 -25
- package/dist/application/modules/global/shared.utils.js +100 -100
- package/dist/application/modules/global/shared.utils.js.map +1 -1
- package/dist/application/modules/internal/feature-flag/LDFeatureFlagService.d.ts +9 -0
- package/dist/application/modules/internal/feature-flag/LDFeatureFlagService.js +32 -0
- package/dist/application/modules/internal/feature-flag/LDFeatureFlagService.js.map +1 -0
- package/dist/application/modules/internal/feature-flag/feature-flag-init.d.ts +11 -0
- package/dist/application/modules/internal/feature-flag/feature-flag-init.js +24 -0
- package/dist/application/modules/internal/feature-flag/feature-flag-init.js.map +1 -0
- package/dist/application/modules/internal/feature-flag/feature-flag.domain.d.ts +10 -0
- package/dist/application/modules/internal/feature-flag/feature-flag.domain.js +7 -0
- package/dist/application/modules/internal/feature-flag/feature-flag.domain.js.map +1 -0
- package/dist/application/modules/internal/feature-flag/featureFlagInit.d.ts +11 -0
- package/dist/application/modules/internal/feature-flag/featureFlagInit.js +44 -0
- package/dist/application/modules/internal/feature-flag/featureFlagInit.js.map +1 -0
- package/dist/application/modules/internal/feature-flag/index.d.ts +2 -0
- package/dist/application/modules/internal/feature-flag/index.js +3 -0
- package/dist/application/modules/internal/feature-flag/index.js.map +1 -0
- package/dist/application/modules/internal/shared/index.d.ts +2 -0
- package/dist/application/modules/internal/shared/index.js +3 -0
- package/dist/application/modules/internal/shared/index.js.map +1 -0
- package/dist/application/modules/internal/shared/shared.constants.d.ts +2 -0
- package/dist/application/modules/internal/shared/shared.constants.js +3 -0
- package/dist/application/modules/internal/shared/shared.constants.js.map +1 -0
- package/dist/application/modules/internal/shared/shared.utils.d.ts +44 -0
- package/dist/application/modules/internal/shared/shared.utils.js +204 -0
- package/dist/application/modules/internal/shared/shared.utils.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/WasmOrchestratorService.d.ts +28 -0
- package/dist/application/modules/internal/wasm-orchestrator/WasmOrchestratorService.js +380 -0
- package/dist/application/modules/internal/wasm-orchestrator/WasmOrchestratorService.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/index.d.ts +6 -0
- package/dist/application/modules/internal/wasm-orchestrator/index.js +9 -0
- package/dist/application/modules/internal/wasm-orchestrator/index.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.constants.d.ts +28 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.constants.js +35 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.constants.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.domain.d.ts +51 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.domain.js +2 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.domain.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.types.d.ts +142 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.types.js +2 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.types.js.map +1 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.d.ts +86 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.js +201 -0
- package/dist/application/modules/internal/wasm-orchestrator/wasm-orchestrator.utils.js.map +1 -0
- package/dist/application/modules/support/camera/CameraServiceFactory.d.ts +10 -10
- package/dist/application/modules/support/camera/CameraServiceFactory.js +33 -33
- package/dist/application/modules/support/camera/CameraServiceFactory.js.map +1 -1
- package/dist/application/modules/support/camera/camera.constants.d.ts +9 -9
- package/dist/application/modules/support/camera/camera.constants.js +48 -48
- package/dist/application/modules/support/camera/camera.domain.d.ts +15 -15
- package/dist/application/modules/support/camera/camera.domain.js +1 -1
- package/dist/application/modules/support/camera/camera.types.d.ts +42 -42
- package/dist/application/modules/support/camera/camera.types.js +10 -10
- package/dist/application/modules/support/camera/camera.utils.d.ts +157 -157
- package/dist/application/modules/support/camera/camera.utils.js +623 -623
- package/dist/application/modules/support/camera/index.d.ts +24 -24
- package/dist/application/modules/support/camera/index.js +27 -27
- package/dist/application/modules/support/camera/services/BaseCameraService.d.ts +41 -41
- package/dist/application/modules/support/camera/services/BaseCameraService.js +278 -278
- package/dist/application/modules/support/camera/services/DesktopCameraService.d.ts +5 -5
- package/dist/application/modules/support/camera/services/DesktopCameraService.js +46 -46
- package/dist/application/modules/support/camera/services/FirefoxCameraService.d.ts +5 -5
- package/dist/application/modules/support/camera/services/FirefoxCameraService.js +46 -46
- package/dist/application/modules/support/camera/services/MacSafariCameraService.d.ts +5 -5
- package/dist/application/modules/support/camera/services/MacSafariCameraService.js +47 -47
- package/dist/application/modules/support/camera/services/MobileCameraService.d.ts +5 -5
- package/dist/application/modules/support/camera/services/MobileCameraService.js +133 -133
- package/dist/application/modules/support/engine/EngineService.d.ts +15 -0
- package/dist/application/modules/support/engine/EngineService.js +106 -0
- package/dist/application/modules/support/engine/EngineService.js.map +1 -0
- package/dist/application/modules/support/engine/engine.constants.d.ts +33 -0
- package/dist/application/modules/support/engine/engine.constants.js +35 -0
- package/dist/application/modules/support/engine/engine.constants.js.map +1 -0
- package/dist/application/modules/support/engine/engine.domain.d.ts +23 -0
- package/dist/application/modules/support/engine/engine.domain.js +2 -0
- package/dist/application/modules/support/engine/engine.domain.js.map +1 -0
- package/dist/application/modules/support/engine/engine.types.d.ts +32 -0
- package/dist/application/modules/support/engine/engine.types.js +2 -0
- package/dist/application/modules/support/engine/engine.types.js.map +1 -0
- package/dist/application/modules/support/engine/engine.utils.d.ts +65 -0
- package/dist/application/modules/support/engine/engine.utils.js +135 -0
- package/dist/application/modules/support/engine/engine.utils.js.map +1 -0
- package/dist/application/modules/support/engine/index.d.ts +3 -0
- package/dist/application/modules/support/engine/index.js +2 -0
- package/dist/application/modules/support/engine/index.js.map +1 -0
- package/dist/application/modules/support/permissions/PermissionsService.d.ts +55 -55
- package/dist/application/modules/support/permissions/PermissionsService.js +183 -183
- package/dist/application/modules/support/permissions/index.d.ts +4 -4
- package/dist/application/modules/support/permissions/index.js +2 -2
- package/dist/application/modules/support/permissions/permission.utils.d.ts +6 -6
- package/dist/application/modules/support/permissions/permission.utils.js +33 -33
- package/dist/application/modules/support/permissions/permissions.domain.d.ts +6 -6
- package/dist/application/modules/support/permissions/permissions.domain.js +1 -1
- package/dist/application/modules/support/permissions/permissions.types.d.ts +9 -9
- package/dist/application/modules/support/permissions/permissions.types.js +1 -1
- package/dist/application/modules/support/wasm/WasmService.d.ts +25 -25
- package/dist/application/modules/support/wasm/WasmService.js +156 -155
- package/dist/application/modules/support/wasm/WasmService.js.map +1 -1
- package/dist/application/modules/support/wasm/index.d.ts +6 -6
- package/dist/application/modules/support/wasm/index.js +8 -8
- package/dist/application/modules/support/wasm/wasm.constants.d.ts +78 -78
- package/dist/application/modules/support/wasm/wasm.constants.js +86 -86
- package/dist/application/modules/support/wasm/wasm.domain.d.ts +52 -52
- package/dist/application/modules/support/wasm/wasm.domain.js +1 -1
- package/dist/application/modules/support/wasm/wasm.types.d.ts +119 -118
- package/dist/application/modules/support/wasm/wasm.types.js +1 -1
- package/dist/application/modules/support/wasm/wasm.utils.d.ts +88 -88
- package/dist/application/modules/support/wasm/wasm.utils.js +243 -243
- package/dist/application/modules/support/wasm-orchestrator/WasmOrchestratorService.d.ts +28 -0
- package/dist/application/modules/support/wasm-orchestrator/WasmOrchestratorService.js +324 -0
- package/dist/application/modules/support/wasm-orchestrator/WasmOrchestratorService.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/index.d.ts +6 -0
- package/dist/application/modules/support/wasm-orchestrator/index.js +9 -0
- package/dist/application/modules/support/wasm-orchestrator/index.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.constants.d.ts +36 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.constants.js +44 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.constants.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.domain.d.ts +47 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.domain.js +2 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.domain.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.types.d.ts +136 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.types.js +2 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.types.js.map +1 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.utils.d.ts +91 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.utils.js +250 -0
- package/dist/application/modules/support/wasm-orchestrator/wasm-orchestrator.utils.js.map +1 -0
- package/dist/application/workers/index.d.ts +42 -42
- package/dist/application/workers/index.js +8 -8
- package/dist/application/workers/wasm/WasmWorkerService.d.ts +66 -0
- package/dist/application/workers/wasm/WasmWorkerService.js +801 -0
- package/dist/application/workers/wasm/WasmWorkerService.js.map +1 -0
- package/dist/application/workers/wasm/index.d.ts +4 -0
- package/dist/application/workers/wasm/index.js +9 -0
- package/dist/application/workers/wasm/index.js.map +1 -0
- package/dist/application/workers/wasm/wasm-worker.constants.d.ts +5 -0
- package/dist/application/workers/wasm/wasm-worker.constants.js +6 -0
- package/dist/application/workers/wasm/wasm-worker.constants.js.map +1 -0
- package/dist/application/workers/wasm/wasm-worker.domain.d.ts +99 -0
- package/dist/application/workers/wasm/wasm-worker.domain.js +2 -0
- package/dist/application/workers/wasm/wasm-worker.domain.js.map +1 -0
- package/dist/application/workers/wasm/wasm-worker.types.d.ts +88 -0
- package/dist/application/workers/wasm/wasm-worker.types.js +2 -0
- package/dist/application/workers/wasm/wasm-worker.types.js.map +1 -0
- package/dist/application/workers/wasm/wasm-worker.utils.d.ts +10 -0
- package/dist/application/workers/wasm/wasm-worker.utils.js +130 -0
- package/dist/application/workers/wasm/wasm-worker.utils.js.map +1 -0
- package/dist/buildConfig.d.ts +3 -0
- package/dist/buildConfig.js +7 -0
- package/dist/buildConfig.js.map +1 -0
- package/dist/cameraUtils.d.ts +77 -77
- package/dist/cameraUtils.js +361 -361
- package/dist/constants.d.ts +9 -9
- package/dist/constants.js +13 -13
- package/dist/createCallback.d.ts +56 -56
- package/dist/createCallback.js +332 -331
- package/dist/createCallback.js.map +1 -1
- package/dist/dbUtils.d.ts +14 -14
- package/dist/dbUtils.js +148 -148
- package/dist/envUtils.d.ts +4 -4
- package/dist/envUtils.js +16 -16
- package/dist/faceModule.d.ts +196 -196
- package/dist/faceModule.js +978 -978
- package/dist/featureFlagInit.d.ts +11 -0
- package/dist/featureFlagInit.js +44 -0
- package/dist/featureFlagInit.js.map +1 -0
- package/dist/index.d.ts +38 -38
- package/dist/index.js +82 -82
- package/dist/main.d.ts +30 -30
- package/dist/main.js +84 -84
- package/dist/types.d.ts +139 -139
- package/dist/types.js +77 -77
- package/dist/utils.d.ts +84 -84
- package/dist/utils.js +580 -580
- package/package.json +102 -102
- package/wasm/ultra/nosimd/{25.11.13-1357710 → 26.01.08-1300478}/privid_fhe_uber.js +18 -18
- package/wasm/ultra/nosimd/{25.11.13-1357710 → 26.01.08-1300478}/privid_fhe_uber.wasm +0 -0
- package/wasm/ultra/nosimd/version.json +2 -2
- package/wasm/ultra/simd/{25.11.13-1357710 → 26.01.08-1300478}/privid_fhe_uber.js +18 -18
- package/wasm/ultra/simd/{25.11.13-1357710 → 26.01.08-1300478}/privid_fhe_uber.wasm +0 -0
- package/wasm/ultra/simd/version.json +2 -2
- package/workers/comlink.min.js +7 -7
- package/workers/comlink.min.js.map +1 -1
- package/workers/wasm.worker.js +936 -924
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
export const CANVAS_CLEANUP_DIMENSION = 1;
|
|
2
|
-
export const MAX_DIMENSION = 720;
|
|
3
|
-
export const LOG_MESSAGES = {
|
|
4
|
-
ULTRA_PROCESS: '---------------------ULTRA_PROCESS----------------------',
|
|
5
|
-
PREDICT_ONE_FA: '---------------------PREDICT_ONE_FA----------------------',
|
|
6
|
-
FACE_LOGIN: '---------------------FACE_LOGIN----------------------',
|
|
7
|
-
AGE_ESTIMATION: '---------------------AGE_ESTIMATION----------------------',
|
|
8
|
-
};
|
|
9
|
-
export const URL_OVERRIDES = {
|
|
10
|
-
PREDICT: 'predict',
|
|
11
|
-
PREDICT_STATUS: 'predict-status',
|
|
12
|
-
CONFIRM_USER: 'confirm-user',
|
|
13
|
-
DELETE_USER: 'predict/delete',
|
|
14
|
-
};
|
|
15
|
-
export const ENROLL_BASE_CONFIG = {
|
|
16
|
-
input_image_format: 'rgba',
|
|
17
|
-
angle_rotation_left_threshold: 20.0,
|
|
18
|
-
angle_rotation_right_threshold: 20.0,
|
|
19
|
-
threshold_high_vertical_enroll: 0.9,
|
|
20
|
-
threshold_down_vertical_enroll: 2.2,
|
|
21
|
-
anti_spoofing_threshold: 0.8,
|
|
22
|
-
threshold_profile_enroll: 0.66,
|
|
23
|
-
blur_threshold_enroll_pred: 40,
|
|
24
|
-
threshold_user_too_close: 0.52,
|
|
25
|
-
threshold_user_too_far: 0.165,
|
|
26
|
-
allow_only_one_face: true,
|
|
27
|
-
threshold_user_up: 0.15,
|
|
28
|
-
threshold_user_down: 0.9,
|
|
29
|
-
threshold_user_left: 0.8,
|
|
30
|
-
threshold_user_right: 0.2,
|
|
31
|
-
};
|
|
32
|
-
export const AGE_ESTIMATION_BASE_CONFIG = {
|
|
33
|
-
input_image_format: 'rgba',
|
|
34
|
-
angle_rotation_left_threshold: 20.0,
|
|
35
|
-
angle_rotation_right_threshold: 20.0,
|
|
36
|
-
anti_spoofing_threshold: 0.8,
|
|
37
|
-
threshold_profile_predict: 0.66,
|
|
38
|
-
blur_threshold_enroll_pred: 40,
|
|
39
|
-
threshold_user_too_close: 0.8,
|
|
40
|
-
threshold_user_too_far: 0.2,
|
|
41
|
-
threshold_user_up: 0.15,
|
|
42
|
-
threshold_user_down: 0.9,
|
|
43
|
-
threshold_user_left: 0.8,
|
|
44
|
-
threshold_user_right: 0.2,
|
|
45
|
-
threshold_high_vertical_predict: 0.9,
|
|
46
|
-
threshold_down_vertical_predict: 2.2,
|
|
47
|
-
url_name_override: '',
|
|
48
|
-
disable_predict_mf: false,
|
|
49
|
-
mf_count_override: 5,
|
|
50
|
-
disable_estimate_age_mf: false,
|
|
51
|
-
threshold_profile_enroll: 0.6,
|
|
52
|
-
allow_only_one_face: false,
|
|
53
|
-
};
|
|
1
|
+
export const CANVAS_CLEANUP_DIMENSION = 1;
|
|
2
|
+
export const MAX_DIMENSION = 720;
|
|
3
|
+
export const LOG_MESSAGES = {
|
|
4
|
+
ULTRA_PROCESS: '---------------------ULTRA_PROCESS----------------------',
|
|
5
|
+
PREDICT_ONE_FA: '---------------------PREDICT_ONE_FA----------------------',
|
|
6
|
+
FACE_LOGIN: '---------------------FACE_LOGIN----------------------',
|
|
7
|
+
AGE_ESTIMATION: '---------------------AGE_ESTIMATION----------------------',
|
|
8
|
+
};
|
|
9
|
+
export const URL_OVERRIDES = {
|
|
10
|
+
PREDICT: 'predict',
|
|
11
|
+
PREDICT_STATUS: 'predict-status',
|
|
12
|
+
CONFIRM_USER: 'confirm-user',
|
|
13
|
+
DELETE_USER: 'predict/delete',
|
|
14
|
+
};
|
|
15
|
+
export const ENROLL_BASE_CONFIG = {
|
|
16
|
+
input_image_format: 'rgba',
|
|
17
|
+
angle_rotation_left_threshold: 20.0,
|
|
18
|
+
angle_rotation_right_threshold: 20.0,
|
|
19
|
+
threshold_high_vertical_enroll: 0.9,
|
|
20
|
+
threshold_down_vertical_enroll: 2.2,
|
|
21
|
+
anti_spoofing_threshold: 0.8,
|
|
22
|
+
threshold_profile_enroll: 0.66,
|
|
23
|
+
blur_threshold_enroll_pred: 40,
|
|
24
|
+
threshold_user_too_close: 0.52,
|
|
25
|
+
threshold_user_too_far: 0.165,
|
|
26
|
+
allow_only_one_face: true,
|
|
27
|
+
threshold_user_up: 0.15,
|
|
28
|
+
threshold_user_down: 0.9,
|
|
29
|
+
threshold_user_left: 0.8,
|
|
30
|
+
threshold_user_right: 0.2,
|
|
31
|
+
};
|
|
32
|
+
export const AGE_ESTIMATION_BASE_CONFIG = {
|
|
33
|
+
input_image_format: 'rgba',
|
|
34
|
+
angle_rotation_left_threshold: 20.0,
|
|
35
|
+
angle_rotation_right_threshold: 20.0,
|
|
36
|
+
anti_spoofing_threshold: 0.8,
|
|
37
|
+
threshold_profile_predict: 0.66,
|
|
38
|
+
blur_threshold_enroll_pred: 40,
|
|
39
|
+
threshold_user_too_close: 0.8,
|
|
40
|
+
threshold_user_too_far: 0.2,
|
|
41
|
+
threshold_user_up: 0.15,
|
|
42
|
+
threshold_user_down: 0.9,
|
|
43
|
+
threshold_user_left: 0.8,
|
|
44
|
+
threshold_user_right: 0.2,
|
|
45
|
+
threshold_high_vertical_predict: 0.9,
|
|
46
|
+
threshold_down_vertical_predict: 2.2,
|
|
47
|
+
url_name_override: '',
|
|
48
|
+
disable_predict_mf: false,
|
|
49
|
+
mf_count_override: 5,
|
|
50
|
+
disable_estimate_age_mf: false,
|
|
51
|
+
threshold_profile_enroll: 0.6,
|
|
52
|
+
allow_only_one_face: false,
|
|
53
|
+
};
|
|
54
54
|
//# sourceMappingURL=face.constants.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FaceEnrollParams, EstimateAgeParams, FaceLoginProps, PredictProps } from './face.types';
|
|
2
|
-
export interface Face {
|
|
3
|
-
faceLogin: (props: FaceLoginProps) => Promise<unknown>;
|
|
4
|
-
predict: (props: PredictProps) => Promise<unknown>;
|
|
5
|
-
predictWithStatus: (props: PredictProps) => Promise<unknown>;
|
|
6
|
-
predictConfirmUser: (props: PredictProps) => Promise<unknown>;
|
|
7
|
-
predictDeleteUser: (props: PredictProps) => Promise<unknown>;
|
|
8
|
-
ageEstimation: (params: EstimateAgeParams) => Promise<unknown>;
|
|
9
|
-
enroll: (props: FaceEnrollParams) => Promise<unknown>;
|
|
10
|
-
}
|
|
1
|
+
import { FaceEnrollParams, EstimateAgeParams, FaceLoginProps, PredictProps } from './face.types';
|
|
2
|
+
export interface Face {
|
|
3
|
+
faceLogin: (props: FaceLoginProps) => Promise<unknown>;
|
|
4
|
+
predict: (props: PredictProps) => Promise<unknown>;
|
|
5
|
+
predictWithStatus: (props: PredictProps) => Promise<unknown>;
|
|
6
|
+
predictConfirmUser: (props: PredictProps) => Promise<unknown>;
|
|
7
|
+
predictDeleteUser: (props: PredictProps) => Promise<unknown>;
|
|
8
|
+
ageEstimation: (params: EstimateAgeParams) => Promise<unknown>;
|
|
9
|
+
enroll: (props: FaceEnrollParams) => Promise<unknown>;
|
|
10
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=face.domain.js.map
|
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
import { callbackTypeEnum } from '../../../../createCallback';
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import { callbackTypeEnum } from '../../../../createCallback';
|
|
2
|
+
export type WasmProgressCallback = (progress_type: number, message: string, progress_value: number) => void;
|
|
3
|
+
type BaseProps = {
|
|
4
|
+
callback: (result: any) => void;
|
|
5
|
+
onAntiSpoofProgress?: WasmProgressCallback;
|
|
6
|
+
config?: any;
|
|
7
|
+
element?: string;
|
|
8
|
+
returnPortrait?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type FaceLoginProps = BaseProps & {
|
|
11
|
+
useExistingCanvas?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type PredictProps = BaseProps & {
|
|
14
|
+
image?: ImageData;
|
|
15
|
+
};
|
|
16
|
+
export type EstimateAgeParams = BaseProps & {
|
|
17
|
+
logMessage?: string;
|
|
18
|
+
};
|
|
19
|
+
export type PredictFunction = (images: ImageData[], isSimd: boolean, config: string, resultProxy: any, onAntiSpoofProgress?: WasmProgressCallback) => Promise<any>;
|
|
20
|
+
export type UltraProcessOptions = {
|
|
21
|
+
callback: (result: any) => void;
|
|
22
|
+
config?: any;
|
|
23
|
+
element?: string;
|
|
24
|
+
image?: ImageData;
|
|
25
|
+
returnPortrait?: boolean;
|
|
26
|
+
useExistingCanvas?: boolean;
|
|
27
|
+
logMessage?: string;
|
|
28
|
+
onAntiSpoofProgress?: WasmProgressCallback;
|
|
29
|
+
callbackType?: callbackTypeEnum;
|
|
30
|
+
};
|
|
31
|
+
export type FaceEnrollParams = {
|
|
32
|
+
callback: (result: any) => void;
|
|
33
|
+
config?: any;
|
|
34
|
+
element?: string;
|
|
35
|
+
returnPortrait?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type Dimensions = {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=face.types.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Dimensions } from './face.types';
|
|
2
|
-
export declare function releaseCanvas(canvas: HTMLCanvasElement): void;
|
|
3
|
-
export declare function defineDimensionsForCanvas(videoElementDimensions: Dimensions): Dimensions;
|
|
4
|
-
/**
|
|
5
|
-
* Check if debug mode should create images
|
|
6
|
-
*/
|
|
7
|
-
export declare function shouldCreateDebugImages(): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Create and download images for debugging purposes
|
|
10
|
-
*/
|
|
11
|
-
export declare function createDebugImages(images: ImageData[], title: string, isEnrollFlow: boolean): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Wrapper for callback that creates debug images before calling the original callback
|
|
14
|
-
*/
|
|
15
|
-
export declare function wrapCallbackWithImageCreation<T>(callback: (result: T) => void, imageData: ImageData, isEnrollFlow: boolean): (result: T) => void;
|
|
1
|
+
import { Dimensions } from './face.types';
|
|
2
|
+
export declare function releaseCanvas(canvas: HTMLCanvasElement): void;
|
|
3
|
+
export declare function defineDimensionsForCanvas(videoElementDimensions: Dimensions): Dimensions;
|
|
4
|
+
/**
|
|
5
|
+
* Check if debug mode should create images
|
|
6
|
+
*/
|
|
7
|
+
export declare function shouldCreateDebugImages(): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Create and download images for debugging purposes
|
|
10
|
+
*/
|
|
11
|
+
export declare function createDebugImages(images: ImageData[], title: string, isEnrollFlow: boolean): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Wrapper for callback that creates debug images before calling the original callback
|
|
14
|
+
*/
|
|
15
|
+
export declare function wrapCallbackWithImageCreation<T>(callback: (result: T) => void, imageData: ImageData, isEnrollFlow: boolean): (result: T) => void;
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { getDebugType, printLogs } from '../../global/shared.utils';
|
|
11
|
-
import { CANVAS_CLEANUP_DIMENSION, MAX_DIMENSION } from './face.constants';
|
|
12
|
-
// Debug types that enable image creation
|
|
13
|
-
const DEBUG_TYPES_WITH_IMAGES = ['900', '901', '902', '903'];
|
|
14
|
-
export function releaseCanvas(canvas) {
|
|
15
|
-
try {
|
|
16
|
-
printLogs('STARTING TO RELEASE CANVAS', '');
|
|
17
|
-
const canvasElement = canvas;
|
|
18
|
-
canvasElement.width = CANVAS_CLEANUP_DIMENSION;
|
|
19
|
-
canvasElement.height = CANVAS_CLEANUP_DIMENSION;
|
|
20
|
-
const ctx = canvasElement.getContext('2d', { willReadFrequently: true });
|
|
21
|
-
if (ctx) {
|
|
22
|
-
ctx.clearRect(0, 0, CANVAS_CLEANUP_DIMENSION, CANVAS_CLEANUP_DIMENSION);
|
|
23
|
-
}
|
|
24
|
-
printLogs('CANVAS RELEASED', '');
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
printLogs(`CLEARING CANVAS: `, e, 'ERROR');
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export function defineDimensionsForCanvas(videoElementDimensions) {
|
|
31
|
-
if (Math.max(videoElementDimensions.width, videoElementDimensions.height) < MAX_DIMENSION) {
|
|
32
|
-
return videoElementDimensions;
|
|
33
|
-
}
|
|
34
|
-
const downscale = MAX_DIMENSION / Math.max(videoElementDimensions.width, videoElementDimensions.height);
|
|
35
|
-
return {
|
|
36
|
-
width: Math.round(videoElementDimensions.width * downscale),
|
|
37
|
-
height: Math.round(videoElementDimensions.height * downscale),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Check if debug mode should create images
|
|
42
|
-
*/
|
|
43
|
-
export function shouldCreateDebugImages() {
|
|
44
|
-
const debugType = getDebugType();
|
|
45
|
-
return DEBUG_TYPES_WITH_IMAGES.includes(debugType);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Create and download images for debugging purposes
|
|
49
|
-
*/
|
|
50
|
-
export function createDebugImages(images, title, isEnrollFlow) {
|
|
51
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
if (!shouldCreateDebugImages()) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
try {
|
|
56
|
-
const promises = images.map((imageData) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
const canvas = document.createElement('canvas');
|
|
58
|
-
canvas.width = imageData.width;
|
|
59
|
-
canvas.height = imageData.height;
|
|
60
|
-
const context = canvas.getContext('2d');
|
|
61
|
-
context.putImageData(imageData, 0, 0);
|
|
62
|
-
const blob = yield new Promise((resolve) => canvas.toBlob(resolve, 'image/jpeg'));
|
|
63
|
-
const url = URL.createObjectURL(blob);
|
|
64
|
-
return { url, blob };
|
|
65
|
-
}));
|
|
66
|
-
const data = yield Promise.all(promises);
|
|
67
|
-
const a = document.createElement('a');
|
|
68
|
-
for (let i = 0; i < data.length; i++) {
|
|
69
|
-
yield new Promise((resolve) => {
|
|
70
|
-
a.href = data[i].url;
|
|
71
|
-
a.type = 'image/png';
|
|
72
|
-
a.download = `${title}_${isEnrollFlow ? 'enroll' : 'predict'}.png`;
|
|
73
|
-
document.body.appendChild(a);
|
|
74
|
-
a.click();
|
|
75
|
-
setTimeout(() => {
|
|
76
|
-
document.body.removeChild(a);
|
|
77
|
-
URL.revokeObjectURL(data[i].url);
|
|
78
|
-
resolve();
|
|
79
|
-
}, 1000);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
printLogs('[face.utils] Debug images created and downloaded', { title, count: images.length });
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
printLogs('[face.utils] Error creating debug images', error, 'ERROR');
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Wrapper for callback that creates debug images before calling the original callback
|
|
91
|
-
*/
|
|
92
|
-
export function wrapCallbackWithImageCreation(callback, imageData, isEnrollFlow) {
|
|
93
|
-
return (result) => __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
var _a, _b;
|
|
95
|
-
if (shouldCreateDebugImages()) {
|
|
96
|
-
const title = `original_${(_a = result === null || result === void 0 ? void 0 : result.face_validation_status) !== null && _a !== void 0 ? _a : 'unknown'}_${(_b = result === null || result === void 0 ? void 0 : result.antispoof_status) !== null && _b !== void 0 ? _b : 'unknown'}`;
|
|
97
|
-
yield createDebugImages([imageData], title, isEnrollFlow);
|
|
98
|
-
}
|
|
99
|
-
callback(result);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getDebugType, printLogs } from '../../global/shared.utils';
|
|
11
|
+
import { CANVAS_CLEANUP_DIMENSION, MAX_DIMENSION } from './face.constants';
|
|
12
|
+
// Debug types that enable image creation
|
|
13
|
+
const DEBUG_TYPES_WITH_IMAGES = ['900', '901', '902', '903'];
|
|
14
|
+
export function releaseCanvas(canvas) {
|
|
15
|
+
try {
|
|
16
|
+
printLogs('STARTING TO RELEASE CANVAS', '');
|
|
17
|
+
const canvasElement = canvas;
|
|
18
|
+
canvasElement.width = CANVAS_CLEANUP_DIMENSION;
|
|
19
|
+
canvasElement.height = CANVAS_CLEANUP_DIMENSION;
|
|
20
|
+
const ctx = canvasElement.getContext('2d', { willReadFrequently: true });
|
|
21
|
+
if (ctx) {
|
|
22
|
+
ctx.clearRect(0, 0, CANVAS_CLEANUP_DIMENSION, CANVAS_CLEANUP_DIMENSION);
|
|
23
|
+
}
|
|
24
|
+
printLogs('CANVAS RELEASED', '');
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
printLogs(`CLEARING CANVAS: `, e, 'ERROR');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function defineDimensionsForCanvas(videoElementDimensions) {
|
|
31
|
+
if (Math.max(videoElementDimensions.width, videoElementDimensions.height) < MAX_DIMENSION) {
|
|
32
|
+
return videoElementDimensions;
|
|
33
|
+
}
|
|
34
|
+
const downscale = MAX_DIMENSION / Math.max(videoElementDimensions.width, videoElementDimensions.height);
|
|
35
|
+
return {
|
|
36
|
+
width: Math.round(videoElementDimensions.width * downscale),
|
|
37
|
+
height: Math.round(videoElementDimensions.height * downscale),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check if debug mode should create images
|
|
42
|
+
*/
|
|
43
|
+
export function shouldCreateDebugImages() {
|
|
44
|
+
const debugType = getDebugType();
|
|
45
|
+
return DEBUG_TYPES_WITH_IMAGES.includes(debugType);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Create and download images for debugging purposes
|
|
49
|
+
*/
|
|
50
|
+
export function createDebugImages(images, title, isEnrollFlow) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
if (!shouldCreateDebugImages()) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const promises = images.map((imageData) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const canvas = document.createElement('canvas');
|
|
58
|
+
canvas.width = imageData.width;
|
|
59
|
+
canvas.height = imageData.height;
|
|
60
|
+
const context = canvas.getContext('2d');
|
|
61
|
+
context.putImageData(imageData, 0, 0);
|
|
62
|
+
const blob = yield new Promise((resolve) => canvas.toBlob(resolve, 'image/jpeg'));
|
|
63
|
+
const url = URL.createObjectURL(blob);
|
|
64
|
+
return { url, blob };
|
|
65
|
+
}));
|
|
66
|
+
const data = yield Promise.all(promises);
|
|
67
|
+
const a = document.createElement('a');
|
|
68
|
+
for (let i = 0; i < data.length; i++) {
|
|
69
|
+
yield new Promise((resolve) => {
|
|
70
|
+
a.href = data[i].url;
|
|
71
|
+
a.type = 'image/png';
|
|
72
|
+
a.download = `${title}_${isEnrollFlow ? 'enroll' : 'predict'}.png`;
|
|
73
|
+
document.body.appendChild(a);
|
|
74
|
+
a.click();
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
document.body.removeChild(a);
|
|
77
|
+
URL.revokeObjectURL(data[i].url);
|
|
78
|
+
resolve();
|
|
79
|
+
}, 1000);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
printLogs('[face.utils] Debug images created and downloaded', { title, count: images.length });
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
printLogs('[face.utils] Error creating debug images', error, 'ERROR');
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Wrapper for callback that creates debug images before calling the original callback
|
|
91
|
+
*/
|
|
92
|
+
export function wrapCallbackWithImageCreation(callback, imageData, isEnrollFlow) {
|
|
93
|
+
return (result) => __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
if (shouldCreateDebugImages()) {
|
|
96
|
+
const title = `original_${(_a = result === null || result === void 0 ? void 0 : result.face_validation_status) !== null && _a !== void 0 ? _a : 'unknown'}_${(_b = result === null || result === void 0 ? void 0 : result.antispoof_status) !== null && _b !== void 0 ? _b : 'unknown'}`;
|
|
97
|
+
yield createDebugImages([imageData], title, isEnrollFlow);
|
|
98
|
+
}
|
|
99
|
+
callback(result);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
102
|
//# sourceMappingURL=face.utils.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { Face } from './face.domain';
|
|
2
|
-
export { FaceService } from './FaceService';
|
|
3
|
-
export type { FaceLoginProps, PredictProps, EstimateAgeParams, FaceEnrollParams } from './face.types';
|
|
1
|
+
export type { Face } from './face.domain';
|
|
2
|
+
export { FaceService } from './FaceService';
|
|
3
|
+
export type { FaceLoginProps, PredictProps, EstimateAgeParams, FaceEnrollParams } from './face.types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { FaceService } from './FaceService';
|
|
1
|
+
export { FaceService } from './FaceService';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CANVAS_ID = "test-canvas";
|
|
2
|
-
export declare const INVALID_VIDEO_ERROR = "error";
|
|
1
|
+
export declare const CANVAS_ID = "test-canvas";
|
|
2
|
+
export declare const INVALID_VIDEO_ERROR = "error";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const CANVAS_ID = 'test-canvas';
|
|
2
|
-
export const INVALID_VIDEO_ERROR = 'error';
|
|
1
|
+
export const CANVAS_ID = 'test-canvas';
|
|
2
|
+
export const INVALID_VIDEO_ERROR = 'error';
|
|
3
3
|
//# sourceMappingURL=shared.constants.js.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export declare function iOS(): boolean;
|
|
2
|
-
export declare function printLogs(message: string, data: any, type?: string): void;
|
|
3
|
-
export declare function getDebugType(): string;
|
|
4
|
-
export declare function getDefaultCameraDeviceId(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Set default camera device ID in localStorage
|
|
7
|
-
*/
|
|
8
|
-
export declare function setDefaultCameraDeviceId(deviceId: string): void;
|
|
9
|
-
/**
|
|
10
|
-
* Check if current platform is mobile using detect-browser
|
|
11
|
-
*/
|
|
12
|
-
export declare function isMobilePlatform(): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Check if current device is mobile using user agent detection
|
|
15
|
-
* More comprehensive than isMobilePlatform but uses UA sniffing
|
|
16
|
-
*/
|
|
17
|
-
export declare function isMobileDevice(): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Get SIMD support status
|
|
20
|
-
*/
|
|
21
|
-
export declare function getIsSIMD(): Promise<boolean>;
|
|
22
|
-
/**
|
|
23
|
-
* Convert canvas/image data to base64
|
|
24
|
-
*/
|
|
25
|
-
export declare function imageDataToBase64(imageData: ImageData): Promise<string>;
|
|
1
|
+
export declare function iOS(): boolean;
|
|
2
|
+
export declare function printLogs(message: string, data: any, type?: string): void;
|
|
3
|
+
export declare function getDebugType(): string;
|
|
4
|
+
export declare function getDefaultCameraDeviceId(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Set default camera device ID in localStorage
|
|
7
|
+
*/
|
|
8
|
+
export declare function setDefaultCameraDeviceId(deviceId: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Check if current platform is mobile using detect-browser
|
|
11
|
+
*/
|
|
12
|
+
export declare function isMobilePlatform(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Check if current device is mobile using user agent detection
|
|
15
|
+
* More comprehensive than isMobilePlatform but uses UA sniffing
|
|
16
|
+
*/
|
|
17
|
+
export declare function isMobileDevice(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Get SIMD support status
|
|
20
|
+
*/
|
|
21
|
+
export declare function getIsSIMD(): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Convert canvas/image data to base64
|
|
24
|
+
*/
|
|
25
|
+
export declare function imageDataToBase64(imageData: ImageData): Promise<string>;
|