idmission-web-sdk 2.1.107 → 2.1.109

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.
@@ -24,11 +24,13 @@ export type DetectedObject = {
24
24
  label: Label;
25
25
  score: number;
26
26
  };
27
- export type DocumentDetectionThresholds = {
27
+ export type DocumentThresholds = {
28
28
  idCardFront?: number;
29
29
  idCardBack?: number;
30
30
  passport?: number;
31
- stability?: number;
31
+ };
32
+ export type DocumentDetectionThresholds = DocumentThresholds & {
33
+ stability?: DocumentThresholds;
32
34
  };
33
35
  export declare function loadDocumentDetector(modelAssetPath?: string, scoreThreshold?: number): Promise<ObjectDetector>;
34
36
  export declare function useLoadDocumentDetector({ modelPath, modelLoadTimeoutMs, scoreThreshold, onModelError, }: {
@@ -234,7 +234,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
234
234
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
235
235
  };
236
236
 
237
- var webSdkVersion = '2.1.107';
237
+ var webSdkVersion = '2.1.109';
238
238
 
239
239
  function getPlatform() {
240
240
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -5569,7 +5569,11 @@ var defaultDocumentDetectionThresholds = {
5569
5569
  idCardFront: 0.6,
5570
5570
  idCardBack: 0.6,
5571
5571
  passport: 0.4,
5572
- stability: 0.85
5572
+ stability: {
5573
+ idCardFront: 0.85,
5574
+ idCardBack: 0.85,
5575
+ passport: 0.5
5576
+ }
5573
5577
  };
5574
5578
  var documentTypeDisplayNames = {
5575
5579
  idCardFront: 'ID card front',
@@ -5833,7 +5837,8 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
5833
5837
  docHeight = _o[1];
5834
5838
  documentTooClose = docWidth > 0.85 || docHeight > 0.85;
5835
5839
  if (detectionThresholdMet && documentInBounds && !documentTooClose) {
5836
- var threshold_1 = (_m = thresholds.stability) !== null && _m !== void 0 ? _m : defaultDocumentDetectionThresholds.stability;
5840
+ var thresholdSet = (_m = thresholds.stability) !== null && _m !== void 0 ? _m : defaultDocumentDetectionThresholds.stability;
5841
+ var threshold_1 = thresholdSet[detectedDocumentType];
5837
5842
  var framesNeeded = Math.ceil(average(framesNeededSamples));
5838
5843
  trackBox(bestDocument.box, framesNeeded);
5839
5844
  documentIsStable = lastNBoxes.length >= framesNeeded && !lastNPairs.some(function (pair) {