idmission-web-sdk 0.0.17 → 0.0.19

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.
Files changed (30) hide show
  1. package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +1 -2
  2. package/dist/components/customer_flows/IdAndFaceValidation.d.ts +1 -2
  3. package/dist/components/customer_flows/IdValidation.d.ts +1 -2
  4. package/dist/components/id_capture/IdCapture.d.ts +1 -2
  5. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +34 -1
  6. package/dist/components/id_capture/IdCaptureWizard.d.ts +1 -2
  7. package/dist/lib/models/DocumentDetection.d.ts +2 -0
  8. package/dist/lib/models/Focus.d.ts +2 -0
  9. package/dist/lib/utils/{cropToShoulders.d.ts → cropping.d.ts} +2 -0
  10. package/dist/lib/utils/getFrameDimensions.d.ts +2 -0
  11. package/dist/sdk2.cjs.development.js +4866 -4758
  12. package/dist/sdk2.cjs.development.js.map +1 -1
  13. package/dist/sdk2.cjs.production.js +1 -1
  14. package/dist/sdk2.cjs.production.js.map +1 -1
  15. package/dist/sdk2.esm.js +4866 -4758
  16. package/dist/sdk2.esm.js.map +1 -1
  17. package/dist/sdk2.umd.development.js +5934 -5826
  18. package/dist/sdk2.umd.development.js.map +1 -1
  19. package/dist/sdk2.umd.production.js +1 -1
  20. package/dist/sdk2.umd.production.js.map +1 -1
  21. package/dist/stories/IdCapture/LicenseBackCapture.stories.d.ts +0 -1
  22. package/dist/stories/IdCapture/LicenseFrontCapture.stories.d.ts +0 -1
  23. package/dist/stories/IdCapture/PassportCapture.stories.d.ts +0 -1
  24. package/dist/stories/IdCapture/Wizard.stories.d.ts +0 -1
  25. package/package.json +1 -1
  26. package/dist/contexts/IdCaptureModelsContext.d.ts +0 -11
  27. package/dist/lib/tfworker/Actions.d.ts +0 -29
  28. package/dist/lib/tfworker/Client.d.ts +0 -14
  29. package/dist/lib/tfworker/TfWorker.d.ts +0 -8
  30. package/dist/stories/WebWorker.stories.d.ts +0 -7
@@ -11,7 +11,6 @@ export type CustomerEnrollmentProps = {
11
11
  submissionToken: string;
12
12
  submissionEnvironment?: SubmissionEnvironment;
13
13
  submissionUrl?: string;
14
- documentDetectionNonMaxSuppressionEnabled?: boolean;
15
14
  idAutoCaptureEnabled?: boolean;
16
15
  idCardAutoCaptureScoreThreshold?: number;
17
16
  mrzDetectionScoreThreshold?: number;
@@ -35,4 +34,4 @@ export type CustomerEnrollmentProps = {
35
34
  geolocationRequired?: boolean;
36
35
  debugMode?: boolean;
37
36
  };
38
- export declare const CustomerIdAndBiometricsEnrollment: ({ enrollmentId, lang, submissionToken, submissionEnvironment, submissionUrl, documentDetectionNonMaxSuppressionEnabled, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, idCaptureAssets, idCaptureVerbiage, faceLivenessTimeoutDurationMs, faceLivenessAssets, faceLivenessVerbiage, onBeforeSubmit, onComplete, onEnrolled, onDenied, onExitAfterFailure, captureSignature, captureSignatureVideo, captureAdditionalDocuments, geolocationEnabled, geolocationRequired, debugMode, }: CustomerEnrollmentProps) => ReactElement;
37
+ export declare const CustomerIdAndBiometricsEnrollment: ({ enrollmentId, lang, submissionToken, submissionEnvironment, submissionUrl, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, idCaptureAssets, idCaptureVerbiage, faceLivenessTimeoutDurationMs, faceLivenessAssets, faceLivenessVerbiage, onBeforeSubmit, onComplete, onEnrolled, onDenied, onExitAfterFailure, captureSignature, captureSignatureVideo, captureAdditionalDocuments, geolocationEnabled, geolocationRequired, debugMode, }: CustomerEnrollmentProps) => ReactElement;
@@ -10,7 +10,6 @@ export type IdAndFaceValidationProps = {
10
10
  submissionToken: string;
11
11
  submissionEnvironment?: SubmissionEnvironment;
12
12
  submissionUrl?: string;
13
- documentDetectionNonMaxSuppressionEnabled?: boolean;
14
13
  idAutoCaptureEnabled?: boolean;
15
14
  idCardAutoCaptureScoreThreshold?: number;
16
15
  mrzDetectionScoreThreshold?: number;
@@ -34,4 +33,4 @@ export type IdAndFaceValidationProps = {
34
33
  geolocationRequired?: boolean;
35
34
  debugMode?: boolean;
36
35
  };
37
- export declare const IdAndFaceValidation: ({ lang, submissionToken, submissionEnvironment, submissionUrl, documentDetectionNonMaxSuppressionEnabled, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, idCaptureAssets, idCaptureVerbiage, faceLivenessTimeoutDurationMs, faceLivenessAssets, faceLivenessVerbiage, onBeforeSubmit, onComplete, onApproved, onDenied, onExitAfterFailure, captureSignature, captureSignatureVideo, captureAdditionalDocuments, geolocationEnabled, geolocationRequired, debugMode, }: IdAndFaceValidationProps) => ReactElement;
36
+ export declare const IdAndFaceValidation: ({ lang, submissionToken, submissionEnvironment, submissionUrl, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, idCaptureAssets, idCaptureVerbiage, faceLivenessTimeoutDurationMs, faceLivenessAssets, faceLivenessVerbiage, onBeforeSubmit, onComplete, onApproved, onDenied, onExitAfterFailure, captureSignature, captureSignatureVideo, captureAdditionalDocuments, geolocationEnabled, geolocationRequired, debugMode, }: IdAndFaceValidationProps) => ReactElement;
@@ -11,7 +11,6 @@ export type IdValidationProps = {
11
11
  submissionToken: string;
12
12
  submissionEnvironment?: SubmissionEnvironment;
13
13
  submissionUrl?: string;
14
- documentDetectionNonMaxSuppressionEnabled?: boolean;
15
14
  idAutoCaptureEnabled?: boolean;
16
15
  idCardAutoCaptureScoreThreshold?: number;
17
16
  passportAutoCaptureScoreThreshold?: number;
@@ -30,4 +29,4 @@ export type IdValidationProps = {
30
29
  geolocationRequired?: boolean;
31
30
  debugMode?: boolean;
32
31
  };
33
- export declare const IdValidation: ({ lang, submissionToken, submissionEnvironment, submissionUrl, documentDetectionNonMaxSuppressionEnabled, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, onBeforeSubmit, onComplete, onApproved, onDenied, assets, verbiage, captureSignature, captureSignatureVideo, captureAdditionalDocuments, geolocationEnabled, geolocationRequired, debugMode, }: IdValidationProps) => ReactElement;
32
+ export declare const IdValidation: ({ lang, submissionToken, submissionEnvironment, submissionUrl, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, onBeforeSubmit, onComplete, onApproved, onDenied, assets, verbiage, captureSignature, captureSignatureVideo, captureAdditionalDocuments, geolocationEnabled, geolocationRequired, debugMode, }: IdValidationProps) => ReactElement;
@@ -22,7 +22,6 @@ export type IdCaptureVerbiage = {
22
22
  captureFailedText?: string;
23
23
  };
24
24
  export type IdCaptureProps = {
25
- documentDetectionNonMaxSuppressionEnabled: boolean;
26
25
  requiredDocumentType?: DocumentType;
27
26
  autoCaptureEnabled?: boolean;
28
27
  autoCaptureScoreThreshold?: number;
@@ -43,4 +42,4 @@ export type IdCaptureProps = {
43
42
  verbiage?: IdCaptureVerbiage;
44
43
  debugMode?: boolean;
45
44
  };
46
- export declare const IdCapture: ({ documentDetectionNonMaxSuppressionEnabled, requiredDocumentType, autoCaptureEnabled, autoCaptureScoreThreshold, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, mrzDetectionScoreThreshold, passportPageDetectionThreshold, pdf417DetectionThreshold, focusScoreThreshold, barcodeScanningEnabled, maxBarcodeScanAttempts, onPrediction, onBarcodeScanned, onCapture, processingScreen, processingDelay, assets, verbiage, debugMode, }: IdCaptureProps) => React.ReactElement;
45
+ export declare const IdCapture: ({ requiredDocumentType, autoCaptureEnabled, autoCaptureScoreThreshold, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, mrzDetectionScoreThreshold, passportPageDetectionThreshold, pdf417DetectionThreshold, focusScoreThreshold, barcodeScanningEnabled, maxBarcodeScanAttempts, onPrediction, onBarcodeScanned, onCapture, processingScreen, processingDelay, assets, verbiage, debugMode, }: IdCaptureProps) => React.ReactElement;
@@ -1,4 +1,37 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import React, { MutableRefObject, ReactElement, ReactNode } from 'react';
2
+ import { DetectedObject } from '../../lib/models/DocumentDetection';
3
+ import { Frame } from '../../lib/utils/getFrameDimensions';
4
+ export type IdCapturePrediction = {
5
+ detectedObjects: DetectedObject[];
6
+ detectionTime: number;
7
+ detectionScore: number;
8
+ detectionThresholdMet: boolean;
9
+ passportDetectionScore: number;
10
+ passportDetectionThresholdMet: boolean;
11
+ bestDocumentOrPassport: DetectedObject | undefined;
12
+ focusScore: number;
13
+ focusThresholdMet: boolean;
14
+ focusPredictionTime: number;
15
+ frameWidth: number;
16
+ frameHeight: number;
17
+ };
18
+ export type IdCaptureModelsState = {
19
+ ready: boolean;
20
+ working: MutableRefObject<boolean>;
21
+ documentDetectionThreshold: number;
22
+ setDocumentDetectionThreshold: (value: number) => void;
23
+ passportDetectionThreshold: number;
24
+ setPassportDetectionThreshold: (value: number) => void;
25
+ focusThreshold: number;
26
+ setFocusThreshold: (value: number) => void;
27
+ makePrediction: (frame: Frame) => void;
28
+ onPredictionMade: (handler: (prediction: IdCapturePrediction) => void) => void;
29
+ detectionTime: number;
30
+ focusPredictionTime: number;
31
+ getBestFrame: () => Promise<Blob | null>;
32
+ resetBestFrame: () => void;
33
+ };
34
+ export declare const IdCaptureModelsContext: React.Context<IdCaptureModelsState>;
2
35
  export type IdCaptureModelsProviderProps = {
3
36
  children: ReactNode;
4
37
  documentDetectionModelUrl?: string | undefined;
@@ -39,7 +39,6 @@ export type IdCaptureSubmission = {
39
39
  };
40
40
  export type IdCaptureWizardProps = {
41
41
  onSuccess?: (submission: IdCaptureSubmission) => void;
42
- documentDetectionNonMaxSuppressionEnabled?: boolean;
43
42
  autoCaptureEnabled?: boolean;
44
43
  autoCaptureGoodFramesRequired?: number;
45
44
  autoCaptureBarcodeRequired?: 'mobile' | boolean;
@@ -53,4 +52,4 @@ export type IdCaptureWizardProps = {
53
52
  assets?: IdCaptureAssets;
54
53
  debugMode?: boolean;
55
54
  };
56
- export declare const IdCaptureWizard: ({ onSuccess, documentDetectionNonMaxSuppressionEnabled, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, assets, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
55
+ export declare const IdCaptureWizard: ({ onSuccess, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, assets, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
@@ -6,7 +6,9 @@ export declare enum DocumentType {
6
6
  ID_CARD_BACK = "ID_CARD_BACK",
7
7
  PASSPORT = "PASSPORT"
8
8
  }
9
+ export declare let documentDetectionModel: tf.GraphModel | null;
9
10
  export declare function loadDocumentDetectionModel(url: string): Promise<tf.GraphModel>;
11
+ export declare function unloadDocumentDetectionModel(): void;
10
12
  export type RawEdgeDetectionResult = tf.Tensor<tf.Rank>[];
11
13
  export declare function makeDocumentDetectionPredictions(model: tf.GraphModel, image: ImageBitmap | ImageData | HTMLImageElement): Promise<[RawEdgeDetectionResult, () => void]>;
12
14
  export type DocumentDetectionResults = {
@@ -1,5 +1,7 @@
1
1
  import * as tf from '@tensorflow/tfjs';
2
+ export declare let focusModel: tf.LayersModel | null;
2
3
  export declare function loadFocusModel(url: string): Promise<tf.LayersModel>;
4
+ export declare function unloadFocusModel(): void;
3
5
  type BlurScore = number;
4
6
  type FocusScore = number;
5
7
  export type FocusPrediction = [BlurScore, FocusScore];
@@ -1,2 +1,4 @@
1
1
  import { Face } from '@tensorflow-models/face-detection';
2
+ import { Frame } from './getFrameDimensions';
2
3
  export declare function cropToShoulders(frame: ImageBitmap, face: Face): string;
4
+ export declare function cropToBoundingBox(frame: Frame, bbox: number[]): HTMLCanvasElement;
@@ -0,0 +1,2 @@
1
+ export type Frame = ImageBitmap | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement;
2
+ export declare function getFrameDimensions(frame: Frame): [number, number];