idmission-web-sdk 1.0.293 → 1.0.294
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CompositeWizard.d.ts +3 -3
- package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts +15 -2
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +15 -2
- 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 +15 -2
- package/dist/components/customer_flows/IdValidation.d.ts +15 -2
- 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/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 +837 -566
- 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 +837 -569
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +840 -570
- 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/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,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { IdCaptureWizardProps } from './id_capture/IdCaptureWizard';
|
|
3
3
|
import { FaceLivenessWizardProps } from './face_liveness/FaceLivenessWizard';
|
|
4
|
-
import { SubmissionAction,
|
|
4
|
+
import { SubmissionAction, SubmissionResponse } from '../contexts/SubmissionContext';
|
|
5
5
|
import { AdditionalDocumentCaptureWizardProps } from './additional_document_capture/AdditionalDocumentCaptureWizard';
|
|
6
6
|
import { SignatureCaptureProps } from './signature_capture/SignatureCapture';
|
|
7
7
|
import { VideoSignatureWizardProps } from './video_signature_capture/VideoSignatureWizard';
|
|
@@ -20,10 +20,10 @@ export type CompositeWizardComponentProps = {
|
|
|
20
20
|
debugMode?: boolean;
|
|
21
21
|
};
|
|
22
22
|
export type CompositeWizardProps = CompositeWizardComponentProps & {
|
|
23
|
-
|
|
23
|
+
sessionId: string;
|
|
24
24
|
submissionAction?: SubmissionAction;
|
|
25
|
-
submissionEnvironment?: SubmissionEnvironment;
|
|
26
25
|
submissionUrl?: string;
|
|
26
|
+
authUrl?: string;
|
|
27
27
|
onComplete?: (submissionResponse: SubmissionResponse) => void;
|
|
28
28
|
};
|
|
29
29
|
export declare const CompositeWizard: (props: CompositeWizardProps) => ReactElement;
|
|
@@ -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. */
|
|
@@ -60,6 +65,14 @@ export interface CustomerBiometricsEnrollmentProps extends PropsWithChildren {
|
|
|
60
65
|
timeoutDurationMs?: number;
|
|
61
66
|
/** 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`. */
|
|
62
67
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
68
|
+
/** 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. */
|
|
69
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
70
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
71
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
72
|
+
/** 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. */
|
|
73
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
74
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
75
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
63
76
|
/** 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. */
|
|
64
77
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
65
78
|
/** 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. */
|
|
@@ -110,6 +115,14 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
|
|
|
110
115
|
idCapturePortraitGuidesOnMobile?: boolean;
|
|
111
116
|
/** Boolean to indicate whether loading overlay image should be rotated on when mobile guides are rotated. Defaults to `true`. */
|
|
112
117
|
idCaptureRotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
118
|
+
/** 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. */
|
|
119
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
120
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
121
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
122
|
+
/** 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. */
|
|
123
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
124
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
125
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
113
126
|
/** 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. */
|
|
114
127
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
115
128
|
/** 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. */
|
|
@@ -31,6 +36,14 @@ export interface CustomerIdentificationProps extends PropsWithChildren {
|
|
|
31
36
|
timeoutDurationMs?: number;
|
|
32
37
|
/** 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`. */
|
|
33
38
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
39
|
+
/** 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. */
|
|
40
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
41
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
42
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
43
|
+
/** 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. */
|
|
44
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
45
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
46
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
34
47
|
/** 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. */
|
|
35
48
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
36
49
|
/** 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. */
|
|
@@ -43,6 +48,14 @@ export interface CustomerVerificationProps extends PropsWithChildren {
|
|
|
43
48
|
colors?: CustomerVerificationColors;
|
|
44
49
|
/** Object containing any verbiage overrides. */
|
|
45
50
|
verbiage?: CustomerVerificationVerbiage;
|
|
51
|
+
/** 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. */
|
|
52
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
53
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
54
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
55
|
+
/** 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. */
|
|
56
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
57
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
58
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
46
59
|
/** 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. */
|
|
47
60
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
48
61
|
/** 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. */
|
|
@@ -35,6 +40,16 @@ export interface FaceValidationProps extends PropsWithChildren {
|
|
|
35
40
|
timeoutDurationMs?: number;
|
|
36
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`. */
|
|
37
42
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
43
|
+
/** 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. */
|
|
44
|
+
idCardForFaceMatch?: string;
|
|
45
|
+
/** 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. */
|
|
46
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
47
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
48
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
49
|
+
/** 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. */
|
|
50
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
51
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
52
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
38
53
|
/** 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. */
|
|
39
54
|
onBeforeSubmit?: (req: LivenessCheckRequest) => Promise<LivenessCheckRequest>;
|
|
40
55
|
/** 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. */
|
|
@@ -107,6 +112,14 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
|
|
|
107
112
|
idCapturePortraitGuidesOnMobile?: boolean;
|
|
108
113
|
/** Boolean to indicate whether loading overlay image should be rotated on when mobile guides are rotated. Defaults to `true`. */
|
|
109
114
|
idCaptureRotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
115
|
+
/** 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. */
|
|
116
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
117
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
118
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
119
|
+
/** 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. */
|
|
120
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
121
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
122
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
110
123
|
/** 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. */
|
|
111
124
|
onBeforeLivenessCheck?: (req: LivenessCheckRequest) => Promise<LivenessCheckRequest>;
|
|
112
125
|
/** 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. */
|
|
@@ -88,6 +93,14 @@ export interface IdValidationProps extends PropsWithChildren {
|
|
|
88
93
|
rotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
89
94
|
/** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack , `passport`.*/
|
|
90
95
|
precapturedDocuments?: CapturedDocuments;
|
|
96
|
+
/** 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. */
|
|
97
|
+
onBeforeDocumentUpload?: OnBeforeDocumentUpload;
|
|
98
|
+
/** Callback function that fires when progress information is available for a document upload. The progress info and metadata are passed in as parameters. */
|
|
99
|
+
onDocumentUploadProgress?: OnDocumentUploadProgress;
|
|
100
|
+
/** 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. */
|
|
101
|
+
onDocumentUploaded?: OnDocumentUploaded;
|
|
102
|
+
/** Callback function that fires when a document failed to upload. The error and metadata are passed in as parameters. */
|
|
103
|
+
onDocumentUploadFailed?: OnDocumentUploadFailed;
|
|
91
104
|
/** 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. */
|
|
92
105
|
onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
|
|
93
106
|
/** 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! */
|
|
@@ -23,6 +36,8 @@ export interface SignatureKYCProps extends PropsWithChildren {
|
|
|
23
36
|
loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
24
37
|
/** 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`. */
|
|
25
38
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
39
|
+
/** 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. */
|
|
40
|
+
idCardForFaceMatch?: string;
|
|
26
41
|
/** Name of an included theme or object containing theme properties. **/
|
|
27
42
|
theme?: ThemeInput;
|
|
28
43
|
/** Object containing any classNames for inner components. **/
|
|
@@ -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! */
|
|
@@ -115,6 +128,8 @@ export interface VideoIdValidationProps extends PropsWithChildren {
|
|
|
115
128
|
idCapturePortraitGuidesOnMobile?: boolean;
|
|
116
129
|
/** Boolean to indicate whether loading overlay image should be rotated on when mobile guides are rotated. Defaults to `true`. */
|
|
117
130
|
idCaptureRotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
131
|
+
/** 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. */
|
|
132
|
+
idCardForFaceMatch?: string;
|
|
118
133
|
/** String indicating which face liveness loading overlay screen should be used. Supported values: 'default' and 'legacy'. Defaults to 'default'. */
|
|
119
134
|
faceLivenessLoadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
120
135
|
/** Name of an included theme or object containing theme properties. **/
|
|
@@ -29,7 +29,7 @@ export type DocumentCaptureState = {
|
|
|
29
29
|
onAllDocumentsUploaded?: OnAllDocumentsUploaded;
|
|
30
30
|
};
|
|
31
31
|
export type DocumentCaptureStateWithActions = DocumentCaptureState & {
|
|
32
|
-
uploadCapturedDocument: (content: Blob) => Promise<void>;
|
|
32
|
+
uploadCapturedDocument: (content: Blob, filetype?: string) => Promise<void>;
|
|
33
33
|
};
|
|
34
34
|
export declare const documentCaptureInitialState: {
|
|
35
35
|
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;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { Dispatch, ReactNode } from 'react';
|
|
2
|
+
import { SessionValidationFailedError } from '../components/submission/Errors';
|
|
3
|
+
export declare const defaultAuthUrl = "https://portal-api.idmission.com";
|
|
4
|
+
export declare const allowedAuthUrls: string[];
|
|
5
|
+
export type SessionCheckState = 'READY' | 'RUNNING' | 'PASSED' | 'FAILED' | 'MISSING' | 'AUTH_URL_NOT_ALLOWED' | 'ERROR';
|
|
6
|
+
export type AuthState = {
|
|
7
|
+
authUrl: string;
|
|
8
|
+
sessionCheckState: SessionCheckState;
|
|
9
|
+
sessionId?: string;
|
|
10
|
+
authError?: SessionValidationFailedError;
|
|
11
|
+
};
|
|
12
|
+
export declare const AuthStateContext: React.Context<AuthState>;
|
|
13
|
+
export type AuthAction = {
|
|
14
|
+
type: 'setSessionId';
|
|
15
|
+
payload: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'setCheckState';
|
|
18
|
+
payload: SessionCheckState;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'setError';
|
|
21
|
+
payload: SessionValidationFailedError;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'retry';
|
|
24
|
+
};
|
|
25
|
+
export type AuthDispatch = Dispatch<AuthAction>;
|
|
26
|
+
export declare const AuthDispatchContext: React.Context<AuthDispatch>;
|
|
27
|
+
export declare function useAuthReducer(authUrl?: string, sessionId?: string | (() => Promise<string>)): [AuthState, AuthDispatch];
|
|
28
|
+
export declare function useAuthContext(): [AuthState, AuthDispatch];
|
|
29
|
+
export declare function AuthProvider({ authUrl, sessionId, children, }: {
|
|
30
|
+
authUrl?: string;
|
|
31
|
+
sessionId: string | (() => Promise<string>);
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}): React.JSX.Element;
|