@aws-amplify/ui-react-liveness 3.0.14 → 3.0.16

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.
Files changed (34) hide show
  1. package/dist/esm/components/FaceLivenessDetector/FaceLivenessDetectorCore.mjs +2 -6
  2. package/dist/esm/components/FaceLivenessDetector/LivenessCheck/LivenessCameraModule.mjs +2 -6
  3. package/dist/esm/components/FaceLivenessDetector/LivenessCheck/LivenessCheck.mjs +2 -6
  4. package/dist/esm/components/FaceLivenessDetector/service/machine/{index.mjs → machine.mjs} +24 -29
  5. package/dist/esm/components/FaceLivenessDetector/service/types/liveness.mjs +0 -1
  6. package/dist/esm/components/FaceLivenessDetector/service/utils/constants.mjs +10 -2
  7. package/dist/esm/components/FaceLivenessDetector/service/utils/{CustomWebSocketFetchHandler.mjs → createStreamingClient/CustomWebSocketFetchHandler.mjs} +1 -1
  8. package/dist/esm/components/FaceLivenessDetector/service/utils/createStreamingClient/Signer.mjs +18 -0
  9. package/dist/esm/components/FaceLivenessDetector/service/utils/createStreamingClient/createStreamingClient.mjs +27 -0
  10. package/dist/esm/components/FaceLivenessDetector/service/utils/createStreamingClient/resolveCredentials.mjs +38 -0
  11. package/dist/esm/components/FaceLivenessDetector/service/utils/getFaceMatchStateInLivenessOval.mjs +59 -0
  12. package/dist/esm/components/FaceLivenessDetector/service/utils/liveness.mjs +22 -74
  13. package/dist/esm/components/FaceLivenessDetector/service/utils/streamProvider.mjs +8 -30
  14. package/dist/esm/components/FaceLivenessDetector/shared/DefaultStartScreenComponents.mjs +2 -6
  15. package/dist/esm/components/FaceLivenessDetector/shared/FaceLivenessErrorModal.mjs +2 -6
  16. package/dist/esm/components/FaceLivenessDetector/shared/Hint.mjs +6 -13
  17. package/dist/esm/version.mjs +1 -1
  18. package/dist/index.js +186 -135
  19. package/dist/types/components/FaceLivenessDetector/service/machine/index.d.ts +1 -5
  20. package/dist/types/components/FaceLivenessDetector/service/machine/machine.d.ts +5 -0
  21. package/dist/types/components/FaceLivenessDetector/service/types/credentials.d.ts +9 -10
  22. package/dist/types/components/FaceLivenessDetector/service/types/liveness.d.ts +0 -1
  23. package/dist/types/components/FaceLivenessDetector/service/types/machine.d.ts +0 -1
  24. package/dist/types/components/FaceLivenessDetector/service/utils/constants.d.ts +6 -0
  25. package/dist/types/components/FaceLivenessDetector/service/utils/createStreamingClient/Signer.d.ts +6 -0
  26. package/dist/types/components/FaceLivenessDetector/service/utils/createStreamingClient/createStreamingClient.d.ts +9 -0
  27. package/dist/types/components/FaceLivenessDetector/service/utils/createStreamingClient/index.d.ts +1 -0
  28. package/dist/types/components/FaceLivenessDetector/service/utils/createStreamingClient/resolveCredentials.d.ts +10 -0
  29. package/dist/types/components/FaceLivenessDetector/service/utils/getFaceMatchStateInLivenessOval.d.ts +17 -0
  30. package/dist/types/components/FaceLivenessDetector/service/utils/index.d.ts +1 -0
  31. package/dist/types/components/FaceLivenessDetector/service/utils/liveness.d.ts +1 -8
  32. package/dist/types/version.d.ts +1 -1
  33. package/package.json +3 -2
  34. /package/dist/types/components/FaceLivenessDetector/service/utils/{CustomWebSocketFetchHandler.d.ts → createStreamingClient/CustomWebSocketFetchHandler.d.ts} +0 -0
@@ -0,0 +1,10 @@
1
+ import { AwsCredentialProvider, AwsCredentials } from '../../types';
2
+ /**
3
+ * Resolves the `credentials` param to be passed to `RekognitionStreamingClient` which accepts either:
4
+ * - a `credentials` object
5
+ * - a `credentialsProvider` callback
6
+ *
7
+ * @param credentialsProvider optional `credentialsProvider` callback
8
+ * @returns {Promise<AwsCredentials | AwsCredentialProvider>} `credentials` object or valid `credentialsProvider` callback
9
+ */
10
+ export declare function resolveCredentials(credentialsProvider?: AwsCredentialProvider): Promise<AwsCredentials | AwsCredentialProvider>;
@@ -0,0 +1,17 @@
1
+ import { LivenessOvalDetails, Face, FaceMatchState } from '../types';
2
+ import { SessionInformation } from '@aws-sdk/client-rekognitionstreaming';
3
+ interface MatchStateInOvalParams {
4
+ face: Face;
5
+ ovalDetails: LivenessOvalDetails;
6
+ initialFaceIntersection: number;
7
+ sessionInformation: SessionInformation;
8
+ frameHeight: number;
9
+ }
10
+ /**
11
+ * Returns the state of the provided face with respect to the provided liveness oval.
12
+ */
13
+ export declare function getFaceMatchStateInLivenessOval({ face, ovalDetails, initialFaceIntersection, sessionInformation, frameHeight, }: MatchStateInOvalParams): {
14
+ faceMatchState: FaceMatchState;
15
+ faceMatchPercentage: number;
16
+ };
17
+ export {};
@@ -2,5 +2,6 @@ export * from './blazefaceFaceDetection';
2
2
  export * from './videoRecorder';
3
3
  export * from './support';
4
4
  export * from './liveness';
5
+ export * from './getFaceMatchStateInLivenessOval';
5
6
  export * from './streamProvider';
6
7
  export * from './freshnessColorDisplay';
@@ -50,14 +50,7 @@ export declare function drawStaticOval(canvasEl: HTMLCanvasElement, videoEl: HTM
50
50
  export declare function clearOvalCanvas({ canvas, }: {
51
51
  canvas: HTMLCanvasElement;
52
52
  }): void;
53
- export declare function generateBboxFromLandmarks(face: Face, oval: LivenessOvalDetails): BoundingBox;
54
- /**
55
- * Returns the state of the provided face with respect to the provided liveness oval.
56
- */
57
- export declare function getFaceMatchStateInLivenessOval(face: Face, ovalDetails: LivenessOvalDetails, initialFaceIntersection: number, sessionInformation: SessionInformation): {
58
- faceMatchState: FaceMatchState;
59
- faceMatchPercentage: number;
60
- };
53
+ export declare function generateBboxFromLandmarks(face: Face, oval: LivenessOvalDetails, frameHeight: number): BoundingBox;
61
54
  /**
62
55
  * Returns the illumination state in the provided video frame.
63
56
  */
@@ -1 +1 @@
1
- export declare const VERSION = "3.0.14";
1
+ export declare const VERSION = "3.0.16";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react-liveness",
3
- "version": "3.0.14",
3
+ "version": "3.0.16",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -54,6 +54,7 @@
54
54
  "@smithy/eventstream-serde-browser": "^2.0.4",
55
55
  "@smithy/fetch-http-handler": "^2.1.3",
56
56
  "@smithy/protocol-http": "^3.0.3",
57
+ "@smithy/signature-v4": "2.1.4",
57
58
  "@mediapipe/face_detection": "~0.4.0",
58
59
  "@tensorflow-models/face-detection": "1.0.2",
59
60
  "@tensorflow/tfjs-backend-cpu": "4.11.0",
@@ -80,7 +81,7 @@
80
81
  "name": "FaceLivenessDetector",
81
82
  "path": "dist/esm/index.mjs",
82
83
  "import": "{ FaceLivenessDetector }",
83
- "limit": "275 kB"
84
+ "limit": "280 kB"
84
85
  }
85
86
  ]
86
87
  }