UNPKG

onfido-sdk-ui

Version:

JavaScript SDK view layer for Onfido identity verification

242 lines (241 loc) 11.2 kB
var ErrorCategory; (function (ErrorCategory) { ErrorCategory["Authentication"] = "Authentication"; ErrorCategory["DeviceCapabilities"] = "DeviceCapabilities"; ErrorCategory["General"] = "General"; ErrorCategory["Initialisation"] = "Initialisation"; ErrorCategory["Network"] = "Network"; ErrorCategory["Permissions"] = "Permissions"; ErrorCategory["Processing"] = "Processing"; })(ErrorCategory || (ErrorCategory = {})); export var ErrorType; (function (ErrorType) { ErrorType["BiometricTokenRetrievalException"] = "BiometricTokenRetrievalException"; ErrorType["CameraException"] = "CameraException"; ErrorType["CameraNotDetected"] = "CameraNotDetected"; ErrorType["CrossDeviceDesktopError"] = "CrossDeviceDesktopError"; ErrorType["CrossDeviceRestartError"] = "CrossDeviceRestartError"; ErrorType["CrossDeviceVerificationAbortError"] = "CrossDeviceVerificationAbortError"; ErrorType["CrossDeviceVerificationInvalidError"] = "CrossDeviceVerificationInvalidError"; ErrorType["DuplicateGenericDocument"] = "DuplicateGenericDocument"; ErrorType["DuplicateStep"] = "DuplicateStep"; ErrorType["ExpiredToken"] = "ExpiredToken"; ErrorType["ExpiredTrial"] = "ExpiredTrial"; ErrorType["FeaturesNotAuthorized"] = "FeaturesNotAuthorized"; ErrorType["GenericException"] = "GenericException"; ErrorType["GeoBlocked"] = "GeoBlocked"; ErrorType["InitialisationInvalid"] = "InitialisationInvalid"; ErrorType["InvalidCountryCode"] = "InvalidCountryCode"; ErrorType["InvalidCustomTranslations"] = "InvalidCustomTranslations"; ErrorType["InvalidDocumentFormatAndCountryCombination"] = "InvalidDocumentFormatAndCountryCombination"; ErrorType["InvalidDocumentTitle"] = "InvalidDocumentTitle"; ErrorType["InvalidDocumentTypeException"] = "InvalidDocumentTypeException"; ErrorType["InvalidImageData"] = "InvalidImageData"; ErrorType["InvalidSdkParameter"] = "InvalidSdkParameter"; ErrorType["InvalidToken"] = "InvalidToken"; ErrorType["MissingLogoCobrandingParameter"] = "MissingLogoCobrandingParameter"; ErrorType["MissingSteps"] = "MissingSteps"; ErrorType["ModuleLoadError"] = "ModuleLoadError"; ErrorType["NetworkException"] = "NetworkException"; ErrorType["PermissionsUnavailable"] = "PermissionsUnavailable"; ErrorType["SdkVersionInsufficient"] = "SdkVersionInsufficient"; ErrorType["UnsupportedError"] = "UnsupportedError"; ErrorType["UnsupportedFeatureError"] = "UnsupportedFeatureError"; ErrorType["UploadError"] = "UploadError"; ErrorType["WelcomeMustBeFirstStep"] = "WelcomeMustBeFirstStep"; ErrorType["WorkflowBiometricTokenStorageException"] = "WorkflowBiometricTokenStorageException"; ErrorType["WorkflowInputError"] = "WorkflowInputError"; ErrorType["WorkflowTaskAbandoned"] = "WorkflowTaskAbandoned"; ErrorType["WorkflowTaskError"] = "WorkflowTaskError"; ErrorType["WorkflowVersionMismatch"] = "WorkflowVersionMismatch"; })(ErrorType || (ErrorType = {})); export const BiometricTokenRetrievalException = { type: ErrorType.BiometricTokenRetrievalException, category: ErrorCategory.Processing, message: `Flow error due to inability to retrieve local face authentication token`, }; export const CameraException = { type: ErrorType.CameraException, category: ErrorCategory.DeviceCapabilities, message: `Flow error due to generic camera-related issue`, }; export const CameraNotDetected = { type: ErrorType.CameraNotDetected, category: ErrorCategory.DeviceCapabilities, message: `Flow error due to camera not found`, }; export const CrossDeviceDesktopError = { type: ErrorType.CrossDeviceDesktopError, category: ErrorCategory.Processing, message: `(Mobile cross-device session) Flow error due to desktop session being disconnected`, }; export const CrossDeviceRestartError = { type: ErrorType.CrossDeviceRestartError, category: ErrorCategory.Processing, message: `Generic flow error due to cross-device session becoming invalid`, }; export const CrossDeviceVerificationAbortError = { type: ErrorType.CrossDeviceVerificationAbortError, category: ErrorCategory.Processing, message: `Flow error due to cross-device session being aborted by the user on mobile session`, }; export const CrossDeviceVerificationInvalidError = { type: ErrorType.CrossDeviceVerificationInvalidError, category: ErrorCategory.Processing, message: `(Mobile cross-device session) Flow error due to user selecting incorrect verification code`, }; export const DuplicateGenericDocument = { type: ErrorType.DuplicateGenericDocument, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to a duplicate generic document definition provided in the document step configuration`, }; export const DuplicateStep = { type: ErrorType.DuplicateStep, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to duplicate declaration in 'steps'`, }; export const ExpiredToken = { type: ErrorType.ExpiredToken, category: ErrorCategory.Authentication, message: `Flow cannot be initiated due to expired authentication token`, }; export const ExpiredTrial = { type: ErrorType.ExpiredTrial, category: ErrorCategory.Authentication, message: `Flow error due to expired account (or exceeded trial attempts)`, }; export const FeaturesNotAuthorized = { type: ErrorType.FeaturesNotAuthorized, category: ErrorCategory.Initialisation, message: `The flow cannot be initialised as selected feature is not authorised for this account. Please talk to Customer Support to get this feature enabled`, }; export const GenericException = { type: ErrorType.GenericException, category: ErrorCategory.General, message: `Generic flow error due to unknown error type`, }; export const GeoBlocked = { type: ErrorType.GeoBlocked, category: ErrorCategory.General, message: `Flow error due to request coming from geo-blocked country`, }; export const InitialisationInvalid = { type: ErrorType.InitialisationInvalid, category: ErrorCategory.Initialisation, message: `Generic flow initialisation error`, }; export const InvalidCountryCode = { type: ErrorType.InvalidCountryCode, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to an invalid country code provided in the document step configuration`, }; export const InvalidCustomTranslations = { type: ErrorType.InvalidCustomTranslations, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to an invalid translation key being provided`, }; export const InvalidDocumentFormatAndCountryCombination = { type: ErrorType.InvalidDocumentFormatAndCountryCombination, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to an invalid country code / document type combination being provided in the document step configuration`, }; export const InvalidDocumentTitle = { type: ErrorType.InvalidDocumentTitle, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to an invalid generic document title provided in the document step configuration`, }; export const InvalidDocumentTypeException = { type: ErrorType.InvalidDocumentTypeException, category: ErrorCategory.Initialisation, message: `DocumentType.UNKNOWN should not be used.`, }; export const InvalidImageData = { type: ErrorType.InvalidImageData, category: ErrorCategory.Processing, message: `Flow error due to error in image compression or on-device processing`, }; export const InvalidSdkParameter = { type: ErrorType.InvalidSdkParameter, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to invalid initialisation parameters`, }; export const InvalidToken = { type: ErrorType.InvalidToken, category: ErrorCategory.Authentication, message: `Flow cannot be initiated due invalid authentication token`, }; export const MissingLogoCobrandingParameter = { type: ErrorType.MissingLogoCobrandingParameter, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised as logo cobranding requires both a light and dark mode logo image`, }; export const MissingSteps = { type: ErrorType.MissingSteps, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to empty 'steps' declaration`, }; export const ModuleLoadError = { type: ErrorType.ModuleLoadError, category: ErrorCategory.Processing, message: `The module encountered an error while loading`, }; export const NetworkException = { type: ErrorType.NetworkException, category: ErrorCategory.Network, message: `Generic flow error due to network issue`, }; export const PermissionsUnavailable = { type: ErrorType.PermissionsUnavailable, category: ErrorCategory.Permissions, message: `Flow error due to SDK not being able to assess permissions (webview context)`, }; export const SdkVersionInsufficient = { type: ErrorType.SdkVersionInsufficient, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to invalid SDK version`, }; export const UnsupportedError = { type: ErrorType.UnsupportedError, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to a selected module not being supported (environment or client)`, }; export const UnsupportedFeatureError = { type: ErrorType.UnsupportedFeatureError, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to a selected feature not being supported (environment or client)`, }; export const UploadError = { type: ErrorType.UploadError, category: ErrorCategory.Network, message: `Flow error due to failed media upload`, }; export const WelcomeMustBeFirstStep = { type: ErrorType.WelcomeMustBeFirstStep, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised if 'Welcome' step is present but not first in the list of steps`, }; export const WorkflowBiometricTokenStorageException = { type: ErrorType.WorkflowBiometricTokenStorageException, category: ErrorCategory.Processing, message: `Flow error due to inability to store local face authentication token`, }; export const WorkflowInputError = { type: ErrorType.WorkflowInputError, category: ErrorCategory.Initialisation, message: `Flow error due to invalid or missing inputs provided as part of the workflow initialisation`, }; export const WorkflowTaskAbandoned = { type: ErrorType.WorkflowTaskAbandoned, category: ErrorCategory.Processing, message: `Flow error due to workflow already been completed or expired`, }; export const WorkflowTaskError = { type: ErrorType.WorkflowTaskError, category: ErrorCategory.Processing, message: `Flow error due to generic workflow error`, }; export const WorkflowVersionMismatch = { type: ErrorType.WorkflowVersionMismatch, category: ErrorCategory.Initialisation, message: `Flow cannot be initialised due to target workflow requiring a higher version of the SDK`, };