UNPKG

@nevis-security/nevis-mobile-authentication-sdk-react

Version:

React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.

46 lines (44 loc) 2.51 kB
"use strict"; /** * Copyright © 2023 Nevis Security AG. All rights reserved. */ import { PinChangeDeviceProtectionError } from "./PinChangeDeviceProtectionError.js"; import { PinChangeNoDeviceLockError } from "./PinChangeNoDeviceLockError.js"; import { PinChangePinLocked } from "./PinChangePinLocked.js"; import { PinChangePinNotEnrolled } from "./PinChangePinNotEnrolled.js"; import { PinChangeUnknownError } from "./PinChangeUnknownError.js"; import { PinChangeUserCanceled } from "./PinChangeUserCanceled.js"; import { PinChangeUserNotResponsive } from "./PinChangeUserNotResponsive.js"; import { ErrorConverter } from "../../ErrorConverter.js"; var PinChangeErrorType = /*#__PURE__*/function (PinChangeErrorType) { PinChangeErrorType[PinChangeErrorType["DeviceProtectionError"] = 0] = "DeviceProtectionError"; PinChangeErrorType[PinChangeErrorType["NoDeviceLockError"] = 1] = "NoDeviceLockError"; PinChangeErrorType[PinChangeErrorType["PinLocked"] = 2] = "PinLocked"; PinChangeErrorType[PinChangeErrorType["PinNotEnrolled"] = 3] = "PinNotEnrolled"; PinChangeErrorType[PinChangeErrorType["Unknown"] = 4] = "Unknown"; PinChangeErrorType[PinChangeErrorType["UserCanceled"] = 5] = "UserCanceled"; PinChangeErrorType[PinChangeErrorType["UserNotResponsive"] = 6] = "UserNotResponsive"; return PinChangeErrorType; }(PinChangeErrorType || {}); export class PinChangeErrorConverter extends ErrorConverter { convert() { const subtype = PinChangeErrorType[this.error.type]; switch (subtype) { case PinChangeErrorType.DeviceProtectionError: return new PinChangeDeviceProtectionError(this.error.description, this.error.cause); case PinChangeErrorType.NoDeviceLockError: return new PinChangeNoDeviceLockError(this.error.description, this.error.cause); case PinChangeErrorType.PinLocked: return new PinChangePinLocked(this.error.description, this.error.cause); case PinChangeErrorType.PinNotEnrolled: return new PinChangePinNotEnrolled(this.error.description, this.error.cause); case PinChangeErrorType.Unknown: return new PinChangeUnknownError(this.error.description, this.error.cause); case PinChangeErrorType.UserCanceled: return new PinChangeUserCanceled(this.error.description, this.error.cause); case PinChangeErrorType.UserNotResponsive: return new PinChangeUserNotResponsive(this.error.description, this.error.cause); } } } //# sourceMappingURL=PinChangeErrorConverter.js.map