@hexar/biometric-identity-sdk-react-native 1.1.0 → 1.1.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfilePictureCapture.d.ts","sourceRoot":"","sources":["../../src/components/ProfilePictureCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AASxE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAmC,cAAc,EAAsB,MAAM,oCAAoC,CAAC;AAGzJ,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,
|
|
1
|
+
{"version":3,"file":"ProfilePictureCapture.d.ts","sourceRoot":"","sources":["../../src/components/ProfilePictureCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AASxE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAmC,cAAc,EAAsB,MAAM,oCAAoC,CAAC;AAGzJ,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA4KtE,CAAC;AAuCF,eAAe,qBAAqB,CAAC"}
|
|
@@ -60,46 +60,28 @@ const ProfilePictureCapture = ({ onComplete, onError, onCancel, theme, language,
|
|
|
60
60
|
biometric_identity_sdk_core_1.logger.error('Session ID not available');
|
|
61
61
|
throw new Error('VALIDATION_ERROR');
|
|
62
62
|
}
|
|
63
|
-
const backendClient = sdk.backendClient;
|
|
64
|
-
const config = backendClient.config;
|
|
65
|
-
const requestBody = {
|
|
66
|
-
session_id: sessionId,
|
|
67
|
-
video_frames: videoResult.frames,
|
|
68
|
-
video_duration_ms: videoResult.duration,
|
|
69
|
-
challenges_completed: videoResult.challengesCompleted || [],
|
|
70
|
-
};
|
|
71
63
|
biometric_identity_sdk_core_1.logger.info('Validating profile picture with backend', {
|
|
72
64
|
sessionId,
|
|
73
65
|
framesCount: videoResult.frames.length,
|
|
74
66
|
duration: videoResult.duration,
|
|
75
|
-
endpoint: config.apiEndpoint,
|
|
76
67
|
});
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
'X-API-Key': config.apiKey,
|
|
83
|
-
},
|
|
84
|
-
body: JSON.stringify(requestBody),
|
|
68
|
+
const result = await sdk.validateProfilePicture({
|
|
69
|
+
sessionId,
|
|
70
|
+
videoFrames: videoResult.frames,
|
|
71
|
+
videoDurationMs: videoResult.duration,
|
|
72
|
+
challengesCompleted: videoResult.challengesCompleted || [],
|
|
85
73
|
});
|
|
86
|
-
if (!response.ok) {
|
|
87
|
-
const errorData = await response.json().catch(() => ({}));
|
|
88
|
-
biometric_identity_sdk_core_1.logger.error('Backend validation failed', { status: response.status, error: errorData });
|
|
89
|
-
throw new Error('VALIDATION_ERROR');
|
|
90
|
-
}
|
|
91
|
-
const data = await response.json();
|
|
92
74
|
biometric_identity_sdk_core_1.logger.info('Profile picture validation result', {
|
|
93
|
-
isValid:
|
|
94
|
-
livenessScore:
|
|
95
|
-
faceDetected:
|
|
75
|
+
isValid: result.isValid,
|
|
76
|
+
livenessScore: result.livenessScore,
|
|
77
|
+
faceDetected: result.faceDetected,
|
|
96
78
|
});
|
|
97
79
|
return {
|
|
98
|
-
isValid:
|
|
99
|
-
profilePicture:
|
|
100
|
-
livenessScore:
|
|
101
|
-
faceDetected:
|
|
102
|
-
warnings:
|
|
80
|
+
isValid: result.isValid,
|
|
81
|
+
profilePicture: result.profilePicture,
|
|
82
|
+
livenessScore: result.livenessScore,
|
|
83
|
+
faceDetected: result.faceDetected,
|
|
84
|
+
warnings: result.warnings || [],
|
|
103
85
|
};
|
|
104
86
|
}
|
|
105
87
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -59,54 +59,31 @@ export const ProfilePictureCapture: React.FC<ProfilePictureCaptureProps> = ({
|
|
|
59
59
|
throw new Error('VALIDATION_ERROR');
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const backendClient = (sdk as any).backendClient;
|
|
63
|
-
const config = backendClient.config;
|
|
64
|
-
|
|
65
|
-
const requestBody = {
|
|
66
|
-
session_id: sessionId,
|
|
67
|
-
video_frames: videoResult.frames,
|
|
68
|
-
video_duration_ms: videoResult.duration,
|
|
69
|
-
challenges_completed: videoResult.challengesCompleted || [],
|
|
70
|
-
};
|
|
71
|
-
|
|
72
62
|
logger.info('Validating profile picture with backend', {
|
|
73
63
|
sessionId,
|
|
74
64
|
framesCount: videoResult.frames.length,
|
|
75
65
|
duration: videoResult.duration,
|
|
76
|
-
endpoint: config.apiEndpoint,
|
|
77
66
|
});
|
|
78
67
|
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
'Content-Type': 'application/json',
|
|
85
|
-
'X-API-Key': config.apiKey,
|
|
86
|
-
},
|
|
87
|
-
body: JSON.stringify(requestBody),
|
|
68
|
+
const result = await (sdk as any).validateProfilePicture({
|
|
69
|
+
sessionId,
|
|
70
|
+
videoFrames: videoResult.frames,
|
|
71
|
+
videoDurationMs: videoResult.duration,
|
|
72
|
+
challengesCompleted: videoResult.challengesCompleted || [],
|
|
88
73
|
});
|
|
89
74
|
|
|
90
|
-
if (!response.ok) {
|
|
91
|
-
const errorData = await response.json().catch(() => ({}));
|
|
92
|
-
logger.error('Backend validation failed', { status: response.status, error: errorData });
|
|
93
|
-
throw new Error('VALIDATION_ERROR');
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const data = await response.json();
|
|
97
|
-
|
|
98
75
|
logger.info('Profile picture validation result', {
|
|
99
|
-
isValid:
|
|
100
|
-
livenessScore:
|
|
101
|
-
faceDetected:
|
|
76
|
+
isValid: result.isValid,
|
|
77
|
+
livenessScore: result.livenessScore,
|
|
78
|
+
faceDetected: result.faceDetected,
|
|
102
79
|
});
|
|
103
80
|
|
|
104
81
|
return {
|
|
105
|
-
isValid:
|
|
106
|
-
profilePicture:
|
|
107
|
-
livenessScore:
|
|
108
|
-
faceDetected:
|
|
109
|
-
warnings:
|
|
82
|
+
isValid: result.isValid,
|
|
83
|
+
profilePicture: result.profilePicture,
|
|
84
|
+
livenessScore: result.livenessScore,
|
|
85
|
+
faceDetected: result.faceDetected,
|
|
86
|
+
warnings: result.warnings || [],
|
|
110
87
|
};
|
|
111
88
|
} catch (error: any) {
|
|
112
89
|
logger.error('Profile picture validation error', error);
|