idmission-web-sdk 1.0.85 → 1.0.87
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/customer_flows/IdAndFaceValidation.d.ts +5 -0
- package/dist/components/customer_flows/IdValidation.d.ts +3 -0
- package/dist/components/id_capture/CapturedDocuments.d.ts +10 -0
- package/dist/components/id_capture/IdCapture.d.ts +2 -2
- package/dist/components/id_capture/IdCaptureRequirementOption.d.ts +5 -0
- package/dist/components/id_capture/IdCaptureSuccess.d.ts +1 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts +6 -4
- package/dist/components/submission/SubmissionProvider.d.ts +3 -1
- package/dist/lib/models/DocumentDetection.d.ts +1 -7
- package/dist/sdk2.cjs.development.js +274 -230
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +273 -229
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +272 -228
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/stories/Components/AdditionalDocumentCapture.stories.d.ts +1 -1
- package/dist/stories/Components/DocumentCaptureGuideOverlay/FlipIdPrompt.stories.d.ts +3 -3
- package/dist/stories/Components/DocumentCaptureGuideOverlay/LicenseBack.stories.d.ts +1 -1
- package/dist/stories/Components/DocumentCaptureGuideOverlay/LicenseFront.stories.d.ts +3 -3
- package/dist/stories/Components/DocumentCaptureGuideOverlay/Passport.stories.d.ts +3 -3
- package/dist/stories/Components/VideoSignatureCapture.stories.d.ts +3 -3
- package/dist/stories/CustomerFlows/IdAndFaceValidation.stories.d.ts +12 -0
- package/dist/stories/CustomerFlows/IdValidation.stories.d.ts +59 -0
- package/dist/stories/utils/test_photos/cat1.d.ts +6 -0
- package/dist/stories/utils/test_photos/cat2.d.ts +6 -0
- package/dist/stories/utils/test_photos/cat3.d.ts +6 -0
- package/dist/themes/index.d.ts +58 -58
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/dist/components/additional_document_capture/CapturedDocuments.d.ts +0 -8
|
@@ -9,6 +9,7 @@ import { SignatureCaptureClassNames, SignatureCaptureVerbiage } from '../signatu
|
|
|
9
9
|
import { VideoSignatureClassNames, VideoSignatureColors, VideoSignatureVerbiage } from '../video_signature_capture/VideoSignatureWizard';
|
|
10
10
|
import { ThemeInput } from '../../themes';
|
|
11
11
|
import { IdCaptureRequirementOption } from '../id_capture/IdCaptureRequirementOption';
|
|
12
|
+
import { CapturedDocument, CapturedDocuments } from '../id_capture/CapturedDocuments';
|
|
12
13
|
export type IdAndFaceValidationAssets = {
|
|
13
14
|
idCapture?: IdCaptureWizardAssets;
|
|
14
15
|
faceLiveness?: FaceLivenessAssets;
|
|
@@ -69,6 +70,10 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
|
|
|
69
70
|
webhooksSendProcessedImages?: boolean;
|
|
70
71
|
/** Boolean flag to indicate whether customer-configured webhooks should be invoked upon ID being marked for manual review. */
|
|
71
72
|
webhooksFireOnReview?: boolean;
|
|
73
|
+
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack , `passport`.*/
|
|
74
|
+
precapturedDocuments?: CapturedDocuments & {
|
|
75
|
+
selfie: CapturedDocument;
|
|
76
|
+
};
|
|
72
77
|
/** String to indicate which types of ID documents should be captured. Valid values: `idCard`, `passport`, `idCardOrPassport`, `idCardAndPassport`. Default is `idCardOrPassport`. */
|
|
73
78
|
idCaptureRequirement?: IdCaptureRequirementOption;
|
|
74
79
|
/** Boolean to indicate whether photos should be captured automatically when guidance conditions are met. Default is `true`. */
|
|
@@ -8,6 +8,7 @@ import { SignatureCaptureClassNames, SignatureCaptureVerbiage } from '../signatu
|
|
|
8
8
|
import { VideoSignatureClassNames, VideoSignatureColors, VideoSignatureVerbiage } from '../video_signature_capture/VideoSignatureWizard';
|
|
9
9
|
import { ThemeInput } from '../../themes';
|
|
10
10
|
import { IdCaptureRequirementOption } from '../id_capture/IdCaptureRequirementOption';
|
|
11
|
+
import { CapturedDocuments } from '../id_capture/CapturedDocuments';
|
|
11
12
|
export type IdValidationAssets = IdCaptureWizardAssets;
|
|
12
13
|
export type IdValidationClassNames = IdCaptureWizardClassNames & {
|
|
13
14
|
additionalDocumentCapture?: AdditionalDocumentCaptureWizardClassNames;
|
|
@@ -73,6 +74,8 @@ export interface IdValidationProps extends PropsWithChildren {
|
|
|
73
74
|
passportFocusScoreThreshold?: number;
|
|
74
75
|
/** Boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to `false`. */
|
|
75
76
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
77
|
+
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack , `passport`.*/
|
|
78
|
+
precapturedDocuments?: CapturedDocuments;
|
|
76
79
|
/** Callback function that fires immediately prior to submission, giving the client application an opportunity to specify custom asynchronous logic that mutates the request before it executes. The submission request is passed in as a parameter and a promise resolving to the updated request should be returned. */
|
|
77
80
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
78
81
|
/** Callback function that fires when the user has completed the flow instead of making a call to IDmission's servers, allowing customers to specify their own submission logic. Arguments: the request payload that would have been dispatched to IDmission's API, which contains the images/documents/video submitted by the user. Note that when this parameter is supplied, `onComplete` will never fire, and the customer will need to implement their own error handling/retry logic. Use at your own risk! */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CapturedDocument = {
|
|
2
|
+
imageData: string;
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const CapturedDocumentTypeValues: readonly ["idCardFront", "idCardBack", "passport", "selfie"];
|
|
7
|
+
export type CapturedDocumentType = (typeof CapturedDocumentTypeValues)[number];
|
|
8
|
+
export type CapturedDocuments = {
|
|
9
|
+
[k in CapturedDocumentType]?: CapturedDocument;
|
|
10
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DocumentCaptureGuideOverlayClassNames } from './DocumentCaptureGuideOverlay';
|
|
3
|
-
import { DocumentType } from '../../lib/models/DocumentDetection';
|
|
4
3
|
import { PDF417DetectionResult } from '../../lib/barcode/Native';
|
|
5
4
|
import { CaptureAttemptMetadata } from '../../contexts/SubmissionContext';
|
|
6
5
|
import { IdCapturePrediction } from './IdCaptureModelsProvider';
|
|
7
6
|
import { IdCaptureImagePreviewClassNames } from '../common/SelfieProgressPreview';
|
|
8
7
|
import { CustomerSuppliedVerbiage } from '../../lib/locales';
|
|
8
|
+
import { CapturedDocumentType } from './CapturedDocuments';
|
|
9
9
|
export type IdCaptureAssets = {
|
|
10
10
|
portraitGuidesImageUrl?: string;
|
|
11
11
|
landscapeGuidesImageUrl?: string;
|
|
@@ -37,7 +37,7 @@ export type IdCaptureVerbiage = {
|
|
|
37
37
|
guidanceNotDetectedText?: CustomerSuppliedVerbiage;
|
|
38
38
|
};
|
|
39
39
|
export type IdCaptureProps = {
|
|
40
|
-
requiredDocumentType?:
|
|
40
|
+
requiredDocumentType?: CapturedDocumentType;
|
|
41
41
|
autoCaptureEnabled?: boolean;
|
|
42
42
|
autoCaptureScoreThreshold?: number;
|
|
43
43
|
autoCaptureGoodFramesRequired?: number;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
import { CapturedDocumentType } from './CapturedDocuments';
|
|
1
2
|
export type IdCaptureRequirementOption = 'idCard' | 'passport' | 'idCardOrPassport' | 'idCardAndPassport';
|
|
3
|
+
export declare const requiredDocumentsForOption: {
|
|
4
|
+
[key in IdCaptureRequirementOption]: Array<CapturedDocumentType>;
|
|
5
|
+
};
|
|
6
|
+
export declare function requiredImageCountForOption(idCaptureRequirement: IdCaptureRequirementOption): number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
|
-
import { CapturedDocuments } from '
|
|
2
|
+
import { CapturedDocuments } from './CapturedDocuments';
|
|
3
3
|
import { PDF417DetectionResult } from '../../lib/barcode/Native';
|
|
4
4
|
import { LoaderButtonColors } from '../common/LoaderButton';
|
|
5
5
|
import { CustomerSuppliedVerbiage } from '../../lib/locales';
|
|
@@ -2,6 +2,7 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { IdCaptureAssets, IdCaptureClassNames, IdCaptureColors, IdCaptureVerbiage } from './IdCapture';
|
|
3
3
|
import { IdCaptureLoadingOverlayAssets, IdCaptureLoadingOverlayClassNames, IdCaptureLoadingOverlayColors, IdCaptureLoadingOverlayVerbiage } from './IdCaptureLoadingOverlay';
|
|
4
4
|
import { FlipIdPromptAssets, FlipIdPromptClassNames, FlipIdPromptVerbiage } from './FlipIdPrompt';
|
|
5
|
+
import { CapturedDocuments } from './CapturedDocuments';
|
|
5
6
|
import { IdCaptureSuccessClassNames, IdCaptureSuccessColors, IdCaptureSuccessVerbiage } from './IdCaptureSuccess';
|
|
6
7
|
import { IdCaptureFallbackClassNames, IdCaptureFallbackColors, IdCaptureFallbackVerbiage } from '../fallback_flows/IdCapture';
|
|
7
8
|
import { IdCaptureRequirementOption } from './IdCaptureRequirementOption';
|
|
@@ -38,13 +39,14 @@ export type IdCaptureWizardVerbiage = {
|
|
|
38
39
|
fallback?: IdCaptureFallbackVerbiage;
|
|
39
40
|
};
|
|
40
41
|
export type IdCaptureSubmission = {
|
|
41
|
-
idFrontImage
|
|
42
|
-
idBackImage
|
|
43
|
-
passportImage
|
|
42
|
+
idFrontImage?: string;
|
|
43
|
+
idBackImage?: string;
|
|
44
|
+
passportImage?: string;
|
|
44
45
|
};
|
|
45
46
|
export type IdCaptureWizardProps = {
|
|
46
47
|
onSuccess?: (submission: IdCaptureSubmission) => void;
|
|
47
48
|
onExitCapture?: () => void;
|
|
49
|
+
precapturedDocuments?: CapturedDocuments;
|
|
48
50
|
captureRequirement?: IdCaptureRequirementOption;
|
|
49
51
|
autoCaptureEnabled?: boolean;
|
|
50
52
|
autoCaptureGoodFramesRequired?: number;
|
|
@@ -63,4 +65,4 @@ export type IdCaptureWizardProps = {
|
|
|
63
65
|
verbiage?: IdCaptureWizardVerbiage;
|
|
64
66
|
debugMode?: boolean;
|
|
65
67
|
};
|
|
66
|
-
export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, captureRequirement, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, releaseCameraAccessOnExit, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
|
|
68
|
+
export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, precapturedDocuments, captureRequirement, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, releaseCameraAccessOnExit, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
|
|
@@ -3,6 +3,7 @@ import { CaptureAttemptMetadata, CardData, LiveCheckResponse, LivenessCheckReque
|
|
|
3
3
|
import { UploadedDocument } from '../additional_document_capture/AdditionalDocumentCapture';
|
|
4
4
|
import { SignatureData } from '../signature_capture/data';
|
|
5
5
|
import { NetworkError, SubmissionError } from './Errors';
|
|
6
|
+
import { CapturedDocuments } from '../id_capture/CapturedDocuments';
|
|
6
7
|
export type TokenState = 'NOT_PARSED' | 'PARSING' | 'GOOD' | 'EXPIRED' | 'INVALID_FORMAT' | 'INVALID_SIGNATURE' | 'MISSING' | 'PUBLIC_KEY_LOAD_FAILED';
|
|
7
8
|
export type SubmissionState = {
|
|
8
9
|
submit: () => Promise<SubmissionResponse | null>;
|
|
@@ -66,10 +67,11 @@ export type SubmissionProviderProps = {
|
|
|
66
67
|
webhooksSendInputImages?: boolean;
|
|
67
68
|
webhooksSendProcessedImages?: boolean;
|
|
68
69
|
webhooksFireOnReview?: boolean;
|
|
70
|
+
precapturedDocuments?: CapturedDocuments;
|
|
69
71
|
onSubmit?: (payload: SubmissionRequest) => void;
|
|
70
72
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
71
73
|
onBeforeLivenessCheck?: (req: LivenessCheckRequest) => Promise<LivenessCheckRequest>;
|
|
72
74
|
onResponseReceived?: (res: SubmissionResponse, req: SubmissionRequest) => void;
|
|
73
75
|
onRequestFailure?: (err: Error) => void;
|
|
74
76
|
};
|
|
75
|
-
export declare const SubmissionProvider: ({ action, children, url, environment, token, companyId, enrollmentId, personalData, cardData, bypassAgeValidation, bypassNameMatching, needImmediateResponse, manualReviewRequired, idBackImageRequired, idImageResolutionCheck, verifyIdWithExternalDatabases, deduplicationEnabled, deduplicationSynchronous, geolocationEnabled, geolocationRequired, webhooksEnabled, webhooksClientTraceId, webhooksStripSpecialCharacters, webhooksSendInputImages, webhooksSendProcessedImages, webhooksFireOnReview, onSubmit, onBeforeSubmit, onBeforeLivenessCheck, onResponseReceived, onRequestFailure, }: SubmissionProviderProps) => ReactElement;
|
|
77
|
+
export declare const SubmissionProvider: ({ action, children, url, environment, token, companyId, enrollmentId, personalData, cardData, bypassAgeValidation, bypassNameMatching, needImmediateResponse, manualReviewRequired, idBackImageRequired, idImageResolutionCheck, verifyIdWithExternalDatabases, deduplicationEnabled, deduplicationSynchronous, geolocationEnabled, geolocationRequired, webhooksEnabled, webhooksClientTraceId, webhooksStripSpecialCharacters, webhooksSendInputImages, webhooksSendProcessedImages, webhooksFireOnReview, precapturedDocuments, onSubmit, onBeforeSubmit, onBeforeLivenessCheck, onResponseReceived, onRequestFailure, }: SubmissionProviderProps) => ReactElement;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import * as tf from '@tensorflow/tfjs';
|
|
2
|
-
export
|
|
3
|
-
NONE = "NONE",
|
|
4
|
-
ID_CARD = "ID_CARD",
|
|
5
|
-
ID_CARD_FRONT = "ID_CARD_FRONT",
|
|
6
|
-
ID_CARD_BACK = "ID_CARD_BACK",
|
|
7
|
-
PASSPORT = "PASSPORT"
|
|
8
|
-
}
|
|
2
|
+
export type DocumentType = 'none' | 'idCard' | 'passport';
|
|
9
3
|
export declare let documentDetectionModel: tf.GraphModel | null;
|
|
10
4
|
export declare function loadDocumentDetectionModel(url: string): Promise<tf.GraphModel>;
|
|
11
5
|
export declare function unloadDocumentDetectionModel(): void;
|