@hexar/biometric-identity-sdk-react-native 1.1.8 → 1.1.10
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/dist/components/ProfilePictureCapture.d.ts.map +1 -1
- package/dist/components/ProfilePictureCapture.js +3 -1
- package/dist/components/VideoRecorder.d.ts.map +1 -1
- package/dist/components/VideoRecorder.js +11 -3
- package/package.json +2 -2
- package/src/components/ProfilePictureCapture.tsx +2 -1
- package/src/components/VideoRecorder.tsx +13 -3
|
@@ -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,CAoNtE,CAAC;AAuBF,eAAe,qBAAqB,CAAC"}
|
|
@@ -102,6 +102,8 @@ const ProfilePictureCapture = ({ onComplete, onError, onCancel, theme, language,
|
|
|
102
102
|
hasVideoFrames: !!videoResult.frames,
|
|
103
103
|
videoFramesType: typeof videoResult.frames,
|
|
104
104
|
firstFrameLength: videoResult.frames?.[0]?.length || 0,
|
|
105
|
+
challengesCompleted: videoResult.challengesCompleted || [],
|
|
106
|
+
challengesCompletedCount: videoResult.challengesCompleted?.length || 0,
|
|
105
107
|
});
|
|
106
108
|
if (!videoResult.frames || videoResult.frames.length === 0) {
|
|
107
109
|
throw new Error('No video frames available for validation');
|
|
@@ -194,7 +196,7 @@ const ProfilePictureCapture = ({ onComplete, onError, onCancel, theme, language,
|
|
|
194
196
|
react_1.default.createElement(react_native_1.Text, { style: [styles.loadingText, { color: theme?.textColor || '#1e1b4b' }] }, strings.liveness.processing || strings.validation.checkingLiveness || 'Processing...'),
|
|
195
197
|
react_1.default.createElement(react_native_1.Text, { style: [styles.loadingSubtext, { color: theme?.secondaryTextColor || '#64748b' }] }, strings.validation.almostDone || strings.common.loading || 'This may take a few seconds'))));
|
|
196
198
|
}
|
|
197
|
-
return (react_1.default.createElement(VideoRecorder_1.VideoRecorder, { theme: theme, language: language,
|
|
199
|
+
return (react_1.default.createElement(VideoRecorder_1.VideoRecorder, { theme: theme, language: language, smartMode: true, challenges: currentChallenges, sessionId: sdk.getSessionId() || undefined, onComplete: handleVideoComplete, onCancel: handleVideoCancel, onFetchChallenges: async () => {
|
|
198
200
|
const challenges = await fetchChallenges('active');
|
|
199
201
|
setCurrentChallenges(challenges);
|
|
200
202
|
return challenges;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoRecorder.d.ts","sourceRoot":"","sources":["../../src/components/VideoRecorder.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AAaxE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,iBAAiB,EAAmC,MAAM,oCAAoC,CAAC;AAE1I,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACrC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wCAAw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AM,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wCAAwC;IACxC,UAAU,EAAE,CAAC,SAAS,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACtD,iCAAiC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiDD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA22BtD,CAAC;AA4OF,eAAe,aAAa,CAAC"}
|
|
@@ -320,12 +320,20 @@ const VideoRecorder = ({ theme, language, duration, instructions, challenges: pr
|
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
322
|
biometric_identity_sdk_core_1.logger.info('Using frames for completion:', finalFrames.length, 'frames');
|
|
323
|
+
let finalCompletedChallenges = completedChallenges;
|
|
324
|
+
if (smartMode && finalCompletedChallenges.length === 0 && challenges.length > 0) {
|
|
325
|
+
finalCompletedChallenges = challenges.map(c => c.action);
|
|
326
|
+
biometric_identity_sdk_core_1.logger.info('Smart mode: marking all challenges as completed based on video duration', {
|
|
327
|
+
challengesCount: finalCompletedChallenges.length,
|
|
328
|
+
duration: actualDuration
|
|
329
|
+
});
|
|
330
|
+
}
|
|
323
331
|
const result = {
|
|
324
332
|
frames: finalFrames,
|
|
325
333
|
duration: actualDuration,
|
|
326
|
-
instructionsFollowed:
|
|
334
|
+
instructionsFollowed: finalCompletedChallenges.length === challenges.length,
|
|
327
335
|
qualityScore: finalFrames.length > 0 ? Math.min(100, (finalFrames.length / 30) * 100) : 85,
|
|
328
|
-
challengesCompleted:
|
|
336
|
+
challengesCompleted: finalCompletedChallenges,
|
|
329
337
|
sessionId,
|
|
330
338
|
};
|
|
331
339
|
biometric_identity_sdk_core_1.logger.info('Video recording completed:', result.frames.length, 'frames,', (actualDuration / 1000).toFixed(1) + 's');
|
|
@@ -338,7 +346,7 @@ const VideoRecorder = ({ theme, language, duration, instructions, challenges: pr
|
|
|
338
346
|
setOverallProgress(0);
|
|
339
347
|
handleRecordingError(error);
|
|
340
348
|
}
|
|
341
|
-
}, [frames, completedChallenges, challenges, sessionId, onComplete, resetAndRetry, handleRecordingError, strings, minDurationMs, phase]);
|
|
349
|
+
}, [frames, completedChallenges, challenges, sessionId, onComplete, resetAndRetry, handleRecordingError, strings, minDurationMs, phase, smartMode]);
|
|
342
350
|
const startFrameCapture = (0, react_1.useCallback)(() => {
|
|
343
351
|
if (cameraRef.current && device) {
|
|
344
352
|
biometric_identity_sdk_core_1.logger.info('Starting frame capture');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hexar/biometric-identity-sdk-react-native",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "React Native wrapper for Biometric Identity SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"clean": "rm -rf dist"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@hexar/biometric-identity-sdk-core": ">=1.1.
|
|
14
|
+
"@hexar/biometric-identity-sdk-core": ">=1.1.3",
|
|
15
15
|
"react": ">=18.0.0",
|
|
16
16
|
"react-native": ">=0.70.0",
|
|
17
17
|
"react-native-permissions": ">=4.0.0",
|
|
@@ -109,6 +109,8 @@ export const ProfilePictureCapture: React.FC<ProfilePictureCaptureProps> = ({
|
|
|
109
109
|
hasVideoFrames: !!videoResult.frames,
|
|
110
110
|
videoFramesType: typeof videoResult.frames,
|
|
111
111
|
firstFrameLength: videoResult.frames?.[0]?.length || 0,
|
|
112
|
+
challengesCompleted: videoResult.challengesCompleted || [],
|
|
113
|
+
challengesCompletedCount: videoResult.challengesCompleted?.length || 0,
|
|
112
114
|
});
|
|
113
115
|
|
|
114
116
|
if (!videoResult.frames || videoResult.frames.length === 0) {
|
|
@@ -224,7 +226,6 @@ export const ProfilePictureCapture: React.FC<ProfilePictureCaptureProps> = ({
|
|
|
224
226
|
<VideoRecorder
|
|
225
227
|
theme={theme}
|
|
226
228
|
language={language}
|
|
227
|
-
duration={8000}
|
|
228
229
|
smartMode={true}
|
|
229
230
|
challenges={currentChallenges}
|
|
230
231
|
sessionId={sdk.getSessionId() || undefined}
|
|
@@ -385,12 +385,22 @@ export const VideoRecorder: React.FC<VideoRecorderProps> = ({
|
|
|
385
385
|
|
|
386
386
|
logger.info('Using frames for completion:', finalFrames.length, 'frames');
|
|
387
387
|
|
|
388
|
+
|
|
389
|
+
let finalCompletedChallenges = completedChallenges;
|
|
390
|
+
if (smartMode && finalCompletedChallenges.length === 0 && challenges.length > 0) {
|
|
391
|
+
finalCompletedChallenges = challenges.map(c => c.action);
|
|
392
|
+
logger.info('Smart mode: marking all challenges as completed based on video duration', {
|
|
393
|
+
challengesCount: finalCompletedChallenges.length,
|
|
394
|
+
duration: actualDuration
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
|
|
388
398
|
const result: VideoRecordingResult = {
|
|
389
399
|
frames: finalFrames,
|
|
390
400
|
duration: actualDuration,
|
|
391
|
-
instructionsFollowed:
|
|
401
|
+
instructionsFollowed: finalCompletedChallenges.length === challenges.length,
|
|
392
402
|
qualityScore: finalFrames.length > 0 ? Math.min(100, (finalFrames.length / 30) * 100) : 85,
|
|
393
|
-
challengesCompleted:
|
|
403
|
+
challengesCompleted: finalCompletedChallenges,
|
|
394
404
|
sessionId,
|
|
395
405
|
};
|
|
396
406
|
|
|
@@ -404,7 +414,7 @@ export const VideoRecorder: React.FC<VideoRecorderProps> = ({
|
|
|
404
414
|
setOverallProgress(0);
|
|
405
415
|
handleRecordingError(error);
|
|
406
416
|
}
|
|
407
|
-
}, [frames, completedChallenges, challenges, sessionId, onComplete, resetAndRetry, handleRecordingError, strings, minDurationMs, phase]);
|
|
417
|
+
}, [frames, completedChallenges, challenges, sessionId, onComplete, resetAndRetry, handleRecordingError, strings, minDurationMs, phase, smartMode]);
|
|
408
418
|
|
|
409
419
|
const startFrameCapture = useCallback(() => {
|
|
410
420
|
if (cameraRef.current && device) {
|