@hexar/biometric-identity-sdk-react-native 1.1.9 → 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.
@@ -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,CAqNtE,CAAC;AAuBF,eAAe,qBAAqB,CAAC"}
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"}
@@ -196,7 +196,7 @@ const ProfilePictureCapture = ({ onComplete, onError, onCancel, theme, language,
196
196
  react_1.default.createElement(react_native_1.Text, { style: [styles.loadingText, { color: theme?.textColor || '#1e1b4b' }] }, strings.liveness.processing || strings.validation.checkingLiveness || 'Processing...'),
197
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'))));
198
198
  }
199
- return (react_1.default.createElement(VideoRecorder_1.VideoRecorder, { theme: theme, language: language, duration: 8000, smartMode: true, challenges: currentChallenges, sessionId: sdk.getSessionId() || undefined, onComplete: handleVideoComplete, onCancel: handleVideoCancel, onFetchChallenges: async () => {
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 () => {
200
200
  const challenges = await fetchChallenges('active');
201
201
  setCurrentChallenges(challenges);
202
202
  return challenges;
@@ -1 +1 @@
1
- {"version":3,"file":"VideoRecorder.d.ts","sourceRoot":"","sources":["../../src/components/VideoRecorder.tsx"],"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AAS,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: completedChallenges.length === challenges.length,
334
+ instructionsFollowed: finalCompletedChallenges.length === challenges.length,
327
335
  qualityScore: finalFrames.length > 0 ? Math.min(100, (finalFrames.length / 30) * 100) : 85,
328
- challengesCompleted: completedChallenges,
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.9",
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",
@@ -226,7 +226,6 @@ export const ProfilePictureCapture: React.FC<ProfilePictureCaptureProps> = ({
226
226
  <VideoRecorder
227
227
  theme={theme}
228
228
  language={language}
229
- duration={8000}
230
229
  smartMode={true}
231
230
  challenges={currentChallenges}
232
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: completedChallenges.length === challenges.length,
401
+ instructionsFollowed: finalCompletedChallenges.length === challenges.length,
392
402
  qualityScore: finalFrames.length > 0 ? Math.min(100, (finalFrames.length / 30) * 100) : 85,
393
- challengesCompleted: completedChallenges,
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) {