@azure/ai-vision-face-ui 1.4.0

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/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@azure/ai-vision-face-ui",
3
+ "description": "Azure AI Vision Face UI Web SDK",
4
+ "main": "FaceLivenessDetector.js",
5
+ "types": "types/index.d.ts",
6
+ "homepage": "https://github.com/Azure-Samples/azure-ai-vision-sdk",
7
+ "dependencies": {
8
+ "@azure-ai-vision-face/ui-assets": "1.4.0"
9
+ },
10
+ "version": "1.4.0"
11
+ }
@@ -0,0 +1,194 @@
1
+ /**
2
+ * Final results from face analysis.
3
+ */
4
+ export interface LivenessDetectionSuccess {
5
+ /**
6
+ * Result ID.
7
+ */
8
+ readonly resultId: string;
9
+ /**
10
+ * We highly recommend leveraging the "digest" generated within the solution to validate the integrity of the communication between your application and the Azure AI Vision Face service. This is necessary to ensure that the final liveness detection result is trustworthy.
11
+ * The "digest" will be contained within the liveness detection result when calling the detectLiveness-sessions/<session-id> REST call. Look for an example of the "digest" in the [tutorial](https://aka.ms/azure-ai-vision-face-liveness-tutorial) where the liveness detection result is shown.
12
+ * Digests must match between the application and the service.
13
+ */
14
+ readonly digest: string;
15
+ }
16
+
17
+ /**
18
+ * Reason of liveness detection failure.
19
+ * @readonly
20
+ */
21
+ export enum LivenessError {
22
+ /** Liveness has not failed. */
23
+ None = "None",
24
+ /** The operation took longer than the time limit. */
25
+ TimedOut = "TimedOut",
26
+ /** Invalid token. */
27
+ InvalidToken = "InvalidToken",
28
+ /** Camera permission issue. */
29
+ CameraPermissionDenied = "CameraPermissionDenied",
30
+ /** Other camera issues. */
31
+ CameraStartupFailure = "CameraStartupFailure",
32
+ /** No face detected. */
33
+ NoFaceDetected = "NoFaceDetected",
34
+ /** Tracking failure */
35
+ FaceTrackingFailed = "FaceTrackingFailed",
36
+ /** User did not smile during Active check. */
37
+ SmileNotPerformed = "SmileNotPerformed",
38
+ /** User did not perform the required head movements. */
39
+ HeadTurnNotPerformed = "HeadTurnNotPerformed",
40
+ /** API request timed out. */
41
+ ServerRequestTimedOut = "ServerRequestTimedOut",
42
+ /** Mouth region of the face was not visible. */
43
+ FaceMouthRegionNotVisible = "FaceMouthRegionNotVisible",
44
+ /** Eye region of the face was not visible. */
45
+ FaceEyeRegionNotVisible = "FaceEyeRegionNotVisible",
46
+ /** Image was too blurry. */
47
+ ExcessiveImageBlurDetected = "ExcessiveImageBlurDetected",
48
+ /** Face was too brightly and unevenly illuminated. */
49
+ ExcessiveFaceBrightness = "ExcessiveFaceBrightness",
50
+ /** A mask was blocking the view of the face. */
51
+ FaceWithMaskDetected = "FaceWithMaskDetected",
52
+ /** Lighting condition during operation is not supported by current liveness detection mode. */
53
+ EnvironmentNotSupported = "EnvironmentNotSupported",
54
+ /** User canceled session */
55
+ UserCanceledSession = "UserCanceledSession",
56
+ /** User canceled active motion */
57
+ UserCanceledActiveMotion = "UserCanceledActiveMotion",
58
+ /** User canceled active motion prompt */
59
+ UserCanceledActiveMotionPrompt = "UserCanceledActiveMotionPrompt",
60
+ /** Unexpected client error. */
61
+ UnexpectedClientError = "UnexpectedClientError",
62
+ /** Unexpected server error. */
63
+ UnexpectedServerError = "UnexpectedServerError",
64
+ /** Client version not supported error. */
65
+ ClientVersionNotSupported = "ClientVersionNotSupported",
66
+ /** Verification image not provided error. */
67
+ VerifyImageNotProvided = "VerifyImageNotProvided",
68
+ /** Unexpected generic error. */
69
+ Unexpected = "Unexpected"
70
+ }
71
+
72
+ /**
73
+ * Reason for recognition failure.
74
+ * @readonly
75
+ */
76
+ export enum RecognitionError {
77
+ /** Recognition has not failed. */
78
+ None = "None",
79
+ /** Failure did not fall into any of the other categories. */
80
+ GenericFailure = "GenericFailure",
81
+ /** Face was looking away. */
82
+ FaceNotFrontal = "FaceNotFrontal",
83
+ /** Eye region of the face was not visible. */
84
+ FaceEyeRegionNotVisible = "FaceEyeRegionNotVisible",
85
+ /** Face was too brightly and unevenly illuminated. */
86
+ ExcessiveFaceBrightness = "ExcessiveFaceBrightness",
87
+ /** Image was too blurry. */
88
+ ExcessiveImageBlurDetected = "ExcessiveImageBlurDetected",
89
+ /** Face was not found in verify image */
90
+ FaceNotFound = "FaceNotFound",
91
+ /** Multiple face found in verify image */
92
+ MultipleFaceFound = "MultipleFaceFound",
93
+ /** Verify image has content decoding error */
94
+ ContentDecodingError = "ContentDecodingError",
95
+ /** Image size was too large */
96
+ ImageSizeIsTooLarge = "ImageSizeIsTooLarge",
97
+ /** Image size was too small */
98
+ ImageSizeIsTooSmall = "ImageSizeIsTooSmall",
99
+ /** Image had unsupported media type */
100
+ UnsupportedMediaType = "UnsupportedMediaType",
101
+ /** Mouth region of the face was not visible. */
102
+ FaceMouthRegionNotVisible = "FaceMouthRegionNotVisible",
103
+ /** Face with mask was detected. */
104
+ FaceWithMaskDetected = "FaceWithMaskDetected",
105
+ }
106
+
107
+ /**
108
+ * Failure results from face analysis.
109
+ */
110
+ export interface LivenessDetectionError {
111
+ /**
112
+ * Reason for liveness detection failure.
113
+ */
114
+ readonly livenessError: LivenessError;
115
+
116
+ /**
117
+ * Reason for recognition failure.
118
+ */
119
+ readonly recognitionError: RecognitionError;
120
+ }
121
+
122
+ /**
123
+ * FaceLivenessDetector web component module.
124
+ * @module FaceLivenessDetector
125
+ * @exports FaceLivenessDetector
126
+ * @extends HTMLElement
127
+ */
128
+ export class FaceLivenessDetector extends HTMLElement {
129
+
130
+ /**
131
+ * Start the session for liveness.
132
+ * @param {string} sessionAuthorizationToken - The token value.
133
+ */
134
+ start(sessionAuthorizationToken: string): Promise<LivenessDetectionSuccess>;
135
+
136
+ /**
137
+ * Set the locale to use for the session by using IETF BCP 47.
138
+ * The default locale en.
139
+ * Supported locales are en, pt, fa.
140
+ * For other languages use the language property to set the dictionary.
141
+ */
142
+ locale : string;
143
+
144
+ /**
145
+ * Set the language property to set a new language dictionary.
146
+ */
147
+ languageDictionary : string;
148
+
149
+ /**
150
+ * Set the mediaInfoDeviceId to override the default camera used for face analysis.
151
+ *
152
+ */
153
+ mediaInfoDeviceId : string;
154
+
155
+ /**
156
+ * Customize the default "Increase your screen brightness" image by providing your own image.
157
+ */
158
+ brightnessImagePath : string;
159
+
160
+ /**
161
+ * Customize the default font size for all the text.
162
+ */
163
+ fontSize : string;
164
+
165
+ /**
166
+ * Customize the default font family for all the text.
167
+ */
168
+ fontFamily : string;
169
+
170
+ /**
171
+ * Customize the default CSS styles for buttons.
172
+ */
173
+ buttonStyles : string;
174
+
175
+ /**
176
+ * Customize the default CSS styles for feedback messages.
177
+ */
178
+ feedbackMessageStyles : string;
179
+
180
+ /**
181
+ * Customize the session to skip the instructions for active motion part of the session.
182
+ */
183
+ skipInstructions : boolean;
184
+
185
+ /**
186
+ * DeivceCorrelationId is used to set the device correlation for the session.
187
+ */
188
+ deviceCorrelationId : string;
189
+
190
+ /**
191
+ * UserCorrelationId is used to set the user correlation for the session.
192
+ */
193
+ userCorrelationId : string;
194
+ }
@@ -0,0 +1 @@
1
+ export * from './FaceLivenessDetector';