Skip to content

Commit

Permalink
Merge branch 'main' into migrate-liveness-app
Browse files Browse the repository at this point in the history
  • Loading branch information
thaddmt committed Sep 20, 2023
2 parents 327dea6 + b3f4b6c commit 127019e
Show file tree
Hide file tree
Showing 48 changed files with 202 additions and 121 deletions.
24 changes: 0 additions & 24 deletions .changeset/breezy-rabbits-change.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/cold-news-jump.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/five-ghosts-hug.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/loud-dodos-confess.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/mean-vans-attend.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/modern-melons-doubt.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"test:links": "node --require esbuild-register ./scripts/link-checker-puppeteer.ts"
},
"dependencies": {
"@aws-amplify/ui-react": "5.3.0",
"@aws-amplify/ui-react-storage": "2.3.0",
"@aws-amplify/ui-react": "5.3.1",
"@aws-amplify/ui-react-storage": "2.3.1",
"@cucumber/gherkin": "^19.0.3",
"@cucumber/messages": "^16.0.1",
"@docsearch/react": "3",
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@angular/platform-browser": "^14.3.0",
"@angular/platform-browser-dynamic": "^14.3.0",
"@angular/router": "^14.3.0",
"@aws-amplify/ui-angular": "^4.0.8",
"@aws-amplify/ui-angular": "^4.0.9",
"aws-amplify": "latest",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
Expand Down
6 changes: 3 additions & 3 deletions examples/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"lint": "next lint"
},
"dependencies": {
"@aws-amplify/ui-react": "^5.3.0",
"@aws-amplify/ui-react-storage": "^2.3.0",
"@aws-amplify/ui-react-notifications": "^1.0.12",
"@aws-amplify/ui-react": "^5.3.1",
"@aws-amplify/ui-react-storage": "^2.3.1",
"@aws-amplify/ui-react-notifications": "^1.0.13",
"@aws-amplify/ui-react-geo": "^1.0.2",
"@aws-sdk/credential-providers": "^3.370.0",
"aws-amplify": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "vite preview --port 3000"
},
"dependencies": {
"@aws-amplify/ui-vue": "^3.1.27",
"@aws-amplify/ui-vue": "^3.1.28",
"aws-amplify": "latest",
"vue": "^3.0.5",
"vue-router": "4"
Expand Down
7 changes: 7 additions & 0 deletions packages/angular/projects/ui-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @aws-amplify/ui-angular

## 4.0.9

### Patch Changes

- Updated dependencies [[`d570694c7`](https://github.com/aws-amplify/amplify-ui/commit/d570694c7e0d9d112449d3aade2d567773555926), [`6a5a4d79c`](https://github.com/aws-amplify/amplify-ui/commit/6a5a4d79ce60124fba2dc00d86b9e1a9b5f21c39)]:
- @aws-amplify/ui@5.8.1

## 4.0.8

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/projects/ui-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/ui-angular",
"version": "4.0.8",
"version": "4.0.9",
"scripts": {
"build": "yarn --cwd ../../ build",
"dev": "yarn --cwd ../../ dev",
Expand All @@ -19,7 +19,7 @@
"aws-amplify": "^5.0.1"
},
"dependencies": {
"@aws-amplify/ui": "5.8.0",
"@aws-amplify/ui": "5.8.1",
"classnames": "2.3.1",
"nanoid": "3.1.31",
"qrcode": "1.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/projects/ui-angular/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '4.0.8';
export const VERSION = '4.0.9';
2 changes: 1 addition & 1 deletion packages/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
]
},
"devDependencies": {
"@aws-amplify/ui": "^5.8.0",
"@aws-amplify/ui": "^5.8.1",
"@badeball/cypress-cucumber-preprocessor": "^16.0.3",
"@bahmutov/cypress-esbuild-preprocessor": "~2.2.0",
"@cucumber/cucumber": "^9.3.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/react-core-notifications/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @aws-amplify/ui-react-core-notifications

## 1.0.10

### Patch Changes

- Updated dependencies [[`d570694c7`](https://github.com/aws-amplify/amplify-ui/commit/d570694c7e0d9d112449d3aade2d567773555926), [`6a5a4d79c`](https://github.com/aws-amplify/amplify-ui/commit/6a5a4d79ce60124fba2dc00d86b9e1a9b5f21c39)]:
- @aws-amplify/ui@5.8.1
- @aws-amplify/ui-react-core@2.1.33

## 1.0.9

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/react-core-notifications/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/ui-react-core-notifications",
"version": "1.0.9",
"version": "1.0.10",
"main": "dist/index.js",
"module": "dist/esm/index.mjs",
"exports": {
Expand Down Expand Up @@ -36,8 +36,8 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@aws-amplify/ui": "5.8.0",
"@aws-amplify/ui-react-core": "2.1.32"
"@aws-amplify/ui": "5.8.1",
"@aws-amplify/ui-react-core": "2.1.33"
},
"peerDependencies": {
"aws-amplify": "^5.0.1",
Expand Down
7 changes: 7 additions & 0 deletions packages/react-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @aws-amplify/ui-react-core

## 2.1.33

### Patch Changes

- Updated dependencies [[`d570694c7`](https://github.com/aws-amplify/amplify-ui/commit/d570694c7e0d9d112449d3aade2d567773555926), [`6a5a4d79c`](https://github.com/aws-amplify/amplify-ui/commit/6a5a4d79ce60124fba2dc00d86b9e1a9b5f21c39)]:
- @aws-amplify/ui@5.8.1

## 2.1.32

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/ui-react-core",
"version": "2.1.32",
"version": "2.1.33",
"main": "dist/index.js",
"module": "dist/esm/index.mjs",
"react-native": "dist/index.js",
Expand Down Expand Up @@ -31,7 +31,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@aws-amplify/ui": "5.8.0",
"@aws-amplify/ui": "5.8.1",
"@xstate/react": "3.0.1",
"lodash": "4.17.21",
"xstate": "^4.33.6"
Expand Down
14 changes: 14 additions & 0 deletions packages/react-liveness/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @aws-amplify/ui-react-liveness

## 2.0.8

### Patch Changes

- [#4441](https://github.com/aws-amplify/amplify-ui/pull/4441) [`717b00955`](https://github.com/aws-amplify/amplify-ui/commit/717b0095573eb0fc44ef47441eb27e1c3122f6f9) Thanks [@thaddmt](https://github.com/thaddmt)! - chore(liveness): remove predictions super class

- [#4446](https://github.com/aws-amplify/amplify-ui/pull/4446) [`ac3cfa8aa`](https://github.com/aws-amplify/amplify-ui/commit/ac3cfa8aaa430df2b73e51a6b6f0916f1f6f6382) Thanks [@thaddmt](https://github.com/thaddmt)! - fix(liveness): add missing liveness dependencies

- [#4450](https://github.com/aws-amplify/amplify-ui/pull/4450) [`8ca045036`](https://github.com/aws-amplify/amplify-ui/commit/8ca0450363a194016fe7d1e5c4fc8359e2f4dba2) Thanks [@thaddmt](https://github.com/thaddmt)! - chore(liveness): export error types

- Updated dependencies [[`d570694c7`](https://github.com/aws-amplify/amplify-ui/commit/d570694c7e0d9d112449d3aade2d567773555926), [`6a5a4d79c`](https://github.com/aws-amplify/amplify-ui/commit/6a5a4d79ce60124fba2dc00d86b9e1a9b5f21c39), [`c393b74af`](https://github.com/aws-amplify/amplify-ui/commit/c393b74af6574593b2e7a5c9f00d27b052966a12), [`7e11a3b7e`](https://github.com/aws-amplify/amplify-ui/commit/7e11a3b7e4761a39a973ecd9a632a619660e18dd)]:
- @aws-amplify/ui-react@5.3.1
- @aws-amplify/ui@5.8.1

## 2.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-liveness/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
coverageThreshold: {
global: {
branches: 80,
functions: 83,
functions: 82,
lines: 89,
statements: 89,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/react-liveness/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/ui-react-liveness",
"version": "2.0.7",
"version": "2.0.8",
"main": "dist/index.js",
"module": "dist/esm/index.mjs",
"exports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export {
AwsCredentialProvider,
AwsTemporaryCredentials,
AwsCredentials,
ErrorState,
} from './service';
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
IlluminationState,
StreamActorCallback,
LivenessError,
ErrorState,
} from '../types';
import {
BlazeFaceFaceDetection,
Expand Down Expand Up @@ -717,7 +718,7 @@ export const livenessMachine = createMachine<LivenessContext, LivenessEvent>(
// callbacks
callUserPermissionDeniedCallback: assign({
errorState: (context, event) => {
let errorState: LivenessErrorState;
let errorState: ErrorState;

if ((event.data!.message as string).includes('15 fps')) {
errorState = LivenessErrorState.CAMERA_FRAMERATE_ERROR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
* The liveness error states
*/

export enum LivenessErrorState {
TIMEOUT = 'TIMEOUT',
RUNTIME_ERROR = 'RUNTIME_ERROR',
FRESHNESS_TIMEOUT = 'FRESHNESS_TIMEOUT',
SERVER_ERROR = 'SERVER_ERROR',
CAMERA_FRAMERATE_ERROR = 'CAMERA_FRAMERATE_ERROR',
CAMERA_ACCESS_ERROR = 'CAMERA_ACCESS_ERROR',
FACE_DISTANCE_ERROR = 'FACE_DISTANCE_ERROR',
MOBILE_LANDSCAPE_ERROR = 'MOBILE_LANDSCAPE_ERROR',
MULTIPLE_FACES_ERROR = 'MULTIPLE_FACES_ERROR',
}
export const LivenessErrorState = {
TIMEOUT: 'TIMEOUT',
RUNTIME_ERROR: 'RUNTIME_ERROR',
FRESHNESS_TIMEOUT: 'FRESHNESS_TIMEOUT',
SERVER_ERROR: 'SERVER_ERROR',
CAMERA_FRAMERATE_ERROR: 'CAMERA_FRAMERATE_ERROR',
CAMERA_ACCESS_ERROR: 'CAMERA_ACCESS_ERROR',
FACE_DISTANCE_ERROR: 'FACE_DISTANCE_ERROR',
MOBILE_LANDSCAPE_ERROR: 'MOBILE_LANDSCAPE_ERROR',
MULTIPLE_FACES_ERROR: 'MULTIPLE_FACES_ERROR',
} as const;

export type ErrorState = keyof typeof LivenessErrorState;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AwsCredentialProvider } from './credentials';
import { LivenessErrorState } from './error';
import { ErrorState } from './error';

/**
* The props for the FaceLivenessDetectorCore which allows for full configuration of auth
Expand Down Expand Up @@ -124,6 +124,6 @@ export enum FaceMatchState {
}

export interface LivenessError {
state: LivenessErrorState;
state: ErrorState;
error: Error;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
LivenessOvalDetails,
IlluminationState,
} from './liveness';
import { LivenessErrorState } from './error';
import { ErrorState } from './error';
import {
VideoRecorder,
LivenessStreamProvider,
Expand Down Expand Up @@ -67,7 +67,7 @@ export interface HydratedLivenessContext {
ovalAssociatedParams: OvalAssociatedParams;
faceMatchAssociatedParams: FaceMatchAssociatedParams;
freshnessColorAssociatedParams: FreshnessColorAssociatedParams;
errorState: LivenessErrorState;
errorState: ErrorState;
livenessStreamProvider: LivenessStreamProvider;
responseStreamActorRef: ActorRef<any>;
shouldDisconnect: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
FaceMatchState,
BoundingBox,
LivenessErrorState,
ErrorState,
} from '../types';
import { FaceDetection } from '../types/faceDetection';
import { ClientFreshnessColorSequence } from '../types/service';
Expand Down Expand Up @@ -459,7 +460,7 @@ export function isCameraDeviceVirtual(device: MediaDeviceInfo): boolean {
return device.label.toLowerCase().includes('virtual');
}

export const LivenessErrorStateStringMap: Record<LivenessErrorState, string> = {
export const LivenessErrorStateStringMap = {
[LivenessErrorState.RUNTIME_ERROR]: 'RUNTIME_ERROR',
[LivenessErrorState.SERVER_ERROR]: 'SERVER_ERROR',
[LivenessErrorState.TIMEOUT]: 'TIMEOUT',
Expand Down Expand Up @@ -741,18 +742,13 @@ export async function isFaceDistanceBelowThreshold({
isMobile?: boolean;
}): Promise<{
isDistanceBelowThreshold: boolean;
error?:
| LivenessErrorState.FACE_DISTANCE_ERROR
| LivenessErrorState.MULTIPLE_FACES_ERROR;
error?: ErrorState;
}> {
const detectedFaces = await faceDetector.detectFaces(videoEl);
let detectedFace: Face;

let isDistanceBelowThreshold = false;
let error:
| LivenessErrorState.FACE_DISTANCE_ERROR
| LivenessErrorState.MULTIPLE_FACES_ERROR
| undefined;
let error: ErrorState | undefined;

switch (detectedFaces.length) {
case 0: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { Flex, Button, Text } from '@aws-amplify/ui-react';
import { AlertIcon } from '@aws-amplify/ui-react/internal';

import { LivenessErrorState } from '../service';
import { LivenessErrorState, ErrorState } from '../service';

import { Toast } from './Toast';
import { Overlay } from './Overlay';
Expand All @@ -21,7 +21,7 @@ export interface FaceLivenessErrorModalProps {
}

const renderToastErrorModal = (props: {
error: LivenessErrorState;
error: ErrorState;
displayText: Required<ErrorDisplayText>;
}) => {
const { error: errorState, displayText } = props;
Expand Down Expand Up @@ -80,7 +80,7 @@ export const renderErrorModal = ({
errorState,
overrideErrorDisplayText,
}: {
errorState: LivenessErrorState;
errorState: ErrorState;
overrideErrorDisplayText?: ErrorDisplayText;
}): JSX.Element | null => {
const displayText: Required<ErrorDisplayText> = {
Expand Down
Loading

0 comments on commit 127019e

Please sign in to comment.