biometry-sdk 2.3.3 → 2.3.5
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 +2 -2
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk.js +3 -0
- package/dist/sdk.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,7 +168,7 @@ DocAuth is a way to authenticate a user's document. It is useful when you want t
|
|
|
168
168
|
await sdk.giveAuthorizationConsent(true, userFullName, { sessionId });
|
|
169
169
|
|
|
170
170
|
try {
|
|
171
|
-
const response = await sdk.checkDocAuth(documentFile, userFullName, { sessionId });
|
|
171
|
+
const response = await sdk.checkDocAuth(documentFile, userFullName, { sessionId, inHouseCheck: true });
|
|
172
172
|
console.log('DocAuth Response:', response);
|
|
173
173
|
} catch (error) {
|
|
174
174
|
console.error('Error checking document:', error);
|
|
@@ -233,7 +233,7 @@ Always wrap calls in try/catch and provide user-friendly messages or fallback lo
|
|
|
233
233
|
|
|
234
234
|
### Header Retrieval
|
|
235
235
|
In addition to the response body, all SDK calls also return response headers.
|
|
236
|
-
This is useful for retrieving metadata such as request
|
|
236
|
+
This is useful for retrieving metadata such as request and session IDs, or debugging information.
|
|
237
237
|
|
|
238
238
|
Each API call returns an object of type:
|
|
239
239
|
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ export declare class BiometrySDK {
|
|
|
100
100
|
checkDocAuth(document: File, userFullName: string, props?: {
|
|
101
101
|
sessionId?: string;
|
|
102
102
|
deviceInfo?: object;
|
|
103
|
+
inHouseCheck?: boolean;
|
|
103
104
|
}): Promise<ApiResponse<DocAuthInfo>>;
|
|
104
105
|
/**
|
|
105
106
|
* Matches a user's face from video against a reference image.
|
package/dist/sdk.js
CHANGED
|
@@ -203,6 +203,9 @@ class BiometrySDK {
|
|
|
203
203
|
if (props?.deviceInfo) {
|
|
204
204
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
205
205
|
}
|
|
206
|
+
if (props?.inHouseCheck) {
|
|
207
|
+
headers['X-Inhouse-Docauth'] = "true";
|
|
208
|
+
}
|
|
206
209
|
return await this.request('/api-gateway/docauth/check', 'POST', formData, headers);
|
|
207
210
|
}
|
|
208
211
|
/**
|
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 { DocAuthInfo } 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<DocAuthInfo>>} - A promise resolving to the document authentication information.\n */\n async checkDocAuth(\n document: File,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<DocAuthInfo>> {\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 return await this.request<DocAuthInfo>(\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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AC,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;;AA7ZwB,WAAA,CAAA,QAAQ,GAAW,mCAAmC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../src/sdk/index.ts"],"sourcesContent":["import { ApiResponse } from \"../types/internal\";\nimport { DocAuthInfo } 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<DocAuthInfo>>} - A promise resolving to the document authentication information.\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<DocAuthInfo>> {\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<DocAuthInfo>(\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,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