@hexar/biometric-identity-sdk-react-native 1.0.36 → 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,49 +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 apiEndpoint = backendClient.config.apiEndpoint;
|
|
65
|
-
const apiKey = backendClient.config.apiKey;
|
|
66
|
-
const requestBody = {
|
|
67
|
-
session_id: sessionId,
|
|
68
|
-
video_frames: videoResult.frames,
|
|
69
|
-
video_duration_ms: videoResult.duration,
|
|
70
|
-
challenges_completed: videoResult.challengesCompleted || [],
|
|
71
|
-
};
|
|
72
63
|
biometric_identity_sdk_core_1.logger.info('Validating profile picture with backend', {
|
|
73
64
|
sessionId,
|
|
74
65
|
framesCount: videoResult.frames.length,
|
|
75
66
|
duration: videoResult.duration,
|
|
76
|
-
apiEndpoint,
|
|
77
67
|
});
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
'Content-Type': 'application/json',
|
|
84
|
-
'X-API-Key': apiKey,
|
|
85
|
-
},
|
|
86
|
-
body: JSON.stringify(requestBody),
|
|
68
|
+
const result = await sdk.validateProfilePicture({
|
|
69
|
+
sessionId,
|
|
70
|
+
videoFrames: videoResult.frames,
|
|
71
|
+
videoDurationMs: videoResult.duration,
|
|
72
|
+
challengesCompleted: videoResult.challengesCompleted || [],
|
|
87
73
|
});
|
|
88
|
-
biometric_identity_sdk_core_1.logger.info('Backend response received', { status: response.status, ok: response.ok });
|
|
89
|
-
if (!response.ok) {
|
|
90
|
-
const errorData = await response.json().catch(() => ({}));
|
|
91
|
-
biometric_identity_sdk_core_1.logger.error('Backend validation failed', { status: response.status, error: errorData });
|
|
92
|
-
throw new Error('VALIDATION_ERROR');
|
|
93
|
-
}
|
|
94
|
-
const data = await response.json();
|
|
95
74
|
biometric_identity_sdk_core_1.logger.info('Profile picture validation result', {
|
|
96
|
-
isValid:
|
|
97
|
-
livenessScore:
|
|
98
|
-
faceDetected:
|
|
75
|
+
isValid: result.isValid,
|
|
76
|
+
livenessScore: result.livenessScore,
|
|
77
|
+
faceDetected: result.faceDetected,
|
|
99
78
|
});
|
|
100
79
|
return {
|
|
101
|
-
isValid:
|
|
102
|
-
profilePicture:
|
|
103
|
-
livenessScore:
|
|
104
|
-
faceDetected:
|
|
105
|
-
warnings:
|
|
80
|
+
isValid: result.isValid,
|
|
81
|
+
profilePicture: result.profilePicture,
|
|
82
|
+
livenessScore: result.livenessScore,
|
|
83
|
+
faceDetected: result.faceDetected,
|
|
84
|
+
warnings: result.warnings || [],
|
|
106
85
|
};
|
|
107
86
|
}
|
|
108
87
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -59,58 +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 apiEndpoint = backendClient.config.apiEndpoint;
|
|
64
|
-
const apiKey = backendClient.config.apiKey;
|
|
65
|
-
|
|
66
|
-
const requestBody = {
|
|
67
|
-
session_id: sessionId,
|
|
68
|
-
video_frames: videoResult.frames,
|
|
69
|
-
video_duration_ms: videoResult.duration,
|
|
70
|
-
challenges_completed: videoResult.challengesCompleted || [],
|
|
71
|
-
};
|
|
72
|
-
|
|
73
62
|
logger.info('Validating profile picture with backend', {
|
|
74
63
|
sessionId,
|
|
75
64
|
framesCount: videoResult.frames.length,
|
|
76
65
|
duration: videoResult.duration,
|
|
77
|
-
apiEndpoint,
|
|
78
66
|
});
|
|
79
67
|
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
headers: {
|
|
86
|
-
'Content-Type': 'application/json',
|
|
87
|
-
'X-API-Key': apiKey,
|
|
88
|
-
},
|
|
89
|
-
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 || [],
|
|
90
73
|
});
|
|
91
74
|
|
|
92
|
-
logger.info('Backend response received', { status: response.status, ok: response.ok });
|
|
93
|
-
|
|
94
|
-
if (!response.ok) {
|
|
95
|
-
const errorData = await response.json().catch(() => ({}));
|
|
96
|
-
logger.error('Backend validation failed', { status: response.status, error: errorData });
|
|
97
|
-
throw new Error('VALIDATION_ERROR');
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const data = await response.json();
|
|
101
|
-
|
|
102
75
|
logger.info('Profile picture validation result', {
|
|
103
|
-
isValid:
|
|
104
|
-
livenessScore:
|
|
105
|
-
faceDetected:
|
|
76
|
+
isValid: result.isValid,
|
|
77
|
+
livenessScore: result.livenessScore,
|
|
78
|
+
faceDetected: result.faceDetected,
|
|
106
79
|
});
|
|
107
80
|
|
|
108
81
|
return {
|
|
109
|
-
isValid:
|
|
110
|
-
profilePicture:
|
|
111
|
-
livenessScore:
|
|
112
|
-
faceDetected:
|
|
113
|
-
warnings:
|
|
82
|
+
isValid: result.isValid,
|
|
83
|
+
profilePicture: result.profilePicture,
|
|
84
|
+
livenessScore: result.livenessScore,
|
|
85
|
+
faceDetected: result.faceDetected,
|
|
86
|
+
warnings: result.warnings || [],
|
|
114
87
|
};
|
|
115
88
|
} catch (error: any) {
|
|
116
89
|
logger.error('Profile picture validation error', error);
|