idmission-web-sdk 1.1.0 → 2.0.0
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/README.md +130 -46
- package/dist/components/CompositeWizard.d.ts +3 -3
- package/dist/components/common/debug.d.ts +6 -3
- package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts +17 -2
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +21 -6
- package/dist/components/customer_flows/CustomerIdentification.d.ts +17 -2
- package/dist/components/customer_flows/CustomerVerification.d.ts +17 -2
- package/dist/components/customer_flows/DocumentCapture.d.ts +17 -6
- package/dist/components/customer_flows/FaceValidation.d.ts +19 -2
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts +22 -7
- package/dist/components/customer_flows/IdValidation.d.ts +26 -5
- package/dist/components/customer_flows/SignatureKYC.d.ts +21 -2
- package/dist/components/customer_flows/VideoIdValidation.d.ts +21 -2
- package/dist/components/document_capture/DocumentCaptureStateProvider.d.ts +1 -1
- package/dist/components/id_capture/CapturedDocuments.d.ts +5 -3
- package/dist/components/id_capture/DocumentDetectionModelProvider.d.ts +29 -0
- package/dist/components/id_capture/FocusModelProvider.d.ts +22 -0
- package/dist/components/id_capture/IdCapture.d.ts +6 -6
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +21 -35
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +7 -3
- package/dist/components/id_capture/IdCaptureWizard.d.ts +2 -2
- package/dist/components/selfie_capture/SelfieCapture.d.ts +1 -1
- package/dist/components/selfie_capture/SelfieGuidanceModelsProvider.d.ts +21 -3
- package/dist/components/submission/AuthUrlNotAllowedOverlay.d.ts +2 -0
- package/dist/components/submission/Errors.d.ts +1 -1
- package/dist/components/submission/SessionIdMissingOverlay.d.ts +2 -0
- package/dist/components/submission/SessionValidationErrorOverlay.d.ts +6 -0
- package/dist/components/submission/SessionValidationFailedOverlay.d.ts +2 -0
- package/dist/components/submission/SubmissionProvider.d.ts +26 -5
- package/dist/contexts/AuthStateContext.d.ts +33 -0
- package/dist/contexts/SubmissionContext.d.ts +13 -4
- package/dist/index.d.ts +7 -1
- package/dist/lib/barcode/Scan.d.ts +2 -1
- package/dist/lib/models/CapabilityProbing.d.ts +14 -0
- package/dist/lib/models/DocumentDetection.d.ts +64 -25
- package/dist/lib/models/FaceDetection.d.ts +33 -4
- package/dist/lib/models/Focus.d.ts +33 -9
- package/dist/lib/models/FrameLoop.d.ts +7 -0
- package/dist/lib/models/VisionRuntime.d.ts +2 -0
- package/dist/lib/models/helpers.d.ts +9 -0
- package/dist/lib/models/preloadModels.d.ts +9 -2
- package/dist/lib/utils/cropping.d.ts +3 -2
- package/dist/lib/utils/dataUrlToBase64.d.ts +2 -0
- package/dist/lib/utils/isMobile.d.ts +1 -0
- package/dist/lib/utils/logger.d.ts +2 -0
- package/dist/sdk2.cjs.development.js +2959 -8926
- 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 +2960 -8929
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +2972 -8940
- 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/Auth.stories.d.ts +8 -0
- package/dist/stories/Components/CompositeWizard/FaceLivenessAndIdCapture.stories.d.ts +0 -9
- package/dist/stories/Components/HighPerformanceFaceDetection/Minimal.stories.d.ts +12 -12
- package/dist/stories/CustomerFlows/CustomerBiometricsEnrollment.stories.d.ts +5 -1
- package/dist/stories/CustomerFlows/CustomerIdAndBiometricsEnrollment.stories.d.ts +5 -1
- package/dist/stories/CustomerFlows/CustomerIdentification.stories.d.ts +5 -1
- package/dist/stories/CustomerFlows/CustomerVerification.stories.d.ts +5 -1
- package/dist/stories/CustomerFlows/DocumentCapture.stories.d.ts +5 -1
- package/dist/stories/CustomerFlows/FaceValidation.stories.d.ts +5 -1
- package/dist/stories/CustomerFlows/IdAndFaceValidation.stories.d.ts +6 -1
- package/dist/stories/CustomerFlows/IdValidation.stories.d.ts +23 -10
- package/dist/stories/CustomerFlows/SignatureKYC.stories.d.ts +5 -1
- package/dist/stories/CustomerFlows/VideoIdValidation.stories.d.ts +15 -2
- package/dist/stories/{models/DocumentDetection.stories.d.ts → Experiments/SpeedTest.stories.d.ts} +2 -2
- package/dist/stories/Experiments/VideoCapture.stories.d.ts +1 -1
- package/dist/stories/models/FocusModel.stories.d.ts +1 -1
- package/dist/stories/utils/sessions.d.ts +13 -0
- package/dist/stories/utils/useLocalStorage.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/id_capture/HighPerformanceObjectDetectionModelsProvider.d.ts +0 -36
- package/dist/components/selfie_capture/HighPerformanceSelfieGuidanceModelsProvider.d.ts +0 -42
- package/dist/components/submission/TokenIssuerNotAllowedErrorOverlay.d.ts +0 -2
- package/dist/components/submission/TokenMissingErrorOverlay.d.ts +0 -2
- package/dist/components/submission/TokenPublicKeyErrorOverlay.d.ts +0 -5
- package/dist/contexts/SelfieGuidanceModelsContext.d.ts +0 -15
- package/dist/stories/Components/HighPerformanceFaceDetection/Original.stories.d.ts +0 -8
- package/dist/stories/Experiments/BarcodeReader.stories.d.ts +0 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
2
3
|
import { SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
4
|
import { FaceLivenessAssets, FaceLivenessClassNames, FaceLivenessColors, FaceLivenessVerbiage } from '../face_liveness/FaceLivenessWizard';
|
|
4
5
|
import { AdditionalDocumentCaptureWizardClassNames, AdditionalDocumentCaptureWizardVerbiage } from '../additional_document_capture/AdditionalDocumentCaptureWizard';
|
|
@@ -32,10 +33,14 @@ export interface CustomerBiometricsEnrollmentProps extends PropsWithChildren {
|
|
|
32
33
|
enrollmentId: string;
|
|
33
34
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
34
35
|
lang?: LangOption;
|
|
35
|
-
/** A
|
|
36
|
-
|
|
36
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
37
|
+
sessionId: string | (() => Promise<string>);
|
|
37
38
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
38
39
|
submissionUrl?: string;
|
|
40
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
41
|
+
authUrl?: string;
|
|
42
|
+
/** URL to upload captured documents to via Tus. */
|
|
43
|
+
documentServiceUrl?: string;
|
|
39
44
|
/** Company identifier to include with submission. */
|
|
40
45
|
companyId?: string;
|
|
41
46
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -54,6 +59,8 @@ export interface CustomerBiometricsEnrollmentProps extends PropsWithChildren {
|
|
|
54
59
|
webhooksSendInputImages?: boolean;
|
|
55
60
|
/** Boolean flag to indicate whether processed user-captured images should be included in the submission data when customer-configured webhooks are invoked. */
|
|
56
61
|
webhooksSendProcessedImages?: boolean;
|
|
62
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
63
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
57
64
|
/** String indicating which loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
58
65
|
loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
59
66
|
/** The duration of time in milliseconds that the user may try to pass the realness check. Defaults to `15000` (15 seconds). */
|
|
@@ -62,6 +69,14 @@ export interface CustomerBiometricsEnrollmentProps extends PropsWithChildren {
|
|
|
62
69
|
modelLoadTimeoutMs?: number;
|
|
63
70
|
/** 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`. */
|
|
64
71
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
72
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
73
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
74
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
75
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
76
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
77
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
78
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
79
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
65
80
|
/** 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. */
|
|
66
81
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
67
82
|
/** 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! */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
2
3
|
import { CardData, PersonalData, SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
4
|
import { FaceLivenessAssets, FaceLivenessClassNames, FaceLivenessColors, FaceLivenessVerbiage } from '../face_liveness/FaceLivenessWizard';
|
|
4
5
|
import { IdCaptureWizardAssets, IdCaptureWizardClassNames, IdCaptureWizardColors, IdCaptureWizardVerbiage } from '../id_capture/IdCaptureWizard';
|
|
@@ -40,10 +41,14 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
|
|
|
40
41
|
enrollmentId: string;
|
|
41
42
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
42
43
|
lang?: LangOption;
|
|
43
|
-
/** A
|
|
44
|
-
|
|
44
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
45
|
+
sessionId: string | (() => Promise<string>);
|
|
45
46
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
46
47
|
submissionUrl?: string;
|
|
48
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
49
|
+
authUrl?: string;
|
|
50
|
+
/** URL to upload captured documents to via Tus. */
|
|
51
|
+
documentServiceUrl?: string;
|
|
47
52
|
/** Company identifier to include with submission. */
|
|
48
53
|
companyId?: string;
|
|
49
54
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -80,6 +85,8 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
|
|
|
80
85
|
webhooksSendProcessedImages?: boolean;
|
|
81
86
|
/** Boolean flag to indicate whether customer-configured webhooks should be invoked upon ID being marked for manual review. */
|
|
82
87
|
webhooksFireOnReview?: boolean;
|
|
88
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
89
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
83
90
|
/** String indicating which ID capture loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
84
91
|
idCaptureLoadingOverlayMode?: IdCaptureLoadingOverlayMode;
|
|
85
92
|
/** String to indicate which types of ID documents should be captured. Valid values: `idCard`, `passport`, `idCardOrPassport`, `idCardAndPassport`. Default is `idCardOrPassport`. */
|
|
@@ -88,13 +95,13 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
|
|
|
88
95
|
idAutoCaptureEnabled?: boolean;
|
|
89
96
|
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for ID cards. Defaults to 0.8. */
|
|
90
97
|
idCardAutoCaptureScoreThreshold?: number;
|
|
91
|
-
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for Machine Readable Zones. Defaults to 0.5. */
|
|
92
|
-
mrzDetectionScoreThreshold?: number;
|
|
93
98
|
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for passports. Defaults to 0.75. */
|
|
94
99
|
passportAutoCaptureScoreThreshold?: number;
|
|
95
|
-
/** Number between 0 and 1 at which
|
|
100
|
+
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for Machine Readable Zones. Defaults to 0.5. */
|
|
101
|
+
mrzDetectionScoreThreshold?: number;
|
|
102
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. Defaults to 0.3. */
|
|
96
103
|
idCardFocusScoreThreshold?: number;
|
|
97
|
-
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. */
|
|
104
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. Defaults to 0.3. */
|
|
98
105
|
passportFocusScoreThreshold?: number;
|
|
99
106
|
/** String indicating which face liveness loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
100
107
|
faceLivenessLoadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
@@ -114,6 +121,14 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
|
|
|
114
121
|
idCaptureModelLoadTimeoutMs?: number;
|
|
115
122
|
/** Number of milliseconds indicating the maximum amount of time that should be spent trying to load the guided capture experience before giving up and resorting to the stock camera instead. Defaults to 45000 (45 seconds). */
|
|
116
123
|
selfieCaptureModelLoadTimeoutMs?: number;
|
|
124
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
125
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
126
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
127
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
128
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
129
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
130
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
131
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
117
132
|
/** 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. */
|
|
118
133
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
119
134
|
/** 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! */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
2
3
|
import { SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
4
|
import { CustomerIdentificationAssets, CustomerIdentificationClassNames, CustomerIdentificationColors, CustomerIdentificationVerbiage } from '../customer_identification/CustomerIdentificationWizard';
|
|
4
5
|
import { LangOption } from '../../lib/locales';
|
|
@@ -7,10 +8,14 @@ import { SelfieCaptureLoadingOverlayMode } from '../selfie_capture/SelfieCapture
|
|
|
7
8
|
export interface CustomerIdentificationProps extends PropsWithChildren {
|
|
8
9
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
9
10
|
lang?: LangOption;
|
|
10
|
-
/** A
|
|
11
|
-
|
|
11
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
12
|
+
sessionId: string | (() => Promise<string>);
|
|
12
13
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
13
14
|
submissionUrl?: string;
|
|
15
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
16
|
+
authUrl?: string;
|
|
17
|
+
/** URL to upload captured documents to via Tus. */
|
|
18
|
+
documentServiceUrl?: string;
|
|
14
19
|
/** Company identifier to include with submission. */
|
|
15
20
|
companyId?: string;
|
|
16
21
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -25,6 +30,8 @@ export interface CustomerIdentificationProps extends PropsWithChildren {
|
|
|
25
30
|
webhooksSendInputImages?: boolean;
|
|
26
31
|
/** Boolean flag to indicate whether processed user-captured images should be included in the submission data when customer-configured webhooks are invoked. */
|
|
27
32
|
webhooksSendProcessedImages?: boolean;
|
|
33
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
34
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
28
35
|
/** String indicating which loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
29
36
|
loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
30
37
|
/** The duration of time in milliseconds that the user may try to pass the realness check. Defaults to `15000` (15 seconds). */
|
|
@@ -33,6 +40,14 @@ export interface CustomerIdentificationProps extends PropsWithChildren {
|
|
|
33
40
|
modelLoadTimeoutMs?: number;
|
|
34
41
|
/** 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`. */
|
|
35
42
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
43
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
44
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
45
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
46
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
47
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
48
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
49
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
50
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
36
51
|
/** 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. */
|
|
37
52
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
38
53
|
/** 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! */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
2
3
|
import { SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
4
|
import { LangOption } from '../../lib/locales';
|
|
4
5
|
import { CustomerVerificationAssets, CustomerVerificationClassNames, CustomerVerificationColors, CustomerVerificationVerbiage } from '../customer_verification/CustomerVerificationWizard';
|
|
@@ -9,10 +10,14 @@ export interface CustomerVerificationProps extends PropsWithChildren {
|
|
|
9
10
|
enrollmentId: string;
|
|
10
11
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
11
12
|
lang?: LangOption;
|
|
12
|
-
/** A
|
|
13
|
-
|
|
13
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
14
|
+
sessionId: string | (() => Promise<string>);
|
|
14
15
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
15
16
|
submissionUrl?: string;
|
|
17
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
18
|
+
authUrl?: string;
|
|
19
|
+
/** URL to upload captured documents to via Tus. */
|
|
20
|
+
documentServiceUrl?: string;
|
|
16
21
|
/** Company identifier to include with submission. */
|
|
17
22
|
companyId?: string;
|
|
18
23
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -27,6 +32,8 @@ export interface CustomerVerificationProps extends PropsWithChildren {
|
|
|
27
32
|
webhooksSendInputImages?: boolean;
|
|
28
33
|
/** Boolean flag to indicate whether processed user-captured images should be included in the submission data when customer-configured webhooks are invoked. */
|
|
29
34
|
webhooksSendProcessedImages?: boolean;
|
|
35
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
36
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
30
37
|
/** String indicating which loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
31
38
|
loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
32
39
|
/** The duration of time in milliseconds that the user may try to pass the realness check. Defaults to `15000` (15 seconds). */
|
|
@@ -45,6 +52,14 @@ export interface CustomerVerificationProps extends PropsWithChildren {
|
|
|
45
52
|
colors?: CustomerVerificationColors;
|
|
46
53
|
/** Object containing any verbiage overrides. */
|
|
47
54
|
verbiage?: CustomerVerificationVerbiage;
|
|
55
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
56
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
57
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
58
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
59
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
60
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
61
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
62
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
48
63
|
/** 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. */
|
|
49
64
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
50
65
|
/** 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! */
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import { ThemeInput } from '../../themes';
|
|
3
3
|
import { LangOption } from '../../lib/locales';
|
|
4
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
4
5
|
import { DocumentCaptureWizardClassNames, DocumentCaptureWizardVerbiage } from '../document_capture/DocumentCaptureWizard';
|
|
5
6
|
import { CameraFeedMode } from '../../lib/camera/CameraFeedWrapper';
|
|
6
|
-
import { CapturedDocument, OnAllDocumentsUploaded
|
|
7
|
+
import { CapturedDocument, OnAllDocumentsUploaded } from '../document_capture/DocumentCaptureStateProvider';
|
|
7
8
|
export type DocumentCaptureClassNames = DocumentCaptureWizardClassNames;
|
|
8
9
|
export type DocumentCaptureVerbiage = DocumentCaptureWizardVerbiage;
|
|
9
10
|
export interface DocumentCaptureProps extends PropsWithChildren {
|
|
10
11
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
11
12
|
lang?: LangOption;
|
|
12
|
-
/** A
|
|
13
|
-
|
|
13
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
14
|
+
sessionId: string | (() => Promise<string>);
|
|
14
15
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
15
16
|
submissionUrl?: string;
|
|
17
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
18
|
+
authUrl?: string;
|
|
16
19
|
/** URL to upload captured documents to via Tus. */
|
|
17
20
|
documentServiceUrl?: string;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/** Callback function that fires
|
|
21
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
22
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
23
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
24
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
25
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
26
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
27
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
21
28
|
onDocumentUploaded?: OnDocumentUploaded;
|
|
29
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
30
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
31
|
+
/** Callback function that fires when the user completes the DocumentCapture flow. Arguments: the SubmissionResponse from IDmission's API is passed as an argument to the customer's application for further handling, which indicates whether the user passed the validation check, and the request payload dispatched to IDmission's API, which contains the images submitted by the user. */
|
|
32
|
+
onComplete?: OnAllDocumentsUploaded;
|
|
22
33
|
/** Callback function that fires when the user clicks the exit button during ID or selfie capture. */
|
|
23
34
|
onExitCapture?: () => void;
|
|
24
35
|
/** Callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
2
3
|
import { LivenessCheckRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
4
|
import { FaceLivenessAssets, FaceLivenessClassNames, FaceLivenessColors, FaceLivenessVerbiage } from '../face_liveness/FaceLivenessWizard';
|
|
4
5
|
import { LangOption } from '../../lib/locales';
|
|
@@ -11,10 +12,14 @@ export type FaceValidationVerbiage = FaceLivenessVerbiage;
|
|
|
11
12
|
export interface FaceValidationProps extends PropsWithChildren {
|
|
12
13
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
13
14
|
lang?: LangOption;
|
|
14
|
-
/** A
|
|
15
|
-
|
|
15
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
16
|
+
sessionId: string | (() => Promise<string>);
|
|
16
17
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
17
18
|
submissionUrl?: string;
|
|
19
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
20
|
+
authUrl?: string;
|
|
21
|
+
/** URL to upload captured documents to via Tus. */
|
|
22
|
+
documentServiceUrl?: string;
|
|
18
23
|
/** Company identifier to include with submission. */
|
|
19
24
|
companyId?: string;
|
|
20
25
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -29,6 +34,8 @@ export interface FaceValidationProps extends PropsWithChildren {
|
|
|
29
34
|
webhooksSendInputImages?: boolean;
|
|
30
35
|
/** Boolean flag to indicate whether processed user-captured images should be included in the submission data when customer-configured webhooks are invoked. */
|
|
31
36
|
webhooksSendProcessedImages?: boolean;
|
|
37
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
38
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
32
39
|
/** String indicating which loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
33
40
|
loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
34
41
|
/** The duration of time in milliseconds that the user may try to pass the realness check. Defaults to `15000` (15 seconds). */
|
|
@@ -37,6 +44,16 @@ export interface FaceValidationProps extends PropsWithChildren {
|
|
|
37
44
|
modelLoadTimeoutMs?: number;
|
|
38
45
|
/** 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`. */
|
|
39
46
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
47
|
+
/** String containing a base64 image or document service ID pointing to an ID card front image that should be used to match the user's face against. Leave blank to disable face matching. */
|
|
48
|
+
idCardForFaceMatch?: string;
|
|
49
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
50
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
51
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
52
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
53
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
54
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
55
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
56
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
40
57
|
/** Callback function that fires immediately prior to liveness check, giving the client application an opportunity to specify custom asynchronous logic that mutates the request before it executes. The liveness check request is passed in as a parameter and a promise resolving to the updated request should be returned. */
|
|
41
58
|
onBeforeSubmit?: (req: LivenessCheckRequest) => Promise<LivenessCheckRequest>;
|
|
42
59
|
/** Callback function that fires when the user has completed the FaceValidation flow, regardless of whether they are approved or denied. Arguments: the SubmissionResponse from IDmission's API is passed as an argument to the customer's application for further handling, which indicates whether the user passed the validation check, and the request payload dispatched to IDmission's API, which contains the images submitted by the user. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
2
3
|
import { CardData, LivenessCheckRequest, PersonalData, SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
4
|
import { FaceLivenessAssets, FaceLivenessClassNames, FaceLivenessColors, FaceLivenessVerbiage } from '../face_liveness/FaceLivenessWizard';
|
|
4
5
|
import { IdCaptureWizardAssets, IdCaptureWizardClassNames, IdCaptureWizardColors, IdCaptureWizardVerbiage } from '../id_capture/IdCaptureWizard';
|
|
@@ -39,10 +40,14 @@ export type IdAndFaceValidationVerbiage = {
|
|
|
39
40
|
export interface IdAndFaceValidationProps extends PropsWithChildren {
|
|
40
41
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
41
42
|
lang?: LangOption;
|
|
42
|
-
/** A
|
|
43
|
-
|
|
43
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
44
|
+
sessionId: string | (() => Promise<string>);
|
|
44
45
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
45
46
|
submissionUrl?: string;
|
|
47
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
48
|
+
authUrl?: string;
|
|
49
|
+
/** URL to upload captured documents to via Tus. */
|
|
50
|
+
documentServiceUrl?: string;
|
|
46
51
|
/** Company identifier to include with submission. */
|
|
47
52
|
companyId?: string;
|
|
48
53
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -73,7 +78,9 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
|
|
|
73
78
|
webhooksSendProcessedImages?: boolean;
|
|
74
79
|
/** Boolean flag to indicate whether customer-configured webhooks should be invoked upon ID being marked for manual review. */
|
|
75
80
|
webhooksFireOnReview?: boolean;
|
|
76
|
-
/**
|
|
81
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
82
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
83
|
+
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack`, `passport`. */
|
|
77
84
|
precapturedDocuments?: CapturedDocuments & {
|
|
78
85
|
selfie: CapturedDocument;
|
|
79
86
|
};
|
|
@@ -85,13 +92,13 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
|
|
|
85
92
|
idAutoCaptureEnabled?: boolean;
|
|
86
93
|
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for ID cards. Defaults to 0.8. */
|
|
87
94
|
idCardAutoCaptureScoreThreshold?: number;
|
|
88
|
-
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for Machine Readable Zones. Defaults to 0.5. */
|
|
89
|
-
mrzDetectionScoreThreshold?: number;
|
|
90
95
|
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for passports. Defaults to 0.75. */
|
|
91
96
|
passportAutoCaptureScoreThreshold?: number;
|
|
92
|
-
/** Number between 0 and 1 at which
|
|
97
|
+
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for Machine Readable Zones. Defaults to 0.5. */
|
|
98
|
+
mrzDetectionScoreThreshold?: number;
|
|
99
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. Defaults to 0.3. */
|
|
93
100
|
idCardFocusScoreThreshold?: number;
|
|
94
|
-
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. */
|
|
101
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. Defaults to 0.3. */
|
|
95
102
|
passportFocusScoreThreshold?: number;
|
|
96
103
|
/** String indicating which face liveness loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
97
104
|
faceLivenessLoadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
@@ -111,6 +118,14 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
|
|
|
111
118
|
idCaptureModelLoadTimeoutMs?: number;
|
|
112
119
|
/** Number of milliseconds indicating the maximum amount of time that should be spent trying to load the guided capture experience before giving up and resorting to the stock camera instead. Defaults to 45000 (45 seconds). */
|
|
113
120
|
selfieCaptureModelLoadTimeoutMs?: number;
|
|
121
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
122
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
123
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
124
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
125
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
126
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
127
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
128
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
114
129
|
/** Callback function that fires immediately prior to liveness check, giving the client application an opportunity to specify custom asynchronous logic that mutates the request before it executes. The liveness check request is passed in as a parameter and a promise resolving to the updated request should be returned. */
|
|
115
130
|
onBeforeLivenessCheck?: (req: LivenessCheckRequest) => Promise<LivenessCheckRequest>;
|
|
116
131
|
/** 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. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
2
3
|
import { CardData, PersonalData, SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
4
|
import { IdCaptureWizardAssets, IdCaptureWizardClassNames, IdCaptureWizardColors, IdCaptureWizardVerbiage } from '../id_capture/IdCaptureWizard';
|
|
4
5
|
import { AdditionalDocumentCaptureWizardClassNames, AdditionalDocumentCaptureWizardVerbiage } from '../additional_document_capture/AdditionalDocumentCaptureWizard';
|
|
@@ -28,10 +29,16 @@ export type IdValidationVerbiage = IdCaptureWizardVerbiage & {
|
|
|
28
29
|
export interface IdValidationProps extends PropsWithChildren {
|
|
29
30
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
30
31
|
lang?: LangOption;
|
|
31
|
-
/** A
|
|
32
|
-
|
|
32
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
33
|
+
sessionId: string | (() => Promise<string>);
|
|
34
|
+
/** The ClientRequestID field is typically populated with the Form ID and is used to link records together - in this case an id validation record to the original form */
|
|
35
|
+
clientRequestID?: string;
|
|
33
36
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
34
37
|
submissionUrl?: string;
|
|
38
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
39
|
+
authUrl?: string;
|
|
40
|
+
/** URL to upload captured documents to via Tus. */
|
|
41
|
+
documentServiceUrl?: string;
|
|
35
42
|
/** Company identifier to include with submission. */
|
|
36
43
|
companyId?: string;
|
|
37
44
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -62,19 +69,25 @@ export interface IdValidationProps extends PropsWithChildren {
|
|
|
62
69
|
webhooksSendProcessedImages?: boolean;
|
|
63
70
|
/** Boolean flag to indicate whether customer-configured webhooks should be invoked upon ID being marked for manual review. */
|
|
64
71
|
webhooksFireOnReview?: boolean;
|
|
72
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
73
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
65
74
|
/** String indicating which ID capture loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
66
75
|
loadingOverlayMode?: IdCaptureLoadingOverlayMode;
|
|
67
76
|
/** String to indicate which types of documents should be captured. Valid values: `idCard`, `passport`, `idCardOrPassport`, `idCardAndPassport`. Default is `idCardOrPassport`. */
|
|
68
77
|
idCaptureRequirement?: IdCaptureRequirementOption;
|
|
78
|
+
/** Boolean to indicate whether the success screen should be shown in after the ID card front is captured, rather than the flip animation. Defaults to `false`. */
|
|
79
|
+
separateIdCardCaptureSequence?: boolean;
|
|
69
80
|
/** Boolean to indicate whether photos should be captured automatically when guidance conditions are met. Default is `true`. */
|
|
70
81
|
idAutoCaptureEnabled?: boolean;
|
|
71
82
|
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for ID cards. Defaults to 0.8. */
|
|
72
83
|
idCardAutoCaptureScoreThreshold?: number;
|
|
73
84
|
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for passports. Defaults to 0.75. */
|
|
74
85
|
passportAutoCaptureScoreThreshold?: number;
|
|
75
|
-
/** Number between 0 and 1 at which
|
|
86
|
+
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for Machine Readable Zones. Defaults to 0.5. */
|
|
87
|
+
mrzDetectionScoreThreshold?: number;
|
|
88
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. Defaults to 0.3. */
|
|
76
89
|
idCardFocusScoreThreshold?: number;
|
|
77
|
-
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. */
|
|
90
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. Defaults to 0.3. */
|
|
78
91
|
passportFocusScoreThreshold?: number;
|
|
79
92
|
/** 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`. */
|
|
80
93
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
@@ -88,8 +101,16 @@ export interface IdValidationProps extends PropsWithChildren {
|
|
|
88
101
|
rotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
89
102
|
/** Number of milliseconds indicating the maximum amount of time that should be spent trying to load the guided capture experience before giving up and resorting to the stock camera instead. Defaults to 45000 (45 seconds). */
|
|
90
103
|
modelLoadTimeoutMs?: number;
|
|
91
|
-
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack
|
|
104
|
+
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack`, `passport`.*/
|
|
92
105
|
precapturedDocuments?: CapturedDocuments;
|
|
106
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
107
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
108
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
109
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
110
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
111
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
112
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
113
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
93
114
|
/** 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. */
|
|
94
115
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
95
116
|
/** 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! */
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import { LangOption } from '../../lib/locales';
|
|
3
3
|
import { SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
4
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
4
5
|
import { VideoSignatureClassNames, VideoSignatureColors, VideoSignatureVerbiage } from '../video_signature_capture/VideoSignatureWizard';
|
|
5
6
|
import { ThemeInput } from '../../themes';
|
|
6
7
|
import { SelfieCaptureLoadingOverlayMode } from '../selfie_capture/SelfieCaptureLoadingOverlay';
|
|
7
8
|
export interface SignatureKYCProps extends PropsWithChildren {
|
|
8
9
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
9
10
|
lang?: LangOption;
|
|
10
|
-
/** A
|
|
11
|
-
|
|
11
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
12
|
+
sessionId: string | (() => Promise<string>);
|
|
13
|
+
/** The ClientRequestID field is typically populated with the Form ID and is used to link records together - in this case an id validation record to the original form */
|
|
14
|
+
clientRequestID?: string;
|
|
12
15
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
13
16
|
submissionUrl?: string;
|
|
17
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
18
|
+
authUrl?: string;
|
|
19
|
+
/** URL to upload captured documents to via Tus. */
|
|
20
|
+
documentServiceUrl?: string;
|
|
21
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
22
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
23
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
24
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
25
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
26
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
27
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
28
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
29
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
30
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
14
31
|
/** 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. */
|
|
15
32
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
16
33
|
/** 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! */
|
|
@@ -27,6 +44,8 @@ export interface SignatureKYCProps extends PropsWithChildren {
|
|
|
27
44
|
loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
28
45
|
/** 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`. */
|
|
29
46
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
47
|
+
/** String containing a base64 image or document service ID pointing to an ID card front image that should be used to match the user's face against. Leave blank to disable face matching. */
|
|
48
|
+
idCardForFaceMatch?: string;
|
|
30
49
|
/** Number of milliseconds indicating the maximum amount of time that should be spent trying to load the guided capture experience before giving up and resorting to the stock camera instead. Defaults to 45000 (45 seconds). */
|
|
31
50
|
modelLoadTimeoutMs?: number;
|
|
32
51
|
/** Name of an included theme or object containing theme properties. **/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import { CardData, LivenessCheckRequest, PersonalData, SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
|
|
3
|
+
import { OnBeforeDocumentUpload, OnDocumentUploaded, OnDocumentUploadFailed, OnDocumentUploadProgress } from '../submission/SubmissionProvider';
|
|
3
4
|
import { CustomerSuppliedVerbiage, LangOption } from '../../lib/locales';
|
|
4
5
|
import { VideoIdWizardAssets, VideoIdWizardClassNames, VideoIdWizardColors, VideoIdWizardVerbiage } from '../video_id/IdVideoCaptureWizard';
|
|
5
6
|
import { IdCaptureWizardProps } from '../id_capture/IdCaptureWizard';
|
|
@@ -29,10 +30,16 @@ export type VideoIdValidationVerbiage = VideoIdWizardVerbiage & {
|
|
|
29
30
|
export interface VideoIdValidationProps extends PropsWithChildren {
|
|
30
31
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
31
32
|
lang?: LangOption;
|
|
32
|
-
/** A
|
|
33
|
-
|
|
33
|
+
/** A session identifier generated with your IDmission credentials. */
|
|
34
|
+
sessionId: string | (() => Promise<string>);
|
|
35
|
+
/** The ClientRequestID field is typically populated with the Form ID and is used to link records together - in this case an id validation record to the original form */
|
|
36
|
+
clientRequestID?: string;
|
|
34
37
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
35
38
|
submissionUrl?: string;
|
|
39
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
40
|
+
authUrl?: string;
|
|
41
|
+
/** URL to upload captured documents to via Tus. */
|
|
42
|
+
documentServiceUrl?: string;
|
|
36
43
|
/** Company identifier to include with submission. */
|
|
37
44
|
companyId?: string;
|
|
38
45
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -63,6 +70,16 @@ export interface VideoIdValidationProps extends PropsWithChildren {
|
|
|
63
70
|
webhooksSendProcessedImages?: boolean;
|
|
64
71
|
/** Boolean flag to indicate whether customer-configured webhooks should be invoked upon ID being marked for manual review. */
|
|
65
72
|
webhooksFireOnReview?: boolean;
|
|
73
|
+
/** Boolean flag to enable download and replace behavior for documents in the Swagger Proxy API. Defaults to false. */
|
|
74
|
+
sendBase64DocumentsInSwaggerProxy?: boolean;
|
|
75
|
+
/** Callback function that fires immediately prior to each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document contents before it is exchanged for a document token. The document content and metadata are passed in as parameters and a promise resolving to void or false should be returned. If the returned promise resolves to false, the document will not be uploaded. */
|
|
76
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
77
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
78
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
79
|
+
/** Callback function that fires immediately after each document upload, giving the client application an opportunity to specify custom asynchronous logic that captures the document token. The document token and metadata are passed in as parameters. */
|
|
80
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
81
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
82
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
66
83
|
/** 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. */
|
|
67
84
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
68
85
|
/** 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! */
|
|
@@ -123,6 +140,8 @@ export interface VideoIdValidationProps extends PropsWithChildren {
|
|
|
123
140
|
idCapturePortraitGuidesOnMobile?: boolean;
|
|
124
141
|
/** Boolean to indicate whether loading overlay image should be rotated on when mobile guides are rotated. Defaults to `true`. */
|
|
125
142
|
idCaptureRotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
143
|
+
/** String containing a base64 image or document service ID pointing to an ID card front image that should be used to match the user's face against. Leave blank to disable face matching. */
|
|
144
|
+
idCardForFaceMatch?: string;
|
|
126
145
|
/** String indicating which face liveness loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
127
146
|
faceLivenessLoadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
128
147
|
/** Boolean to disable face detection during audio capture after X seconds as defined by disableFaceDetectionWhileAudioCaptureMsDelay. Defaults to false. */
|
|
@@ -32,7 +32,7 @@ export type DocumentCaptureState = {
|
|
|
32
32
|
onAllDocumentsUploaded?: OnAllDocumentsUploaded;
|
|
33
33
|
};
|
|
34
34
|
export type DocumentCaptureStateWithActions = DocumentCaptureState & {
|
|
35
|
-
uploadCapturedDocument: (content: Blob) => Promise<void>;
|
|
35
|
+
uploadCapturedDocument: (content: Blob, filetype?: string) => Promise<void>;
|
|
36
36
|
};
|
|
37
37
|
export declare const documentCaptureInitialState: {
|
|
38
38
|
documents: never[];
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { DetectedObjectBox } from '../../lib/models/DocumentDetection';
|
|
2
|
+
export declare const CapturedDocumentTypeValues: readonly ["idCardFront", "idCardBack", "passport", "selfie"];
|
|
3
|
+
export type CapturedDocumentType = (typeof CapturedDocumentTypeValues)[number];
|
|
1
4
|
export type CapturedDocument = {
|
|
2
5
|
imageData: string;
|
|
3
6
|
width: number;
|
|
4
7
|
height: number;
|
|
5
|
-
boundingBox?:
|
|
8
|
+
boundingBox?: DetectedObjectBox;
|
|
9
|
+
documentType: CapturedDocumentType;
|
|
6
10
|
};
|
|
7
|
-
export declare const CapturedDocumentTypeValues: readonly ["idCardFront", "idCardBack", "passport", "selfie"];
|
|
8
|
-
export type CapturedDocumentType = (typeof CapturedDocumentTypeValues)[number];
|
|
9
11
|
export type CapturedDocuments = {
|
|
10
12
|
[k in CapturedDocumentType]?: CapturedDocument;
|
|
11
13
|
};
|