UNPKG

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

Version:

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

55 lines (54 loc) 4.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PendingOutOfBandOperationsErrorConverter = void 0; var _PendingOutOfBandOperationsClockSkewTooBig = require("./PendingOutOfBandOperationsClockSkewTooBig"); var _PendingOutOfBandOperationsDeviceProtectionError = require("./PendingOutOfBandOperationsDeviceProtectionError"); var _PendingOutOfBandOperationsNetworkError = require("./PendingOutOfBandOperationsNetworkError"); var _PendingOutOfBandOperationsNoDeviceLockError = require("./PendingOutOfBandOperationsNoDeviceLockError"); var _PendingOutOfBandOperationsOperationNotSupportedByBackendError = require("./PendingOutOfBandOperationsOperationNotSupportedByBackendError"); var _PendingOutOfBandOperationsUnknownError = require("./PendingOutOfBandOperationsUnknownError"); var _ErrorConverter = require("../../ErrorConverter"); /** * Copyright © 2024 Nevis Security AG. All rights reserved. */ var PendingOutOfBandOperationsErrorType = /*#__PURE__*/function (PendingOutOfBandOperationsErrorType) { PendingOutOfBandOperationsErrorType[PendingOutOfBandOperationsErrorType["ClockSkewTooBig"] = 0] = "ClockSkewTooBig"; PendingOutOfBandOperationsErrorType[PendingOutOfBandOperationsErrorType["DeviceProtectionError"] = 1] = "DeviceProtectionError"; PendingOutOfBandOperationsErrorType[PendingOutOfBandOperationsErrorType["NetworkError"] = 2] = "NetworkError"; PendingOutOfBandOperationsErrorType[PendingOutOfBandOperationsErrorType["NoDeviceLockError"] = 3] = "NoDeviceLockError"; PendingOutOfBandOperationsErrorType[PendingOutOfBandOperationsErrorType["OperationNotSupportedByBackend"] = 4] = "OperationNotSupportedByBackend"; PendingOutOfBandOperationsErrorType[PendingOutOfBandOperationsErrorType["Unknown"] = 5] = "Unknown"; return PendingOutOfBandOperationsErrorType; }(PendingOutOfBandOperationsErrorType || {}); class PendingOutOfBandOperationsErrorConverter extends _ErrorConverter.ErrorConverter { convert() { const subType = PendingOutOfBandOperationsErrorType[this.error.type]; switch (subType) { case PendingOutOfBandOperationsErrorType.ClockSkewTooBig: if (this.error.server) { return new _PendingOutOfBandOperationsClockSkewTooBig.PendingOutOfBandOperationsClockSkewTooBig(this.error.server, this.error.description, this.error.cause); } return new _PendingOutOfBandOperationsUnknownError.PendingOutOfBandOperationsUnknownError(this.error.description, this.error.cause); case PendingOutOfBandOperationsErrorType.DeviceProtectionError: return new _PendingOutOfBandOperationsDeviceProtectionError.PendingOutOfBandOperationsDeviceProtectionError(this.error.description, this.error.cause); case PendingOutOfBandOperationsErrorType.NetworkError: if (this.error.server) { return new _PendingOutOfBandOperationsNetworkError.PendingOutOfBandOperationsNetworkError(this.error.server, this.error.description, this.error.cause); } return new _PendingOutOfBandOperationsUnknownError.PendingOutOfBandOperationsUnknownError(this.error.description, this.error.cause); case PendingOutOfBandOperationsErrorType.NoDeviceLockError: return new _PendingOutOfBandOperationsNoDeviceLockError.PendingOutOfBandOperationsNoDeviceLockError(this.error.description, this.error.cause); case PendingOutOfBandOperationsErrorType.OperationNotSupportedByBackend: if (this.error.server) { return new _PendingOutOfBandOperationsOperationNotSupportedByBackendError.PendingOutOfBandOperationsOperationNotSupportedByBackendError(this.error.server, this.error.description, this.error.cause); } return new _PendingOutOfBandOperationsUnknownError.PendingOutOfBandOperationsUnknownError(this.error.description, this.error.cause); case PendingOutOfBandOperationsErrorType.Unknown: return new _PendingOutOfBandOperationsUnknownError.PendingOutOfBandOperationsUnknownError(this.error.description, this.error.cause, this.error.server); } } } exports.PendingOutOfBandOperationsErrorConverter = PendingOutOfBandOperationsErrorConverter; //# sourceMappingURL=PendingOutOfBandOperationsErrorConverter.js.map