biometry-sdk 2.3.7 → 2.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/README.md +1 -2
- package/dist/sdk/index.d.ts +43 -21
- package/dist/sdk.js +55 -27
- package/dist/sdk.js.map +1 -1
- package/dist/types/biometry/process-video.d.ts +16 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -692,7 +692,6 @@ If you require additional implementation guidance, please refer to the official
|
|
|
692
692
|
This project is licensed under the MIT License.
|
|
693
693
|
The full license text is available in the source repository.
|
|
694
694
|
|
|
695
|
-
##
|
|
695
|
+
## API Documentation
|
|
696
696
|
|
|
697
697
|
- [Biometry API Documentation](https://developer.biometrysolutions.com/overview/)
|
|
698
|
-
- Contact our support team at [support@biometrysolutions.com](mailto:support@biometrysolutions.com)
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -13,10 +13,28 @@ export declare class BiometrySDK {
|
|
|
13
13
|
/**
|
|
14
14
|
* Starts a new Session for a user.
|
|
15
15
|
*
|
|
16
|
+
* @param {Object} [props] - Optional properties.
|
|
17
|
+
* @param {boolean} [props.warmup] - If true, triggers ML services warmup in the background.
|
|
16
18
|
* @returns {Promise<ApiResponse<SessionResponse>>} A promise resolving to the session ID.
|
|
17
19
|
* @throws {Error} - If the request fails.
|
|
18
20
|
*/
|
|
19
|
-
startSession(
|
|
21
|
+
startSession(props?: {
|
|
22
|
+
warmup?: boolean;
|
|
23
|
+
}): Promise<ApiResponse<SessionResponse>>;
|
|
24
|
+
/**
|
|
25
|
+
* Ends an existing session.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} sessionId - The ID of the session to end.
|
|
28
|
+
* @param {Object} [props] - Optional properties.
|
|
29
|
+
* @param {string} [props.phoneNumber] - Phone number for SIM-swap fraud check via CAMARA API.
|
|
30
|
+
* @returns {Promise<ApiResponse<{ message: string }>>} A promise resolving to the result message.
|
|
31
|
+
* @throws {Error} - If the request fails.
|
|
32
|
+
*/
|
|
33
|
+
endSession(sessionId: string, props?: {
|
|
34
|
+
phoneNumber?: string;
|
|
35
|
+
}): Promise<ApiResponse<{
|
|
36
|
+
message: string;
|
|
37
|
+
}>>;
|
|
20
38
|
/**
|
|
21
39
|
* Submits Authorization consent for a user.
|
|
22
40
|
* Authorization Consent is required to use the services like Face and Voice recognition.
|
|
@@ -53,10 +71,10 @@ export declare class BiometrySDK {
|
|
|
53
71
|
}): Promise<ApiResponse<ConsentResponse>>;
|
|
54
72
|
/**
|
|
55
73
|
* Enrolls a user's voice for biometric authentication.
|
|
74
|
+
* The user identity is derived from the userFullName parameter (sent as X-User-Fullname header).
|
|
56
75
|
*
|
|
57
76
|
* @param {File} audio - The audio file containing the user's voice.
|
|
58
77
|
* @param {string} userFullName - The full name of the user being enrolled.
|
|
59
|
-
* @param {string} uniqueId - A unique identifier for the enrolling process.
|
|
60
78
|
* @param {string} phrase - The phrase spoken in the audio file.
|
|
61
79
|
* @param {Object} [props] - Optional properties for the enrollment request.
|
|
62
80
|
* @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.
|
|
@@ -65,7 +83,7 @@ export declare class BiometrySDK {
|
|
|
65
83
|
* @returns {Promise<ApiResponse<VoiceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.
|
|
66
84
|
* @throws {Error} - If required parameters are missing or the request fails.
|
|
67
85
|
*/
|
|
68
|
-
enrollVoice(audio: File, userFullName: string,
|
|
86
|
+
enrollVoice(audio: File, userFullName: string, phrase: string, props?: {
|
|
69
87
|
sessionId?: string;
|
|
70
88
|
deviceInfo?: object;
|
|
71
89
|
}): Promise<ApiResponse<VoiceEnrollmentResponse>>;
|
|
@@ -87,34 +105,35 @@ export declare class BiometrySDK {
|
|
|
87
105
|
deviceInfo?: object;
|
|
88
106
|
}): Promise<ApiResponse<FaceEnrollmentResponse>>;
|
|
89
107
|
/**
|
|
90
|
-
* Check the validity of a
|
|
108
|
+
* Check the validity of a document.
|
|
91
109
|
*
|
|
92
|
-
* @param {File} document - Document image file.
|
|
110
|
+
* @param {File} document - Document image file (jpg/jpeg/png).
|
|
93
111
|
* @param {string} userFullName - The full name of the user being checked.
|
|
94
|
-
* @param {Object} [props] - Optional properties for the
|
|
95
|
-
* @param {string} [props.sessionId] - Session ID to link this
|
|
112
|
+
* @param {Object} [props] - Optional properties for the request.
|
|
113
|
+
* @param {string} [props.sessionId] - Session ID to link this check with a specific session group.
|
|
96
114
|
* @param {object} [props.deviceInfo] - Device information object containing details about the user's device.
|
|
97
|
-
*
|
|
115
|
+
* @param {boolean} [props.inHouseCheck] - If false, uses external IDScan flow. Defaults to true (in-house GPT+ML flow).
|
|
116
|
+
* @param {boolean} [props.mrzValidation] - If true, enables MRZ validation in the in-house flow.
|
|
98
117
|
* @returns {Promise<ApiResponse<DocAuthResponse>>} - A promise resolving to the document authentication response.
|
|
99
118
|
*/
|
|
100
119
|
checkDocAuth(document: File, userFullName: string, props?: {
|
|
101
120
|
sessionId?: string;
|
|
102
121
|
deviceInfo?: object;
|
|
103
122
|
inHouseCheck?: boolean;
|
|
123
|
+
mrzValidation?: boolean;
|
|
104
124
|
}): Promise<ApiResponse<DocAuthResponse>>;
|
|
105
125
|
/**
|
|
106
126
|
* Matches a user's face from video against a reference image.
|
|
107
127
|
*
|
|
108
128
|
* @param {File} image - Reference image file that contains user's face.
|
|
109
|
-
* @param {
|
|
110
|
-
* @param {string} userFullName -
|
|
111
|
-
* @param {
|
|
112
|
-
*
|
|
113
|
-
* @param {Object} [props] - Optional properties for the
|
|
114
|
-
* @param {string} [props.sessionId] - Session ID
|
|
129
|
+
* @param {File} [video] - Video file that contains user's face. Required unless usePrefilledVideo is true.
|
|
130
|
+
* @param {string} [userFullName] - Full name of the end-user (used for session validation).
|
|
131
|
+
* @param {boolean} [usePrefilledVideo] - If true, reuses the video captured in the process-video step of the
|
|
132
|
+
* same session. Requires props.sessionId.
|
|
133
|
+
* @param {Object} [props] - Optional properties for the request.
|
|
134
|
+
* @param {string} [props.sessionId] - Session ID. Required when usePrefilledVideo is true.
|
|
115
135
|
* @param {object} [props.deviceInfo] - Device information object containing details about the user's device.
|
|
116
|
-
*
|
|
117
|
-
* @returns {Promise<FaceMatchResponse>} - A promise resolving to the voice enrolling response.
|
|
136
|
+
* @returns {Promise<ApiResponse<FaceMatchResponse>>} - A promise resolving to the face match response.
|
|
118
137
|
* @throws {Error} - If required parameters are missing or the request fails.
|
|
119
138
|
*/
|
|
120
139
|
matchFaces(image: File, video?: File, userFullName?: string, usePrefilledVideo?: boolean, props?: {
|
|
@@ -122,19 +141,22 @@ export declare class BiometrySDK {
|
|
|
122
141
|
deviceInfo?: object;
|
|
123
142
|
}): Promise<ApiResponse<FaceMatchResponse>>;
|
|
124
143
|
/**
|
|
125
|
-
* Process the video through Biometry services to check liveness and authorize user
|
|
144
|
+
* Process the video through Biometry services to check liveness and authorize user.
|
|
126
145
|
*
|
|
127
146
|
* @param {File} video - Video file that you want to process.
|
|
128
147
|
* @param {string} phrase - Set of numbers that user needs to say out loud in the video.
|
|
129
|
-
* @param {string} userFullName -
|
|
130
|
-
* @param {Object} [props] - Optional properties for the
|
|
131
|
-
* @param {string} [props.sessionId] - Session ID to link this
|
|
148
|
+
* @param {string} [userFullName] - Full name of the end-user. Required for Voice and Face recognition services.
|
|
149
|
+
* @param {Object} [props] - Optional properties for the request.
|
|
150
|
+
* @param {string} [props.sessionId] - Session ID to link this request with a specific session group.
|
|
132
151
|
* @param {object} [props.deviceInfo] - Device information object containing details about the user's device.
|
|
133
|
-
*
|
|
152
|
+
* @param {string} [props.vocabulary] - Vocabulary hint for speech recognition (e.g. 'en_digits'). Defaults to en_digits on the server.
|
|
153
|
+
* @param {string} [props.trigger] - Action trigger that initiated this request (e.g. 'authentication', 'registration', 'confirmation').
|
|
134
154
|
* @returns {Promise<ApiResponse<ProcessVideoResponse>>} - A promise resolving to the process video response.
|
|
135
155
|
*/
|
|
136
156
|
processVideo(video: File, phrase: string, userFullName?: string, props?: {
|
|
137
157
|
sessionId?: string;
|
|
138
158
|
deviceInfo?: object;
|
|
159
|
+
vocabulary?: string;
|
|
160
|
+
trigger?: string;
|
|
139
161
|
}): Promise<ApiResponse<ProcessVideoResponse>>;
|
|
140
162
|
}
|
package/dist/sdk.js
CHANGED
|
@@ -38,11 +38,32 @@ class BiometrySDK {
|
|
|
38
38
|
/**
|
|
39
39
|
* Starts a new Session for a user.
|
|
40
40
|
*
|
|
41
|
+
* @param {Object} [props] - Optional properties.
|
|
42
|
+
* @param {boolean} [props.warmup] - If true, triggers ML services warmup in the background.
|
|
41
43
|
* @returns {Promise<ApiResponse<SessionResponse>>} A promise resolving to the session ID.
|
|
42
44
|
* @throws {Error} - If the request fails.
|
|
43
45
|
*/
|
|
44
|
-
async startSession() {
|
|
45
|
-
|
|
46
|
+
async startSession(props) {
|
|
47
|
+
const query = props?.warmup ? '?warmup=true' : '';
|
|
48
|
+
return await this.request(`/api-gateway/sessions/start${query}`, 'POST');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Ends an existing session.
|
|
52
|
+
*
|
|
53
|
+
* @param {string} sessionId - The ID of the session to end.
|
|
54
|
+
* @param {Object} [props] - Optional properties.
|
|
55
|
+
* @param {string} [props.phoneNumber] - Phone number for SIM-swap fraud check via CAMARA API.
|
|
56
|
+
* @returns {Promise<ApiResponse<{ message: string }>>} A promise resolving to the result message.
|
|
57
|
+
* @throws {Error} - If the request fails.
|
|
58
|
+
*/
|
|
59
|
+
async endSession(sessionId, props) {
|
|
60
|
+
if (!sessionId)
|
|
61
|
+
throw new Error('Session ID is required.');
|
|
62
|
+
const body = {};
|
|
63
|
+
if (props?.phoneNumber) {
|
|
64
|
+
body['phone_number'] = props.phoneNumber;
|
|
65
|
+
}
|
|
66
|
+
return await this.request(`/api-gateway/sessions/end/${sessionId}`, 'POST', body);
|
|
46
67
|
}
|
|
47
68
|
/**
|
|
48
69
|
* Submits Authorization consent for a user.
|
|
@@ -106,10 +127,10 @@ class BiometrySDK {
|
|
|
106
127
|
}
|
|
107
128
|
/**
|
|
108
129
|
* Enrolls a user's voice for biometric authentication.
|
|
130
|
+
* The user identity is derived from the userFullName parameter (sent as X-User-Fullname header).
|
|
109
131
|
*
|
|
110
132
|
* @param {File} audio - The audio file containing the user's voice.
|
|
111
133
|
* @param {string} userFullName - The full name of the user being enrolled.
|
|
112
|
-
* @param {string} uniqueId - A unique identifier for the enrolling process.
|
|
113
134
|
* @param {string} phrase - The phrase spoken in the audio file.
|
|
114
135
|
* @param {Object} [props] - Optional properties for the enrollment request.
|
|
115
136
|
* @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.
|
|
@@ -118,17 +139,14 @@ class BiometrySDK {
|
|
|
118
139
|
* @returns {Promise<ApiResponse<VoiceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.
|
|
119
140
|
* @throws {Error} - If required parameters are missing or the request fails.
|
|
120
141
|
*/
|
|
121
|
-
async enrollVoice(audio, userFullName,
|
|
142
|
+
async enrollVoice(audio, userFullName, phrase, props) {
|
|
122
143
|
if (!userFullName)
|
|
123
144
|
throw new Error('User fullname is required.');
|
|
124
|
-
if (!uniqueId)
|
|
125
|
-
throw new Error('Unique ID is required.');
|
|
126
145
|
if (!phrase)
|
|
127
146
|
throw new Error('Phrase is required.');
|
|
128
147
|
if (!audio)
|
|
129
148
|
throw new Error('Audio file is required.');
|
|
130
149
|
const formData = new FormData();
|
|
131
|
-
formData.append('unique_id', uniqueId);
|
|
132
150
|
formData.append('phrase', phrase);
|
|
133
151
|
formData.append('voice', audio);
|
|
134
152
|
const headers = {
|
|
@@ -177,14 +195,15 @@ class BiometrySDK {
|
|
|
177
195
|
return await this.request('/api-gateway/enroll/face', 'POST', formData, headers);
|
|
178
196
|
}
|
|
179
197
|
/**
|
|
180
|
-
* Check the validity of a
|
|
198
|
+
* Check the validity of a document.
|
|
181
199
|
*
|
|
182
|
-
* @param {File} document - Document image file.
|
|
200
|
+
* @param {File} document - Document image file (jpg/jpeg/png).
|
|
183
201
|
* @param {string} userFullName - The full name of the user being checked.
|
|
184
|
-
* @param {Object} [props] - Optional properties for the
|
|
185
|
-
* @param {string} [props.sessionId] - Session ID to link this
|
|
202
|
+
* @param {Object} [props] - Optional properties for the request.
|
|
203
|
+
* @param {string} [props.sessionId] - Session ID to link this check with a specific session group.
|
|
186
204
|
* @param {object} [props.deviceInfo] - Device information object containing details about the user's device.
|
|
187
|
-
*
|
|
205
|
+
* @param {boolean} [props.inHouseCheck] - If false, uses external IDScan flow. Defaults to true (in-house GPT+ML flow).
|
|
206
|
+
* @param {boolean} [props.mrzValidation] - If true, enables MRZ validation in the in-house flow.
|
|
188
207
|
* @returns {Promise<ApiResponse<DocAuthResponse>>} - A promise resolving to the document authentication response.
|
|
189
208
|
*/
|
|
190
209
|
async checkDocAuth(document, userFullName, props) {
|
|
@@ -203,8 +222,11 @@ class BiometrySDK {
|
|
|
203
222
|
if (props?.deviceInfo) {
|
|
204
223
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
205
224
|
}
|
|
206
|
-
if (props?.inHouseCheck) {
|
|
207
|
-
headers['X-Inhouse-Docauth'] = "
|
|
225
|
+
if (props?.inHouseCheck === false) {
|
|
226
|
+
headers['X-Inhouse-Docauth'] = "false";
|
|
227
|
+
}
|
|
228
|
+
if (props?.mrzValidation) {
|
|
229
|
+
headers['X-Inhouse-MRZ'] = "true";
|
|
208
230
|
}
|
|
209
231
|
return await this.request('/api-gateway/docauth/check', 'POST', formData, headers);
|
|
210
232
|
}
|
|
@@ -212,15 +234,14 @@ class BiometrySDK {
|
|
|
212
234
|
* Matches a user's face from video against a reference image.
|
|
213
235
|
*
|
|
214
236
|
* @param {File} image - Reference image file that contains user's face.
|
|
215
|
-
* @param {
|
|
216
|
-
* @param {string} userFullName -
|
|
217
|
-
* @param {
|
|
218
|
-
*
|
|
219
|
-
* @param {Object} [props] - Optional properties for the
|
|
220
|
-
* @param {string} [props.sessionId] - Session ID
|
|
237
|
+
* @param {File} [video] - Video file that contains user's face. Required unless usePrefilledVideo is true.
|
|
238
|
+
* @param {string} [userFullName] - Full name of the end-user (used for session validation).
|
|
239
|
+
* @param {boolean} [usePrefilledVideo] - If true, reuses the video captured in the process-video step of the
|
|
240
|
+
* same session. Requires props.sessionId.
|
|
241
|
+
* @param {Object} [props] - Optional properties for the request.
|
|
242
|
+
* @param {string} [props.sessionId] - Session ID. Required when usePrefilledVideo is true.
|
|
221
243
|
* @param {object} [props.deviceInfo] - Device information object containing details about the user's device.
|
|
222
|
-
*
|
|
223
|
-
* @returns {Promise<FaceMatchResponse>} - A promise resolving to the voice enrolling response.
|
|
244
|
+
* @returns {Promise<ApiResponse<FaceMatchResponse>>} - A promise resolving to the face match response.
|
|
224
245
|
* @throws {Error} - If required parameters are missing or the request fails.
|
|
225
246
|
*/
|
|
226
247
|
async matchFaces(image, video, userFullName, usePrefilledVideo, props) {
|
|
@@ -251,15 +272,16 @@ class BiometrySDK {
|
|
|
251
272
|
return await this.request('/api-gateway/match-faces', 'POST', formData, headers);
|
|
252
273
|
}
|
|
253
274
|
/**
|
|
254
|
-
* Process the video through Biometry services to check liveness and authorize user
|
|
275
|
+
* Process the video through Biometry services to check liveness and authorize user.
|
|
255
276
|
*
|
|
256
277
|
* @param {File} video - Video file that you want to process.
|
|
257
278
|
* @param {string} phrase - Set of numbers that user needs to say out loud in the video.
|
|
258
|
-
* @param {string} userFullName -
|
|
259
|
-
* @param {Object} [props] - Optional properties for the
|
|
260
|
-
* @param {string} [props.sessionId] - Session ID to link this
|
|
279
|
+
* @param {string} [userFullName] - Full name of the end-user. Required for Voice and Face recognition services.
|
|
280
|
+
* @param {Object} [props] - Optional properties for the request.
|
|
281
|
+
* @param {string} [props.sessionId] - Session ID to link this request with a specific session group.
|
|
261
282
|
* @param {object} [props.deviceInfo] - Device information object containing details about the user's device.
|
|
262
|
-
*
|
|
283
|
+
* @param {string} [props.vocabulary] - Vocabulary hint for speech recognition (e.g. 'en_digits'). Defaults to en_digits on the server.
|
|
284
|
+
* @param {string} [props.trigger] - Action trigger that initiated this request (e.g. 'authentication', 'registration', 'confirmation').
|
|
263
285
|
* @returns {Promise<ApiResponse<ProcessVideoResponse>>} - A promise resolving to the process video response.
|
|
264
286
|
*/
|
|
265
287
|
async processVideo(video, phrase, userFullName, props) {
|
|
@@ -270,6 +292,12 @@ class BiometrySDK {
|
|
|
270
292
|
const formData = new FormData();
|
|
271
293
|
formData.append('phrase', phrase);
|
|
272
294
|
formData.append('video', video);
|
|
295
|
+
if (props?.vocabulary) {
|
|
296
|
+
formData.append('vocabulary', props.vocabulary);
|
|
297
|
+
}
|
|
298
|
+
if (props?.trigger) {
|
|
299
|
+
formData.append('trigger', props.trigger);
|
|
300
|
+
}
|
|
273
301
|
const headers = {};
|
|
274
302
|
if (userFullName) {
|
|
275
303
|
headers['X-User-Fullname'] = userFullName;
|
package/dist/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../src/sdk/index.ts"],"sourcesContent":["import { ApiResponse } from \"../types/internal\";\nimport { DocAuthResponse } from \"../types/biometry/doc-auth\";\nimport { ConsentResponse } from \"../types/biometry/consent\";\nimport { FaceEnrollmentResponse, VoiceEnrollmentResponse } from \"../types/biometry/enrollment\";\nimport { FaceMatchResponse } from \"../types/biometry/face-match\";\nimport { ProcessVideoResponse } from \"../types/biometry/process-video\";\nimport { SessionResponse } from \"../types/biometry/session\";\n\nexport class BiometrySDK {\n private apiKey: string;\n private static readonly BASE_URL: string = 'https://api.biometrysolutions.com'; //'https://dev-console.biometrysolutions.com';\n\n constructor(apiKey: string) {\n if (!apiKey) {\n throw new Error('API Key is required to initialize the SDK.');\n }\n\n this.apiKey = apiKey;\n }\n\n private async request<T>(path: string, method: string, body?: any, headers?: Record<string, string>):\n Promise<ApiResponse<T>> {\n const defaultHeaders: HeadersInit = {\n Authorization: `Bearer ${this.apiKey}`,\n };\n\n const requestHeaders = { ...defaultHeaders, ...headers };\n\n if (body && !(body instanceof FormData)) {\n requestHeaders['Content-Type'] = 'application/json';\n body = JSON.stringify(body);\n }\n const response = await fetch(`${BiometrySDK.BASE_URL}${path}`, {\n method,\n headers: requestHeaders,\n body,\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n const errorMessage = errorData?.error || errorData?.message || 'Unknown error occurred';\n\n throw new Error(`Error ${response.status}: ${errorMessage}`);\n }\n\n // 🔹 Extract ALL response headers\n const responseHeaders: Record<string, string> = {};\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n\n const responseBody = await response.json();\n\n return {\n body: responseBody as T,\n headers: responseHeaders\n };\n }\n\n /**\n * Starts a new Session for a user.\n * \n * @returns {Promise<ApiResponse<SessionResponse>>} A promise resolving to the session ID.\n * @throws {Error} - If the request fails.\n */\n async startSession(): Promise<ApiResponse<SessionResponse>> {\n return await this.request<SessionResponse>(\n '/api-gateway/sessions/start',\n 'POST'\n );\n }\n\n /**\n * Submits Authorization consent for a user.\n * Authorization Consent is required to use the services like Face and Voice recognition.\n * \n * @param {boolean} isConsentGiven - Indicates whether the user has given consent.\n * @param {string} userFullName - The full name of the user giving consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveAuthorizationConsent(\n isConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give consent.');\n }\n\n const body = {\n is_consent_given: isConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Submits Storage consent for a user.\n * Storage consent is granted by users, allowing us to store their biometric data for future verification.\n * \n * @param {boolean} isStorageConsentGiven - Indicates whether the user has given storage consent.\n * @param {string} userFullName - The full name of the user giving storage consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveStorageConsent(\n isStorageConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give storage consent.');\n }\n\n const body = {\n is_consent_given: isStorageConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/strg-consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Enrolls a user's voice for biometric authentication.\n * \n * @param {File} audio - The audio file containing the user's voice.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} uniqueId - A unique identifier for the enrolling process.\n * @param {string} phrase - The phrase spoken in the audio file.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<VoiceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollVoice(\n audio: File,\n userFullName: string,\n uniqueId: string,\n phrase: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<VoiceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!uniqueId) throw new Error('Unique ID is required.');\n if (!phrase) throw new Error('Phrase is required.');\n if (!audio) throw new Error('Audio file is required.');\n\n const formData = new FormData();\n formData.append('unique_id', uniqueId);\n formData.append('phrase', phrase);\n formData.append('voice', audio);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<VoiceEnrollmentResponse>(\n '/api-gateway/enroll/voice',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Enrolls a user's face for biometric authentication.\n * \n * @param {File} face - Image file that contains user's face.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} isDocument - Indicates whether the image is a document.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<FaceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollFace(face: File, userFullName: string, isDocument?: boolean, props?: {\n sessionId?: string,\n deviceInfo?: object,\n }):\n Promise<ApiResponse<FaceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!face) throw new Error('Face image is required.');\n\n const formData = new FormData();\n formData.append('face', face);\n if (isDocument) {\n formData.append('is_document', 'true');\n }\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceEnrollmentResponse>(\n '/api-gateway/enroll/face',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Check the validity of a documents.\n * \n * @param {File} document - Document image file.\n * @param {string} userFullName - The full name of the user being checked.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<DocAuthResponse>>} - A promise resolving to the document authentication response.\n */\n async checkDocAuth(\n document: File,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n inHouseCheck?: boolean,\n }\n ): Promise<ApiResponse<DocAuthResponse>> {\n if (!document) throw new Error('Document image is required.');\n if (!userFullName) throw new Error('User fullname is required.');\n\n const formData = new FormData();\n formData.append('document', document);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n if (props?.inHouseCheck) {\n headers['X-Inhouse-Docauth'] = \"true\";\n }\n\n return await this.request<DocAuthResponse>(\n '/api-gateway/docauth/check',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Matches a user's face from video against a reference image.\n * \n * @param {File} image - Reference image file that contains user's face.\n * @param {string} video - Video file that contains user's face.\n * @param {string} userFullName - Pass the full name of end-user to process Voice and Face recognition services.\n * @param {string} processVideoRequestId - ID from the response header of /process-video endpoint.\n * @param {boolean} usePrefilledVideo - Pass true to use the video from the process-video endpoint.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<FaceMatchResponse>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async matchFaces(\n image: File,\n video?: File,\n userFullName?: string,\n usePrefilledVideo?: boolean,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<FaceMatchResponse>> {\n if (!image) throw new Error('Face image is required.');\n if ((!usePrefilledVideo) && !video) throw new Error('Video is required.');\n if (usePrefilledVideo && !props?.sessionId) throw new Error('Session ID is required to use a video from the process-video endpoint.');\n\n const formData = new FormData();\n if (video) {\n formData.append('video', video);\n }\n formData.append('image', image);\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (usePrefilledVideo) {\n headers['X-Use-Prefilled-Video'] = 'true';\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceMatchResponse>(\n '/api-gateway/match-faces',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Process the video through Biometry services to check liveness and authorize user\n * \n * @param {File} video - Video file that you want to process.\n * @param {string} phrase - Set of numbers that user needs to say out loud in the video.\n * @param {string} userFullName - Pass the full name of end-user to process Voice and Face recognition services.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ProcessVideoResponse>>} - A promise resolving to the process video response.\n */\n async processVideo(\n video: File,\n phrase: string,\n userFullName?: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ProcessVideoResponse>> {\n if (!video) throw new Error('Video is required.');\n if (!phrase) throw new Error('Phrase is required.');\n\n const formData = new FormData();\n formData.append('phrase', phrase);\n formData.append('video', video);\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ProcessVideoResponse>(\n '/api-gateway/process-video',\n 'POST',\n formData,\n headers\n );\n }\n}"],"names":[],"mappings":"MAQa,WAAW,CAAA;AAItB,IAAA,WAAA,CAAY,MAAc,EAAA;QACxB,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC;QAC/D;AAEA,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;IACtB;IAEQ,MAAM,OAAO,CAAI,IAAY,EAAE,MAAc,EAAE,IAAU,EAAE,OAAgC,EAAA;AAEjG,QAAA,MAAM,cAAc,GAAgB;AAClC,YAAA,aAAa,EAAE,CAAA,OAAA,EAAU,IAAI,CAAC,MAAM,CAAA,CAAE;SACvC;QAED,MAAM,cAAc,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE;QAExD,IAAI,IAAI,IAAI,EAAE,IAAI,YAAY,QAAQ,CAAC,EAAE;AACvC,YAAA,cAAc,CAAC,cAAc,CAAC,GAAG,kBAAkB;AACnD,YAAA,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAC7B;AACA,QAAA,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,CAAA,EAAG,WAAW,CAAC,QAAQ,CAAA,EAAG,IAAI,CAAA,CAAE,EAAE;YAC7D,MAAM;AACN,YAAA,OAAO,EAAE,cAAc;YACvB,IAAI;AACL,SAAA,CAAC;AAEF,QAAA,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;AAChB,YAAA,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,MAAM,YAAY,GAAG,SAAS,EAAE,KA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,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC;AAEnD,QAAA,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE;AAC/B,QAAA,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;AACjC,QAAA,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;QAE/B,MAAM,OAAO,GAA2B,EAAE;QAE1C,IAAI,YAAY,EAAE;AAChB,YAAA,OAAO,CAAC,iBAAiB,CAAC,GAAG,YAAY;QAC3C;AAEA,QAAA,IAAI,KAAK,EAAE,SAAS,EAAE;AACpB,YAAA,OAAO,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,SAAS;QAC3C;AAEA,QAAA,IAAI,KAAK,EAAE,UAAU,EAAE;AACrB,YAAA,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;QAC7D;AAEA,QAAA,OAAO,MAAM,IAAI,CAAC,OAAO,CACvB,4BAA4B,EAC5B,MAAM,EACN,QAAQ,EACR,OAAO,CACR;IACH;;AAlawB,WAAA,CAAA,QAAQ,GAAW,mCAAmC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../src/sdk/index.ts"],"sourcesContent":["import { ApiResponse } from \"../types/internal\";\nimport { DocAuthResponse } from \"../types/biometry/doc-auth\";\nimport { ConsentResponse } from \"../types/biometry/consent\";\nimport { FaceEnrollmentResponse, VoiceEnrollmentResponse } from \"../types/biometry/enrollment\";\nimport { FaceMatchResponse } from \"../types/biometry/face-match\";\nimport { ProcessVideoResponse } from \"../types/biometry/process-video\";\nimport { SessionResponse } from \"../types/biometry/session\";\n\nexport class BiometrySDK {\n private apiKey: string;\n private static readonly BASE_URL: string = 'https://api.biometrysolutions.com'; //'https://dev-console.biometrysolutions.com';\n\n constructor(apiKey: string) {\n if (!apiKey) {\n throw new Error('API Key is required to initialize the SDK.');\n }\n\n this.apiKey = apiKey;\n }\n\n private async request<T>(path: string, method: string, body?: any, headers?: Record<string, string>):\n Promise<ApiResponse<T>> {\n const defaultHeaders: HeadersInit = {\n Authorization: `Bearer ${this.apiKey}`,\n };\n\n const requestHeaders = { ...defaultHeaders, ...headers };\n\n if (body && !(body instanceof FormData)) {\n requestHeaders['Content-Type'] = 'application/json';\n body = JSON.stringify(body);\n }\n const response = await fetch(`${BiometrySDK.BASE_URL}${path}`, {\n method,\n headers: requestHeaders,\n body,\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n const errorMessage = errorData?.error || errorData?.message || 'Unknown error occurred';\n\n throw new Error(`Error ${response.status}: ${errorMessage}`);\n }\n\n // 🔹 Extract ALL response headers\n const responseHeaders: Record<string, string> = {};\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n\n const responseBody = await response.json();\n\n return {\n body: responseBody as T,\n headers: responseHeaders\n };\n }\n\n /**\n * Starts a new Session for a user.\n *\n * @param {Object} [props] - Optional properties.\n * @param {boolean} [props.warmup] - If true, triggers ML services warmup in the background.\n * @returns {Promise<ApiResponse<SessionResponse>>} A promise resolving to the session ID.\n * @throws {Error} - If the request fails.\n */\n async startSession(props?: { warmup?: boolean }): Promise<ApiResponse<SessionResponse>> {\n const query = props?.warmup ? '?warmup=true' : '';\n return await this.request<SessionResponse>(\n `/api-gateway/sessions/start${query}`,\n 'POST'\n );\n }\n\n /**\n * Ends an existing session.\n *\n * @param {string} sessionId - The ID of the session to end.\n * @param {Object} [props] - Optional properties.\n * @param {string} [props.phoneNumber] - Phone number for SIM-swap fraud check via CAMARA API.\n * @returns {Promise<ApiResponse<{ message: string }>>} A promise resolving to the result message.\n * @throws {Error} - If the request fails.\n */\n async endSession(sessionId: string, props?: { phoneNumber?: string }): Promise<ApiResponse<{ message: string }>> {\n if (!sessionId) throw new Error('Session ID is required.');\n\n const body: Record<string, string> = {};\n if (props?.phoneNumber) {\n body['phone_number'] = props.phoneNumber;\n }\n\n return await this.request<{ message: string }>(\n `/api-gateway/sessions/end/${sessionId}`,\n 'POST',\n body\n );\n }\n\n /**\n * Submits Authorization consent for a user.\n * Authorization Consent is required to use the services like Face and Voice recognition.\n * \n * @param {boolean} isConsentGiven - Indicates whether the user has given consent.\n * @param {string} userFullName - The full name of the user giving consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveAuthorizationConsent(\n isConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give consent.');\n }\n\n const body = {\n is_consent_given: isConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Submits Storage consent for a user.\n * Storage consent is granted by users, allowing us to store their biometric data for future verification.\n * \n * @param {boolean} isStorageConsentGiven - Indicates whether the user has given storage consent.\n * @param {string} userFullName - The full name of the user giving storage consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveStorageConsent(\n isStorageConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give storage consent.');\n }\n\n const body = {\n is_consent_given: isStorageConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/strg-consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Enrolls a user's voice for biometric authentication.\n * The user identity is derived from the userFullName parameter (sent as X-User-Fullname header).\n *\n * @param {File} audio - The audio file containing the user's voice.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} phrase - The phrase spoken in the audio file.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<VoiceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollVoice(\n audio: File,\n userFullName: string,\n phrase: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<VoiceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!phrase) throw new Error('Phrase is required.');\n if (!audio) throw new Error('Audio file is required.');\n\n const formData = new FormData();\n formData.append('phrase', phrase);\n formData.append('voice', audio);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<VoiceEnrollmentResponse>(\n '/api-gateway/enroll/voice',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Enrolls a user's face for biometric authentication.\n * \n * @param {File} face - Image file that contains user's face.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} isDocument - Indicates whether the image is a document.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<FaceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollFace(face: File, userFullName: string, isDocument?: boolean, props?: {\n sessionId?: string,\n deviceInfo?: object,\n }):\n Promise<ApiResponse<FaceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!face) throw new Error('Face image is required.');\n\n const formData = new FormData();\n formData.append('face', face);\n if (isDocument) {\n formData.append('is_document', 'true');\n }\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceEnrollmentResponse>(\n '/api-gateway/enroll/face',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Check the validity of a document.\n *\n * @param {File} document - Document image file (jpg/jpeg/png).\n * @param {string} userFullName - The full name of the user being checked.\n * @param {Object} [props] - Optional properties for the request.\n * @param {string} [props.sessionId] - Session ID to link this check with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * @param {boolean} [props.inHouseCheck] - If false, uses external IDScan flow. Defaults to true (in-house GPT+ML flow).\n * @param {boolean} [props.mrzValidation] - If true, enables MRZ validation in the in-house flow.\n * @returns {Promise<ApiResponse<DocAuthResponse>>} - A promise resolving to the document authentication response.\n */\n async checkDocAuth(\n document: File,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n inHouseCheck?: boolean,\n mrzValidation?: boolean,\n }\n ): Promise<ApiResponse<DocAuthResponse>> {\n if (!document) throw new Error('Document image is required.');\n if (!userFullName) throw new Error('User fullname is required.');\n\n const formData = new FormData();\n formData.append('document', document);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n if (props?.inHouseCheck === false) {\n headers['X-Inhouse-Docauth'] = \"false\";\n }\n\n if (props?.mrzValidation) {\n headers['X-Inhouse-MRZ'] = \"true\";\n }\n\n return await this.request<DocAuthResponse>(\n '/api-gateway/docauth/check',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Matches a user's face from video against a reference image.\n *\n * @param {File} image - Reference image file that contains user's face.\n * @param {File} [video] - Video file that contains user's face. Required unless usePrefilledVideo is true.\n * @param {string} [userFullName] - Full name of the end-user (used for session validation).\n * @param {boolean} [usePrefilledVideo] - If true, reuses the video captured in the process-video step of the\n * same session. Requires props.sessionId.\n * @param {Object} [props] - Optional properties for the request.\n * @param {string} [props.sessionId] - Session ID. Required when usePrefilledVideo is true.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * @returns {Promise<ApiResponse<FaceMatchResponse>>} - A promise resolving to the face match response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async matchFaces(\n image: File,\n video?: File,\n userFullName?: string,\n usePrefilledVideo?: boolean,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<FaceMatchResponse>> {\n if (!image) throw new Error('Face image is required.');\n if ((!usePrefilledVideo) && !video) throw new Error('Video is required.');\n if (usePrefilledVideo && !props?.sessionId) throw new Error('Session ID is required to use a video from the process-video endpoint.');\n\n const formData = new FormData();\n if (video) {\n formData.append('video', video);\n }\n formData.append('image', image);\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (usePrefilledVideo) {\n headers['X-Use-Prefilled-Video'] = 'true';\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceMatchResponse>(\n '/api-gateway/match-faces',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Process the video through Biometry services to check liveness and authorize user.\n *\n * @param {File} video - Video file that you want to process.\n * @param {string} phrase - Set of numbers that user needs to say out loud in the video.\n * @param {string} [userFullName] - Full name of the end-user. Required for Voice and Face recognition services.\n * @param {Object} [props] - Optional properties for the request.\n * @param {string} [props.sessionId] - Session ID to link this request with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * @param {string} [props.vocabulary] - Vocabulary hint for speech recognition (e.g. 'en_digits'). Defaults to en_digits on the server.\n * @param {string} [props.trigger] - Action trigger that initiated this request (e.g. 'authentication', 'registration', 'confirmation').\n * @returns {Promise<ApiResponse<ProcessVideoResponse>>} - A promise resolving to the process video response.\n */\n async processVideo(\n video: File,\n phrase: string,\n userFullName?: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n vocabulary?: string,\n trigger?: string,\n }\n ): Promise<ApiResponse<ProcessVideoResponse>> {\n if (!video) throw new Error('Video is required.');\n if (!phrase) throw new Error('Phrase is required.');\n\n const formData = new FormData();\n formData.append('phrase', phrase);\n formData.append('video', video);\n\n if (props?.vocabulary) {\n formData.append('vocabulary', props.vocabulary);\n }\n\n if (props?.trigger) {\n formData.append('trigger', props.trigger);\n }\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ProcessVideoResponse>(\n '/api-gateway/process-video',\n 'POST',\n formData,\n headers\n );\n }\n}"],"names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
@@ -1,32 +1,43 @@
|
|
|
1
1
|
export interface ProcessVideoResponse {
|
|
2
2
|
data: {
|
|
3
|
-
"Active Speaker Detection"
|
|
3
|
+
"Active Speaker Detection"?: {
|
|
4
4
|
code: number;
|
|
5
5
|
description: string;
|
|
6
6
|
result: number;
|
|
7
|
+
score: number;
|
|
8
|
+
error?: string;
|
|
7
9
|
};
|
|
8
|
-
"Face Liveness Detection"
|
|
10
|
+
"Face Liveness Detection"?: {
|
|
9
11
|
code: number;
|
|
10
12
|
description: string;
|
|
11
13
|
result: boolean;
|
|
14
|
+
score: number;
|
|
15
|
+
error?: string;
|
|
12
16
|
};
|
|
13
|
-
"Face Recognition"
|
|
17
|
+
"Face Recognition"?: {
|
|
14
18
|
code: number;
|
|
15
19
|
description: string;
|
|
20
|
+
score: number;
|
|
21
|
+
error?: string;
|
|
16
22
|
};
|
|
17
|
-
"Visual Speech Recognition"
|
|
23
|
+
"Visual Speech Recognition"?: {
|
|
18
24
|
code: number;
|
|
19
25
|
description: string;
|
|
20
26
|
result: string;
|
|
27
|
+
score: number;
|
|
28
|
+
error?: string;
|
|
21
29
|
};
|
|
22
|
-
"Voice Recognition"
|
|
30
|
+
"Voice Recognition"?: {
|
|
23
31
|
status: string;
|
|
24
32
|
id: string;
|
|
25
33
|
score: number;
|
|
26
34
|
imposter_prob: number;
|
|
27
35
|
log_odds: string;
|
|
36
|
+
error?: string;
|
|
28
37
|
};
|
|
29
38
|
};
|
|
30
39
|
scoring_result: "pass" | "fail" | "refer";
|
|
40
|
+
score?: number;
|
|
41
|
+
decision_reasons?: string[];
|
|
31
42
|
message: string;
|
|
32
43
|
}
|