facecog-liveness-showcase 0.0.1
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/.browserslistrc +15 -0
- package/.dockerignore +48 -0
- package/.editorconfig +16 -0
- package/.eslintrc.json +47 -0
- package/.vercelignore +7 -0
- package/.vscode/extensions.json +5 -0
- package/.vscode/settings.json +3 -0
- package/DOCKER.md +221 -0
- package/Dockerfile +33 -0
- package/README.md +268 -0
- package/angular.json +156 -0
- package/capacitor.config.ts +9 -0
- package/docker-compose.dev.yml +20 -0
- package/docker-compose.yml +18 -0
- package/ionic.config.json +7 -0
- package/jest.config.js +38 -0
- package/nginx.conf +50 -0
- package/package.json +131 -0
- package/patches/ng-packagr+20.3.2.patch +60 -0
- package/projects/facecog-liveness-verification/README.md +295 -0
- package/projects/facecog-liveness-verification/ng-package.json +7 -0
- package/projects/facecog-liveness-verification/package.json +48 -0
- package/projects/facecog-liveness-verification/scripts/build-with-wrapper-copy.js +38 -0
- package/projects/facecog-liveness-verification/scripts/copy-wrapper-after-ngc.js +35 -0
- package/projects/facecog-liveness-verification/sources/FaceLivenessReactWrapper.tsx +320 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.d.ts +28 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.js +247 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.generated.js.map +1 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.js.map +1 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/FaceLivenessReactWrapper.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/components/aws-face-liveness/aws-face-liveness.component.ts +500 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.html +41 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.scss +234 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.spec.ts +158 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-permission/camera-permission.component.ts +58 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-verification/camera-verification.component.html +34 -0
- package/projects/facecog-liveness-verification/src/lib/components/camera-verification/camera-verification.component.ts +210 -0
- package/projects/facecog-liveness-verification/src/lib/components/dialogs/save-custom-pose-dialog.component.ts +174 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.html +45 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.scss +87 -0
- package/projects/facecog-liveness-verification/src/lib/components/facetec-scan/facetec-scan.component.ts +182 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.html +394 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.scss +1567 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.spec.ts +699 -0
- package/projects/facecog-liveness-verification/src/lib/components/intro/intro.component.ts +721 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.html +120 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.scss +611 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.spec.ts +605 -0
- package/projects/facecog-liveness-verification/src/lib/components/live-preview/live-preview.component.ts +524 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.html +73 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.scss +19 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.spec.ts +673 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-flow/liveness-flow.component.ts +963 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.html +38 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.scss +10 -0
- package/projects/facecog-liveness-verification/src/lib/components/liveness-verification/liveness-verification.component.ts +233 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.html +17 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.spec.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/components/pose-selection/pose-selection.component.ts +33 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.html +17 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.scss +156 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.spec.ts +46 -0
- package/projects/facecog-liveness-verification/src/lib/components/processing/processing.component.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.html +190 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.scss +534 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.spec.ts +286 -0
- package/projects/facecog-liveness-verification/src/lib/components/verification-result/verification-result.component.ts +155 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/analyze-response.interface.ts +16 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/aws-face-liveness.interface.ts +46 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-adapter.interface.ts +21 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-http-client.interface.ts +93 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/backend-response.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/camera-provider.interface.ts +107 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/category-info.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-data.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-repository.interface.ts +48 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-response.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/index.ts +52 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-action-result.interface.ts +13 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-config.interface.ts +17 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-metadata.interface.ts +17 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-result.interface.ts +24 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-verification-config.interface.ts +41 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/multi-backend-analyze-response.interface.ts +21 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/multi-backend-liveness-result.interface.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-definition.interface.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-keypoint.interface.ts +12 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-match-result.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/pose-verify-response.interface.ts +8 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/scan-results.interface.ts +29 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-plan.interface.ts +42 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-progress-event.interface.ts +12 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-session.interface.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/verification-step-change-event.interface.ts +11 -0
- package/projects/facecog-liveness-verification/src/lib/interfaces/video-recording.interface.ts +9 -0
- package/projects/facecog-liveness-verification/src/lib/liveness-verification.module.ts +123 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/aws-face-liveness-component.token.ts +23 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/category-info.constant.ts +14 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/default-liveness-config.constant.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/liveness-verification-config.token.ts +16 -0
- package/projects/facecog-liveness-verification/src/lib/models/constants/pose-definitions.constant.ts +377 -0
- package/projects/facecog-liveness-verification/src/lib/models/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/index.ts +2 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/pose.utils.spec.ts +76 -0
- package/projects/facecog-liveness-verification/src/lib/models/utils/pose.utils.ts +59 -0
- package/projects/facecog-liveness-verification/src/lib/services/aws-face-liveness.service.ts +49 -0
- package/projects/facecog-liveness-verification/src/lib/services/backend-http.service.spec.ts +111 -0
- package/projects/facecog-liveness-verification/src/lib/services/backend-http.service.ts +130 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/azure-backend.service.spec.ts +69 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/azure-backend.service.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/facetec-backend.service.spec.ts +24 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/facetec-backend.service.ts +35 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/mock-backend.service.spec.ts +36 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/mock-backend.service.ts +39 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/openpose-backend.service.spec.ts +81 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/openpose-backend.service.ts +72 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/rekognition-analysis-backend.service.spec.ts +69 -0
- package/projects/facecog-liveness-verification/src/lib/services/backends/rekognition-analysis-backend.service.ts +83 -0
- package/projects/facecog-liveness-verification/src/lib/services/camera.service.spec.ts +200 -0
- package/projects/facecog-liveness-verification/src/lib/services/camera.service.ts +155 -0
- package/projects/facecog-liveness-verification/src/lib/services/custom-poses-api.service.ts +117 -0
- package/projects/facecog-liveness-verification/src/lib/services/index.ts +18 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-backend.service.spec.ts +103 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-backend.service.ts +61 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-config.service.spec.ts +109 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-config.service.ts +70 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-orchestrator.service.spec.ts +144 -0
- package/projects/facecog-liveness-verification/src/lib/services/liveness-orchestrator.service.ts +162 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/hand-gesture-detection.service.ts +315 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/index.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/openpose.service.ts +287 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/pose-comparison.service.ts +353 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/pose-matching.service.ts +2370 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-detection/reference-pose.service.ts +271 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-selection.service.spec.ts +183 -0
- package/projects/facecog-liveness-verification/src/lib/services/pose-selection.service.ts +179 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-api.service.spec.ts +159 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-api.service.ts +151 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-plan.service.spec.ts +184 -0
- package/projects/facecog-liveness-verification/src/lib/services/verification-plan.service.ts +94 -0
- package/projects/facecog-liveness-verification/src/lib/services/video-recorder.service.spec.ts +52 -0
- package/projects/facecog-liveness-verification/src/lib/services/video-recorder.service.ts +117 -0
- package/projects/facecog-liveness-verification/src/lib/types/detection-strategy.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/index.ts +7 -0
- package/projects/facecog-liveness-verification/src/lib/types/liveness-action.type.ts +31 -0
- package/projects/facecog-liveness-verification/src/lib/types/liveness-backend.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/pose-category.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/pose-difficulty.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/verification-flow-step.type.ts +5 -0
- package/projects/facecog-liveness-verification/src/lib/types/verification-step-kind.type.ts +4 -0
- package/projects/facecog-liveness-verification/src/public-api.ts +150 -0
- package/projects/facecog-liveness-verification/tsconfig.lib.json +20 -0
- package/projects/facecog-liveness-verification/tsconfig.lib.prod.json +11 -0
- package/projects/facecog-liveness-verification/tsconfig.spec.json +13 -0
- package/projects/facecog-liveness-verification/tsconfig.wrapper.json +15 -0
- package/projects/facecog-liveness-verification-test/src/app/app-routing.module.ts +22 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.html +3 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.scss +0 -0
- package/projects/facecog-liveness-verification-test/src/app/app.component.ts +11 -0
- package/projects/facecog-liveness-verification-test/src/app/app.module.ts +27 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home-routing.module.ts +16 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.module.ts +19 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.html +39 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.scss +97 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.spec.ts +24 -0
- package/projects/facecog-liveness-verification-test/src/app/home/home.page.ts +92 -0
- package/projects/facecog-liveness-verification-test/src/app/home/verification-modal.component.ts +106 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Bold_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Medium_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Regular_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-SemiBold_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/fonts/gilroy/Gilroy-Thin_0.ttf +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/icon/favicon.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Five_Fingers_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Left_Palm.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Ok_Sign_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Peace_Sign_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/README.md +77 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Right_Palm.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Speak_Phrase.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Three_Fingers_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Thumbs_Up_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/Wave_Right.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/blink.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/blink_twice.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/center_face.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/clap.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cover_mouth.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cover_right_eye.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/cross_arms.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/face_straight.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/follow_dot.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/look_down.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/look_up.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/move_closer.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/nod.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/open_mouth.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/raise_eyebrow.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/rotate_face.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/shake_head.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/smile.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/tilt_left.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/tilt_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_chin_left.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_left_cheek.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_nose_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/touch_right_cheek.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/turn_left.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/turn_right.png +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/poses/wink.jpeg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/images/reference-pose.jpg +0 -0
- package/projects/facecog-liveness-verification-test/src/assets/shapes.svg +1 -0
- package/projects/facecog-liveness-verification-test/src/environments/environment.prod.ts +4 -0
- package/projects/facecog-liveness-verification-test/src/environments/environment.ts +17 -0
- package/projects/facecog-liveness-verification-test/src/global.scss +288 -0
- package/projects/facecog-liveness-verification-test/src/index.html +31 -0
- package/projects/facecog-liveness-verification-test/src/main.ts +6 -0
- package/projects/facecog-liveness-verification-test/src/polyfills.ts +55 -0
- package/projects/facecog-liveness-verification-test/src/theme/nextsapien-theme.scss +174 -0
- package/projects/facecog-liveness-verification-test/src/theme/variables.scss +2 -0
- package/projects/facecog-liveness-verification-test/src/zone-flags.ts +6 -0
- package/projects/facecog-liveness-verification-test/tsconfig.app.json +15 -0
- package/projects/facecog-liveness-verification-test/tsconfig.spec.json +14 -0
- package/setup-jest.ts +118 -0
- package/tsconfig.json +41 -0
- package/tsconfig.spec.json +15 -0
- package/vercel.json +24 -0
package/projects/facecog-liveness-verification/src/lib/interfaces/camera-provider.interface.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interface for camera provider abstraction
|
|
5
|
+
* Implement this interface in your app to provide platform-specific camera access
|
|
6
|
+
* (e.g., Capacitor for mobile, browser API for web)
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // capacitor-camera.provider.ts
|
|
11
|
+
* @Injectable()
|
|
12
|
+
* export class CapacitorCameraProvider implements ICameraProvider {
|
|
13
|
+
* async checkPermissions(): Promise<boolean> {
|
|
14
|
+
* const status = await Camera.checkPermissions();
|
|
15
|
+
* return status.camera === 'granted';
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* async requestPermissions(): Promise<boolean> {
|
|
19
|
+
* const status = await Camera.requestPermissions();
|
|
20
|
+
* return status.camera === 'granted';
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* async startCamera(videoElement: HTMLVideoElement): Promise<MediaStream> {
|
|
24
|
+
* // Implementation
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* stopCamera(): void {
|
|
28
|
+
* // Implementation
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* // app.module.ts
|
|
33
|
+
* providers: [
|
|
34
|
+
* { provide: CAMERA_PROVIDER, useClass: CapacitorCameraProvider }
|
|
35
|
+
* ]
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Brightness analysis result
|
|
40
|
+
*/
|
|
41
|
+
export interface BrightnessData {
|
|
42
|
+
brightness: number;
|
|
43
|
+
isLowLight: boolean;
|
|
44
|
+
isTooLight: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ICameraProvider {
|
|
48
|
+
/**
|
|
49
|
+
* Check if camera permissions are granted
|
|
50
|
+
*/
|
|
51
|
+
checkPermissions(): Promise<boolean>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Request camera permissions from the user
|
|
55
|
+
* @returns true if permission was granted, false otherwise
|
|
56
|
+
*/
|
|
57
|
+
requestPermissions(): Promise<boolean>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Start the camera and attach to video element
|
|
61
|
+
* @param videoElement The video element to attach the stream to
|
|
62
|
+
* @returns The media stream
|
|
63
|
+
*/
|
|
64
|
+
startCamera(videoElement: HTMLVideoElement): Promise<MediaStream>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Stop the camera and release resources
|
|
68
|
+
*/
|
|
69
|
+
stopCamera(): void;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Analyze brightness of a video frame
|
|
73
|
+
* @param videoElement The video element to analyze
|
|
74
|
+
* @returns Brightness data including level and warnings
|
|
75
|
+
*/
|
|
76
|
+
analyzeBrightness?(videoElement: HTMLVideoElement): BrightnessData;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Start continuous brightness monitoring
|
|
80
|
+
* @param videoElement The video element to monitor
|
|
81
|
+
* @param callback Callback function called with brightness data
|
|
82
|
+
* @param intervalMs How often to check brightness (default 1000ms)
|
|
83
|
+
* @returns Monitoring ID that can be used to stop monitoring
|
|
84
|
+
*/
|
|
85
|
+
startBrightnessMonitoring?(
|
|
86
|
+
videoElement: HTMLVideoElement,
|
|
87
|
+
callback: (data: BrightnessData) => void,
|
|
88
|
+
intervalMs?: number
|
|
89
|
+
): number;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Stop brightness monitoring
|
|
93
|
+
* @param monitoringId The ID returned by startBrightnessMonitoring
|
|
94
|
+
*/
|
|
95
|
+
stopBrightnessMonitoring?(monitoringId: number): void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Injection token for the camera provider
|
|
100
|
+
* Provide this in your app module with your implementation
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* providers: [
|
|
104
|
+
* { provide: CAMERA_PROVIDER, useClass: MyCameraProvider }
|
|
105
|
+
* ]
|
|
106
|
+
*/
|
|
107
|
+
export const CAMERA_PROVIDER = new InjectionToken<ICameraProvider>('CAMERA_PROVIDER');
|
package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-data.interface.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data structure for a custom pose saved by a user
|
|
3
|
+
*/
|
|
4
|
+
export interface CustomPoseData {
|
|
5
|
+
id: number;
|
|
6
|
+
userId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
category: string;
|
|
10
|
+
difficulty: string;
|
|
11
|
+
detectionStrategy: string;
|
|
12
|
+
imageBlobUrl: string;
|
|
13
|
+
poseKeypoints: any;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { CustomPoseData } from './custom-pose-data.interface';
|
|
4
|
+
import { CustomPoseResponse } from './custom-pose-response.interface';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Interface for custom pose repository implementations.
|
|
8
|
+
* Allows the library to work with custom poses without depending on a specific backend.
|
|
9
|
+
*/
|
|
10
|
+
export interface ICustomPoseRepository {
|
|
11
|
+
/**
|
|
12
|
+
* Observable stream of custom poses
|
|
13
|
+
*/
|
|
14
|
+
customPoses$: Observable<CustomPoseData[]>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Load all custom poses from the backend
|
|
18
|
+
*/
|
|
19
|
+
loadCustomPoses(): Observable<CustomPoseResponse>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Create a new custom pose from a base64 image
|
|
23
|
+
* Returns { pose, isNew } - isNew is false if a duplicate was found
|
|
24
|
+
*/
|
|
25
|
+
createCustomPoseFromBase64(
|
|
26
|
+
name: string,
|
|
27
|
+
description: string,
|
|
28
|
+
category: string,
|
|
29
|
+
difficulty: string,
|
|
30
|
+
base64Image: string,
|
|
31
|
+
poseKeypoints: any
|
|
32
|
+
): Promise<{ pose: CustomPoseData; isNew: boolean }>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Delete a custom pose by ID
|
|
36
|
+
*/
|
|
37
|
+
deleteCustomPose(id: number): Observable<CustomPoseResponse>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get current custom poses synchronously
|
|
41
|
+
*/
|
|
42
|
+
getCustomPoses(): CustomPoseData[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Injection token for custom pose repository
|
|
47
|
+
*/
|
|
48
|
+
export const CUSTOM_POSE_REPOSITORY = new InjectionToken<ICustomPoseRepository>('CUSTOM_POSE_REPOSITORY');
|
package/projects/facecog-liveness-verification/src/lib/interfaces/custom-pose-response.interface.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CustomPoseData } from './custom-pose-data.interface';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Response from custom pose API operations
|
|
5
|
+
*/
|
|
6
|
+
export interface CustomPoseResponse {
|
|
7
|
+
success: boolean;
|
|
8
|
+
pose?: CustomPoseData;
|
|
9
|
+
poses?: CustomPoseData[];
|
|
10
|
+
count?: number;
|
|
11
|
+
error?: string;
|
|
12
|
+
message?: string;
|
|
13
|
+
isNew?: boolean; // True if pose was newly created, false if duplicate found
|
|
14
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { LivenessVerificationConfig } from './liveness-verification-config.interface';
|
|
2
|
+
export { VerificationStepChangeEvent } from './verification-step-change-event.interface';
|
|
3
|
+
export { VerificationProgressEvent } from './verification-progress-event.interface';
|
|
4
|
+
export { LivenessConfig } from './liveness-config.interface';
|
|
5
|
+
export { LivenessMetadata } from './liveness-metadata.interface';
|
|
6
|
+
export { AnalyzeResponse } from './analyze-response.interface';
|
|
7
|
+
export { MultiBackendAnalyzeResponse } from './multi-backend-analyze-response.interface';
|
|
8
|
+
export { LivenessResult } from './liveness-result.interface';
|
|
9
|
+
export { PoseMatchResult } from './pose-match-result.interface';
|
|
10
|
+
export { LivenessActionResult } from './liveness-action-result.interface';
|
|
11
|
+
export { VideoRecording } from './video-recording.interface';
|
|
12
|
+
export { BackendResponse } from './backend-response.interface';
|
|
13
|
+
export { MultiBackendLivenessResult } from './multi-backend-liveness-result.interface';
|
|
14
|
+
export { PoseKeypoint } from './pose-keypoint.interface';
|
|
15
|
+
export { PoseDefinition } from './pose-definition.interface';
|
|
16
|
+
export { CategoryInfo } from './category-info.interface';
|
|
17
|
+
export { CustomPoseData } from './custom-pose-data.interface';
|
|
18
|
+
export { CustomPoseResponse } from './custom-pose-response.interface';
|
|
19
|
+
export { PoseVerifyResponse } from './pose-verify-response.interface';
|
|
20
|
+
|
|
21
|
+
// Backend and provider interfaces (moved from services/)
|
|
22
|
+
export { IBackendAdapter } from './backend-adapter.interface';
|
|
23
|
+
export { IBackendHttpClient, SessionResponse, BACKEND_HTTP_CLIENT } from './backend-http-client.interface';
|
|
24
|
+
export { ICameraProvider, BrightnessData, CAMERA_PROVIDER } from './camera-provider.interface';
|
|
25
|
+
export { ICustomPoseRepository, CUSTOM_POSE_REPOSITORY } from './custom-pose-repository.interface';
|
|
26
|
+
|
|
27
|
+
// Verification plan and session
|
|
28
|
+
export {
|
|
29
|
+
VerificationStep,
|
|
30
|
+
VerificationPlan,
|
|
31
|
+
GestureResult,
|
|
32
|
+
FaceTecResult
|
|
33
|
+
} from './verification-plan.interface';
|
|
34
|
+
export {
|
|
35
|
+
VerificationSessionStartRequest,
|
|
36
|
+
VerificationSessionStartResponse,
|
|
37
|
+
VerifyGesturesRequest,
|
|
38
|
+
VerifyGesturesResponse,
|
|
39
|
+
VerifyFaceTecRequest,
|
|
40
|
+
VerifyFaceTecResponse,
|
|
41
|
+
VerifyFinalizeResponse
|
|
42
|
+
} from './verification-session.interface';
|
|
43
|
+
|
|
44
|
+
// AWS Face Liveness
|
|
45
|
+
export {
|
|
46
|
+
AwsFaceLivenessSessionResponse,
|
|
47
|
+
AwsFaceLivenessResultsResponse,
|
|
48
|
+
AwsCredentialsResponse
|
|
49
|
+
} from './aws-face-liveness.interface';
|
|
50
|
+
|
|
51
|
+
// Scan results (FaceTec, AWS Face Liveness component results)
|
|
52
|
+
export { FaceTecScanResult, AwsFaceLivenessScanResult } from './scan-results.interface';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LivenessAction } from '../types/liveness-action.type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Result of a liveness action challenge
|
|
5
|
+
*/
|
|
6
|
+
export interface LivenessActionResult {
|
|
7
|
+
action: LivenessAction;
|
|
8
|
+
completed: boolean;
|
|
9
|
+
/** Progress value from 0-1 */
|
|
10
|
+
progress: number;
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
|
package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-config.interface.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LivenessBackend } from '../types/liveness-backend.type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Legacy liveness configuration interface
|
|
5
|
+
*/
|
|
6
|
+
export interface LivenessConfig {
|
|
7
|
+
exampleImageUrl?: string;
|
|
8
|
+
exampleImageBase64?: string;
|
|
9
|
+
backends: LivenessBackend[];
|
|
10
|
+
similarityThreshold?: number;
|
|
11
|
+
maxRetries?: number;
|
|
12
|
+
videoMaxSizeMB?: number;
|
|
13
|
+
enableVideoRecording?: boolean;
|
|
14
|
+
enableAutoCapture?: boolean;
|
|
15
|
+
captureFrameCount?: number;
|
|
16
|
+
}
|
|
17
|
+
|
package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-metadata.interface.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LivenessBackend } from '../types/liveness-backend.type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Metadata for a liveness verification result
|
|
5
|
+
*/
|
|
6
|
+
export interface LivenessMetadata {
|
|
7
|
+
timestamp: string;
|
|
8
|
+
backend: LivenessBackend;
|
|
9
|
+
confidence: number;
|
|
10
|
+
attemptNumber: number;
|
|
11
|
+
videoSizeMB?: number;
|
|
12
|
+
capturedFrames?: number;
|
|
13
|
+
sessionId?: string;
|
|
14
|
+
gestureResult?: unknown;
|
|
15
|
+
facetecResult?: unknown;
|
|
16
|
+
}
|
|
17
|
+
|
package/projects/facecog-liveness-verification/src/lib/interfaces/liveness-result.interface.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LivenessMetadata } from './liveness-metadata.interface';
|
|
2
|
+
import { MultiBackendAnalyzeResponse } from './multi-backend-analyze-response.interface';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Result of a liveness verification
|
|
6
|
+
*/
|
|
7
|
+
export interface LivenessResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
confidence: number;
|
|
10
|
+
/** Base64 JPEG/PNG of verified image */
|
|
11
|
+
verifiedImage: string;
|
|
12
|
+
/** MP4 video blob (local) */
|
|
13
|
+
videoBlob?: Blob;
|
|
14
|
+
/** S3 URL (after upload) */
|
|
15
|
+
videoUrl?: string;
|
|
16
|
+
multiBackendResults?: MultiBackendAnalyzeResponse;
|
|
17
|
+
metadata: LivenessMetadata;
|
|
18
|
+
error?: string;
|
|
19
|
+
/** ISO timestamp of when the user clicked "Start video check" in AWS Face Liveness */
|
|
20
|
+
startVideoCheckClickedAt?: string;
|
|
21
|
+
/** ISO timestamp of when video recording began */
|
|
22
|
+
recordingStartedAt?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { LivenessBackend } from '../types/liveness-backend.type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the Liveness Verification library
|
|
5
|
+
*/
|
|
6
|
+
export interface LivenessVerificationConfig {
|
|
7
|
+
/** API URL for verification backend. Default: 'http://localhost:3002' */
|
|
8
|
+
apiUrl?: string;
|
|
9
|
+
/** Backends to use for verification. Default: ['mock'] */
|
|
10
|
+
backends?: LivenessBackend[];
|
|
11
|
+
/** ID of predefined pose to verify (1-40). If not set, user selects from pose grid */
|
|
12
|
+
poseId?: number;
|
|
13
|
+
/** Custom pose for verification (alternative to poseId) */
|
|
14
|
+
customPose?: {
|
|
15
|
+
imageData: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
/** Maximum retry attempts. Default: 3 */
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
/** Enable auto-capture when pose is matched. Default: true */
|
|
21
|
+
autoCapture?: boolean;
|
|
22
|
+
/** Enable video recording during verification. Default: true */
|
|
23
|
+
enableVideoRecording?: boolean;
|
|
24
|
+
/** Similarity threshold for pose matching (0-1). Default: 0.62 */
|
|
25
|
+
similarityThreshold?: number;
|
|
26
|
+
/** Maximum video size in MB. Default: 10 */
|
|
27
|
+
videoMaxSizeMB?: number;
|
|
28
|
+
/** Number of frames to capture. Default: 5 */
|
|
29
|
+
captureFrameCount?: number;
|
|
30
|
+
/** Show intro screen with pose selection. Default: true */
|
|
31
|
+
showIntroScreen?: boolean;
|
|
32
|
+
/** Show pose selector grid. Default: true */
|
|
33
|
+
showPoseSelector?: boolean;
|
|
34
|
+
/** Enable AWS Face Liveness (oval challenge) after pose capture. Default: false */
|
|
35
|
+
useAwsFaceLiveness?: boolean;
|
|
36
|
+
/** Example image URL for reference pose */
|
|
37
|
+
exampleImageUrl?: string;
|
|
38
|
+
/** Example image as base64 for reference pose */
|
|
39
|
+
exampleImageBase64?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AnalyzeResponse } from './analyze-response.interface';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Response from multi-backend analysis
|
|
5
|
+
*/
|
|
6
|
+
export interface MultiBackendAnalyzeResponse {
|
|
7
|
+
amazon: AnalyzeResponse;
|
|
8
|
+
openpose: AnalyzeResponse;
|
|
9
|
+
facetec: AnalyzeResponse;
|
|
10
|
+
primary: AnalyzeResponse;
|
|
11
|
+
consensus: {
|
|
12
|
+
isLive: boolean;
|
|
13
|
+
confidence: number;
|
|
14
|
+
votingResults: {
|
|
15
|
+
liveVotes: number;
|
|
16
|
+
notLiveVotes: number;
|
|
17
|
+
agreement: 'unanimous' | 'majority' | 'split';
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LivenessResult } from './liveness-result.interface';
|
|
2
|
+
import { MultiBackendAnalyzeResponse } from './multi-backend-analyze-response.interface';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Extended liveness result with multi-backend analysis
|
|
6
|
+
*/
|
|
7
|
+
export interface MultiBackendLivenessResult extends Omit<LivenessResult, 'metadata'> {
|
|
8
|
+
multiBackendResults: MultiBackendAnalyzeResponse;
|
|
9
|
+
metadata: {
|
|
10
|
+
timestamp: string;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
package/projects/facecog-liveness-verification/src/lib/interfaces/pose-definition.interface.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PoseCategory } from '../types/pose-category.type';
|
|
2
|
+
import { PoseDifficulty } from '../types/pose-difficulty.type';
|
|
3
|
+
import { DetectionStrategy } from '../types/detection-strategy.type';
|
|
4
|
+
import { PoseKeypoint } from './pose-keypoint.interface';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Definition of a pose for verification
|
|
8
|
+
*/
|
|
9
|
+
export interface PoseDefinition {
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
category: PoseCategory;
|
|
14
|
+
imagePath: string;
|
|
15
|
+
detectionStrategy: DetectionStrategy;
|
|
16
|
+
difficulty: PoseDifficulty;
|
|
17
|
+
/**
|
|
18
|
+
* Static reference keypoints for automatic detection (normalized 0-1)
|
|
19
|
+
* For MoveNet model: 17 keypoints
|
|
20
|
+
* 0: nose, 1: left_eye, 2: right_eye, 3: left_ear, 4: right_ear,
|
|
21
|
+
* 5: left_shoulder, 6: right_shoulder, 7: left_elbow, 8: right_elbow,
|
|
22
|
+
* 9: left_wrist, 10: right_wrist, 11: left_hip, 12: right_hip,
|
|
23
|
+
* 13: left_knee, 14: right_knee, 15: left_ankle, 16: right_ankle
|
|
24
|
+
*/
|
|
25
|
+
poseKeypoints?: PoseKeypoint[];
|
|
26
|
+
/**
|
|
27
|
+
* Indicates if this is a custom user-uploaded pose
|
|
28
|
+
*/
|
|
29
|
+
isCustom?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Blob URL for custom pose images (used for dynamically uploaded poses)
|
|
32
|
+
*/
|
|
33
|
+
imageBlobUrl?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FaceTec Scan Result
|
|
3
|
+
*/
|
|
4
|
+
export interface FaceTecScanResult {
|
|
5
|
+
success: boolean;
|
|
6
|
+
faceScan: string; // Base64 encoded FaceScan data
|
|
7
|
+
auditTrailImage?: string;
|
|
8
|
+
lowQualityAuditTrailImage?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* AWS Face Liveness Scan Result
|
|
14
|
+
*/
|
|
15
|
+
export interface AwsFaceLivenessScanResult {
|
|
16
|
+
success: boolean;
|
|
17
|
+
isLive: boolean;
|
|
18
|
+
confidence: number;
|
|
19
|
+
confidencePercent: number;
|
|
20
|
+
sessionId: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
metadata?: unknown;
|
|
23
|
+
/** Video recording blob captured during the liveness check */
|
|
24
|
+
videoBlob?: Blob;
|
|
25
|
+
/** ISO timestamp of when the user clicked "Start video check" */
|
|
26
|
+
startVideoCheckClickedAt?: string;
|
|
27
|
+
/** ISO timestamp of when video recording began */
|
|
28
|
+
recordingStartedAt?: string;
|
|
29
|
+
}
|
package/projects/facecog-liveness-verification/src/lib/interfaces/verification-plan.interface.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VerificationStepKind } from '../types/verification-step-kind.type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Single step in the verification plan
|
|
5
|
+
*/
|
|
6
|
+
export interface VerificationStep {
|
|
7
|
+
kind: VerificationStepKind;
|
|
8
|
+
pose?: string; // Required if kind is 'gesture' (e.g., 'hello', 'thumbsUp')
|
|
9
|
+
completed?: boolean;
|
|
10
|
+
result?: unknown;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Verification plan: array of steps to execute sequentially
|
|
15
|
+
* Example: [{ kind: 'gesture', pose: 'hello' }, { kind: 'facetec' }, { kind: 'gesture', pose: 'thumbsUp' }]
|
|
16
|
+
*/
|
|
17
|
+
export type VerificationPlan = VerificationStep[];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Result of a single gesture verification step
|
|
21
|
+
*/
|
|
22
|
+
export interface GestureResult {
|
|
23
|
+
stepIndex: number;
|
|
24
|
+
pose: string;
|
|
25
|
+
backend: string; // Which backend was used (amazon, openpose)
|
|
26
|
+
isLive: boolean;
|
|
27
|
+
confidence: number;
|
|
28
|
+
timestamp: Date;
|
|
29
|
+
metadata?: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Result of a FaceTec verification step
|
|
34
|
+
*/
|
|
35
|
+
export interface FaceTecResult {
|
|
36
|
+
stepIndex: number;
|
|
37
|
+
isLive: boolean;
|
|
38
|
+
confidence: number;
|
|
39
|
+
faceScanId?: string; // FaceTec's scan ID
|
|
40
|
+
timestamp: Date;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VerificationFlowStep } from '../types/verification-flow-step.type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Progress event during verification
|
|
5
|
+
*/
|
|
6
|
+
export interface VerificationProgressEvent {
|
|
7
|
+
step: VerificationFlowStep;
|
|
8
|
+
/** Progress value from 0-100 */
|
|
9
|
+
progress: number;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
|
package/projects/facecog-liveness-verification/src/lib/interfaces/verification-session.interface.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { VerificationStep, GestureResult, FaceTecResult } from './verification-plan.interface';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Request to start a new sequential verification session
|
|
5
|
+
*/
|
|
6
|
+
export interface VerificationSessionStartRequest {
|
|
7
|
+
plan: VerificationStep[];
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Response when starting a verification session
|
|
13
|
+
*/
|
|
14
|
+
export interface VerificationSessionStartResponse {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
plan: VerificationStep[];
|
|
17
|
+
expiresAt: Date;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Request to verify gesture step(s)
|
|
22
|
+
*/
|
|
23
|
+
export interface VerifyGesturesRequest {
|
|
24
|
+
sessionId: string;
|
|
25
|
+
stepIndex: number;
|
|
26
|
+
frames: string[]; // Array of base64-encoded frames
|
|
27
|
+
pose: string;
|
|
28
|
+
frameHash?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Response from gesture verification
|
|
33
|
+
*/
|
|
34
|
+
export interface VerifyGesturesResponse {
|
|
35
|
+
sessionId: string;
|
|
36
|
+
stepIndex: number;
|
|
37
|
+
result: GestureResult;
|
|
38
|
+
frameHash: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Request to verify FaceTec step
|
|
43
|
+
*/
|
|
44
|
+
export interface VerifyFaceTecRequest {
|
|
45
|
+
sessionId: string;
|
|
46
|
+
stepIndex: number;
|
|
47
|
+
faceScanBlob: string;
|
|
48
|
+
frameHash: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Response from FaceTec verification
|
|
53
|
+
*/
|
|
54
|
+
export interface VerifyFaceTecResponse {
|
|
55
|
+
sessionId: string;
|
|
56
|
+
stepIndex: number;
|
|
57
|
+
result: FaceTecResult;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Response from finalizing verification
|
|
62
|
+
*/
|
|
63
|
+
export interface VerifyFinalizeResponse {
|
|
64
|
+
sessionId: string;
|
|
65
|
+
success: boolean;
|
|
66
|
+
allPassed: boolean;
|
|
67
|
+
confidence: number;
|
|
68
|
+
gestureResults: GestureResult[];
|
|
69
|
+
facetecResult?: FaceTecResult;
|
|
70
|
+
failedSteps: number[];
|
|
71
|
+
completedAt: Date;
|
|
72
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VerificationFlowStep } from '../types/verification-flow-step.type';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Event emitted when flow step changes
|
|
5
|
+
*/
|
|
6
|
+
export interface VerificationStepChangeEvent {
|
|
7
|
+
step: VerificationFlowStep;
|
|
8
|
+
previousStep?: VerificationFlowStep;
|
|
9
|
+
timestamp: Date;
|
|
10
|
+
}
|
|
11
|
+
|