idmission-web-sdk 1.0.310 → 1.0.312
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 +122 -46
- package/dist/components/CompositeWizard.d.ts +3 -3
- package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts +15 -2
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +17 -4
- package/dist/components/customer_flows/CustomerIdentification.d.ts +15 -2
- package/dist/components/customer_flows/CustomerVerification.d.ts +15 -2
- package/dist/components/customer_flows/DocumentCapture.d.ts +15 -6
- package/dist/components/customer_flows/FaceValidation.d.ts +17 -2
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts +18 -5
- package/dist/components/customer_flows/IdValidation.d.ts +18 -5
- package/dist/components/customer_flows/SignatureKYC.d.ts +17 -2
- package/dist/components/customer_flows/VideoIdValidation.d.ts +17 -2
- package/dist/components/document_capture/DocumentCaptureStateProvider.d.ts +1 -1
- 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 +24 -5
- package/dist/components/video_id/IdVideoCaptureGuides.d.ts +166 -163
- package/dist/contexts/AuthStateContext.d.ts +33 -0
- package/dist/contexts/SubmissionContext.d.ts +9 -3
- package/dist/index.d.ts +7 -1
- package/dist/lib/utils/dataUrlToBase64.d.ts +2 -0
- package/dist/sdk2.cjs.development.js +864 -594
- 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 +864 -597
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +867 -598
- 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/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 +5 -1
- package/dist/stories/CustomerFlows/IdValidation.stories.d.ts +5 -1
- package/dist/stories/CustomerFlows/SignatureKYC.stories.d.ts +5 -1
- package/dist/stories/CustomerFlows/VideoIdValidation.stories.d.ts +14 -1
- package/dist/stories/utils/sessions.d.ts +13 -0
- package/dist/stories/utils/useLocalStorage.d.ts +1 -0
- package/dist/themes/index.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- 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
|
@@ -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. */
|
|
@@ -92,9 +97,9 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
|
|
|
92
97
|
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 focus guidance score condition is considered to be met for ID cards. */
|
|
100
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. Defaults to 0.3. */
|
|
96
101
|
idCardFocusScoreThreshold?: number;
|
|
97
|
-
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. */
|
|
102
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. Defaults to 0.3. */
|
|
98
103
|
passportFocusScoreThreshold?: number;
|
|
99
104
|
/** String indicating which face liveness loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
100
105
|
faceLivenessLoadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
@@ -114,6 +119,14 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
|
|
|
114
119
|
idCaptureModelLoadTimeoutMs?: number;
|
|
115
120
|
/** 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
121
|
selfieCaptureModelLoadTimeoutMs?: number;
|
|
122
|
+
/** 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. */
|
|
123
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
124
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
125
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
126
|
+
/** 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. */
|
|
127
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
128
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
129
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
117
130
|
/** 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
131
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
119
132
|
/** 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. */
|
|
@@ -33,6 +38,14 @@ export interface CustomerIdentificationProps extends PropsWithChildren {
|
|
|
33
38
|
modelLoadTimeoutMs?: number;
|
|
34
39
|
/** 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
40
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
41
|
+
/** 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. */
|
|
42
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
43
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
44
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
45
|
+
/** 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. */
|
|
46
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
47
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
48
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
36
49
|
/** 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
50
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
38
51
|
/** 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. */
|
|
@@ -45,6 +50,14 @@ export interface CustomerVerificationProps extends PropsWithChildren {
|
|
|
45
50
|
colors?: CustomerVerificationColors;
|
|
46
51
|
/** Object containing any verbiage overrides. */
|
|
47
52
|
verbiage?: CustomerVerificationVerbiage;
|
|
53
|
+
/** 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. */
|
|
54
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
55
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
56
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
57
|
+
/** 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. */
|
|
58
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
59
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
60
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
48
61
|
/** 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
62
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
50
63
|
/** 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,33 @@
|
|
|
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
|
-
/** Callback function that fires
|
|
19
|
-
|
|
20
|
-
/** Callback function that fires when
|
|
21
|
+
/** 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. */
|
|
22
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
23
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
24
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
25
|
+
/** 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
26
|
onDocumentUploaded?: OnDocumentUploaded;
|
|
27
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
28
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
29
|
+
/** 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. */
|
|
30
|
+
onComplete?: OnAllDocumentsUploaded;
|
|
22
31
|
/** Callback function that fires when the user clicks the exit button during ID or selfie capture. */
|
|
23
32
|
onExitCapture?: () => void;
|
|
24
33
|
/** 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. */
|
|
@@ -37,6 +42,16 @@ export interface FaceValidationProps extends PropsWithChildren {
|
|
|
37
42
|
modelLoadTimeoutMs?: number;
|
|
38
43
|
/** 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
44
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
45
|
+
/** 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. */
|
|
46
|
+
idCardForFaceMatch?: string;
|
|
47
|
+
/** 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. */
|
|
48
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
49
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
50
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
51
|
+
/** 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. */
|
|
52
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
53
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
54
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
40
55
|
/** 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
56
|
onBeforeSubmit?: (req: LivenessCheckRequest) => Promise<LivenessCheckRequest>;
|
|
42
57
|
/** 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,7 @@ 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
|
-
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack
|
|
81
|
+
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack`, `passport`. */
|
|
77
82
|
precapturedDocuments?: CapturedDocuments & {
|
|
78
83
|
selfie: CapturedDocument;
|
|
79
84
|
};
|
|
@@ -89,9 +94,9 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
|
|
|
89
94
|
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 focus guidance score condition is considered to be met for ID cards. */
|
|
97
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. Defaults to 0.3. */
|
|
93
98
|
idCardFocusScoreThreshold?: number;
|
|
94
|
-
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. */
|
|
99
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. Defaults to 0.3. */
|
|
95
100
|
passportFocusScoreThreshold?: number;
|
|
96
101
|
/** String indicating which face liveness loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
97
102
|
faceLivenessLoadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
@@ -111,6 +116,14 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
|
|
|
111
116
|
idCaptureModelLoadTimeoutMs?: number;
|
|
112
117
|
/** 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
118
|
selfieCaptureModelLoadTimeoutMs?: number;
|
|
119
|
+
/** 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. */
|
|
120
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
121
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
122
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
123
|
+
/** 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. */
|
|
124
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
125
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
126
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
114
127
|
/** 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
128
|
onBeforeLivenessCheck?: (req: LivenessCheckRequest) => Promise<LivenessCheckRequest>;
|
|
116
129
|
/** 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,14 @@ 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>);
|
|
33
34
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
34
35
|
submissionUrl?: string;
|
|
36
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
37
|
+
authUrl?: string;
|
|
38
|
+
/** URL to upload captured documents to via Tus. */
|
|
39
|
+
documentServiceUrl?: string;
|
|
35
40
|
/** Company identifier to include with submission. */
|
|
36
41
|
companyId?: string;
|
|
37
42
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -72,9 +77,9 @@ export interface IdValidationProps extends PropsWithChildren {
|
|
|
72
77
|
idCardAutoCaptureScoreThreshold?: number;
|
|
73
78
|
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for passports. Defaults to 0.75. */
|
|
74
79
|
passportAutoCaptureScoreThreshold?: number;
|
|
75
|
-
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. */
|
|
80
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for ID cards. Defaults to 0.3. */
|
|
76
81
|
idCardFocusScoreThreshold?: number;
|
|
77
|
-
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. */
|
|
82
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for passports. Defaults to 0.3. */
|
|
78
83
|
passportFocusScoreThreshold?: number;
|
|
79
84
|
/** 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
85
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
@@ -88,8 +93,16 @@ export interface IdValidationProps extends PropsWithChildren {
|
|
|
88
93
|
rotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
89
94
|
/** 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
95
|
modelLoadTimeoutMs?: number;
|
|
91
|
-
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack
|
|
96
|
+
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack`, `passport`.*/
|
|
92
97
|
precapturedDocuments?: CapturedDocuments;
|
|
98
|
+
/** 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. */
|
|
99
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
100
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
101
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
102
|
+
/** 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. */
|
|
103
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
104
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
105
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
93
106
|
/** 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
107
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
95
108
|
/** 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,29 @@
|
|
|
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>);
|
|
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;
|
|
19
|
+
/** 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. */
|
|
20
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
21
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
22
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
23
|
+
/** 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. */
|
|
24
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
25
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
26
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
14
27
|
/** 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
28
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
16
29
|
/** 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! */
|
|
@@ -25,6 +38,8 @@ export interface SignatureKYCProps extends PropsWithChildren {
|
|
|
25
38
|
loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
26
39
|
/** 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`. */
|
|
27
40
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
41
|
+
/** 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. */
|
|
42
|
+
idCardForFaceMatch?: string;
|
|
28
43
|
/** 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). */
|
|
29
44
|
modelLoadTimeoutMs?: number;
|
|
30
45
|
/** 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,14 @@ 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>);
|
|
34
35
|
/** URL to hit with all API requests. Defaults to the value specified in your decoded `submissionToken`. */
|
|
35
36
|
submissionUrl?: string;
|
|
37
|
+
/** URL to validate session against. Defaults to https://portal-api.idmission.com. */
|
|
38
|
+
authUrl?: string;
|
|
39
|
+
/** URL to upload captured documents to via Tus. */
|
|
40
|
+
documentServiceUrl?: string;
|
|
36
41
|
/** Company identifier to include with submission. */
|
|
37
42
|
companyId?: string;
|
|
38
43
|
/** Boolean flag to indicate if validation of the minimum resolution for an ID document image should be triggered. Defaults to true. */
|
|
@@ -63,6 +68,14 @@ export interface VideoIdValidationProps extends PropsWithChildren {
|
|
|
63
68
|
webhooksSendProcessedImages?: boolean;
|
|
64
69
|
/** Boolean flag to indicate whether customer-configured webhooks should be invoked upon ID being marked for manual review. */
|
|
65
70
|
webhooksFireOnReview?: boolean;
|
|
71
|
+
/** 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. */
|
|
72
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
73
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
74
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
75
|
+
/** 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. */
|
|
76
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
77
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
78
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
66
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. */
|
|
67
80
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
68
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! */
|
|
@@ -117,6 +130,8 @@ export interface VideoIdValidationProps extends PropsWithChildren {
|
|
|
117
130
|
idCapturePortraitGuidesOnMobile?: boolean;
|
|
118
131
|
/** Boolean to indicate whether loading overlay image should be rotated on when mobile guides are rotated. Defaults to `true`. */
|
|
119
132
|
idCaptureRotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
133
|
+
/** 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. */
|
|
134
|
+
idCardForFaceMatch?: string;
|
|
120
135
|
/** String indicating which face liveness loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
121
136
|
faceLivenessLoadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
122
137
|
/** Name of an included theme or object containing theme properties. **/
|
|
@@ -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[];
|
|
@@ -5,7 +5,7 @@ export declare class SubmissionError extends Error {
|
|
|
5
5
|
}
|
|
6
6
|
export declare class NetworkError extends Error {
|
|
7
7
|
}
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class SessionValidationFailedError extends Error {
|
|
9
9
|
err: Error;
|
|
10
10
|
host: string;
|
|
11
11
|
constructor(err: Error, host: string);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SessionValidationFailedError } from './Errors';
|
|
3
|
+
export declare const SessionValidationErrorOverlay: ({ error, onRetry, }: {
|
|
4
|
+
error: SessionValidationFailedError | null;
|
|
5
|
+
onRetry?: (() => void) | undefined;
|
|
6
|
+
}) => React.JSX.Element;
|
|
@@ -4,7 +4,22 @@ import { UploadedDocument } from '../additional_document_capture/AdditionalDocum
|
|
|
4
4
|
import { SignatureData } from '../signature_capture/data';
|
|
5
5
|
import { NetworkError, SubmissionError } from './Errors';
|
|
6
6
|
import { CapturedDocuments } from '../id_capture/CapturedDocuments';
|
|
7
|
-
export
|
|
7
|
+
export declare const defaultSubmissionUrl = "https://portal-api.idmission.com/swagger";
|
|
8
|
+
export declare const defaultDocumentServiceUrl = "https://portal-api.idmission.com/files/";
|
|
9
|
+
export type DocumentMetadata = {
|
|
10
|
+
filename?: string;
|
|
11
|
+
filetype?: string;
|
|
12
|
+
};
|
|
13
|
+
export type DocumentUploadProgressEvent = {
|
|
14
|
+
bytesUploaded: number;
|
|
15
|
+
bytesTotal: number;
|
|
16
|
+
percentage: string;
|
|
17
|
+
metadata?: DocumentMetadata;
|
|
18
|
+
};
|
|
19
|
+
export type OnBeforeDocumentUpload = (content: Blob, metadata?: DocumentMetadata) => Promise<void | false>;
|
|
20
|
+
export type OnDocumentUploadProgress = (event: DocumentUploadProgressEvent) => void;
|
|
21
|
+
export type OnDocumentUploaded = (documentId: string, metadata?: DocumentMetadata) => Promise<void>;
|
|
22
|
+
export type OnDocumentUploadFailed = (error: Error, metadata?: DocumentMetadata) => void;
|
|
8
23
|
export type SubmissionState = {
|
|
9
24
|
submit: () => Promise<SubmissionResponse | null>;
|
|
10
25
|
submissionStatus: SubmissionStatus;
|
|
@@ -32,7 +47,7 @@ export type SubmissionState = {
|
|
|
32
47
|
setIdCaptureVideoIdFrontImage: (image: string) => void;
|
|
33
48
|
setIdCaptureVideoIdBackImage: (image: string) => void;
|
|
34
49
|
setAdditionalDocuments: (uploadedDocuments: UploadedDocument[]) => void;
|
|
35
|
-
uploadDocument: (blob: Blob) => Promise<string>;
|
|
50
|
+
uploadDocument: (blob: Blob, metadata?: DocumentMetadata) => Promise<string>;
|
|
36
51
|
logIdFrontCaptureAttempt: (attempt: CaptureAttemptMetadata) => void;
|
|
37
52
|
logIdBackCaptureAttempt: (attempt: CaptureAttemptMetadata) => void;
|
|
38
53
|
logSelfieCaptureAttempt: (attempt: CaptureAttemptMetadata) => void;
|
|
@@ -44,8 +59,7 @@ export declare const SubmissionContext: React.Context<SubmissionState>;
|
|
|
44
59
|
export type SubmissionProviderProps = {
|
|
45
60
|
action: SubmissionAction;
|
|
46
61
|
children: ReactElement;
|
|
47
|
-
|
|
48
|
-
url?: string;
|
|
62
|
+
submissionUrl?: string;
|
|
49
63
|
environment?: SubmissionEnvironment;
|
|
50
64
|
companyId?: string;
|
|
51
65
|
enrollmentId?: string;
|
|
@@ -60,6 +74,7 @@ export type SubmissionProviderProps = {
|
|
|
60
74
|
verifyIdWithExternalDatabases?: boolean;
|
|
61
75
|
deduplicationEnabled?: boolean;
|
|
62
76
|
deduplicationSynchronous?: boolean;
|
|
77
|
+
idCardForFaceMatch?: string;
|
|
63
78
|
geolocationEnabled?: boolean;
|
|
64
79
|
geolocationRequired?: boolean;
|
|
65
80
|
webhooksEnabled?: boolean;
|
|
@@ -73,7 +88,11 @@ export type SubmissionProviderProps = {
|
|
|
73
88
|
onSubmit?: (payload: SubmissionRequest) => void;
|
|
74
89
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
75
90
|
onBeforeLivenessCheck?: (req: LivenessCheckRequest) => Promise<LivenessCheckRequest>;
|
|
91
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
92
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
93
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
94
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
76
95
|
onResponseReceived?: (res: SubmissionResponse, req: SubmissionRequest) => void;
|
|
77
96
|
onRequestFailure?: (err: Error) => void;
|
|
78
97
|
};
|
|
79
|
-
export declare const SubmissionProvider: ({ action, children,
|
|
98
|
+
export declare const SubmissionProvider: ({ action, children, submissionUrl, environment, companyId, enrollmentId, personalData, cardData, bypassAgeValidation, bypassNameMatching, needImmediateResponse, manualReviewRequired, idBackImageRequired, idImageResolutionCheck, verifyIdWithExternalDatabases, deduplicationEnabled, deduplicationSynchronous, idCardForFaceMatch, geolocationEnabled, geolocationRequired, webhooksEnabled, webhooksClientTraceId, webhooksStripSpecialCharacters, webhooksSendInputImages, webhooksSendProcessedImages, webhooksFireOnReview, precapturedDocuments, documentServiceUrl, onSubmit, onBeforeSubmit, onBeforeLivenessCheck, onBeforeDocumentUpload, onDocumentUploadProgress, onDocumentUploaded, onDocumentUploadFailed, onResponseReceived, onRequestFailure, }: SubmissionProviderProps) => ReactElement;
|