UNPKG

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

Version:

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

57 lines (53 loc) 2.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PendingOutOfBandOperationsResultImpl = exports.PendingOutOfBandOperationsResult = void 0; var _PendingOutOfBandOperation = require("./PendingOutOfBandOperation"); var _PendingOutOfBandOperationsErrorConverter = require("../../error/outOfBand/pendingOutOfBandOperationsError/PendingOutOfBandOperationsErrorConverter"); /** * Copyright © 2024 Nevis Security AG. All rights reserved. */ /** * The object with the non-redeemed out-of-band operations returned by nevisFIDO * in the {@link https://docs.nevis.net/nevisfido/reference-guide/uaf-http-api/device-service#get-device-out-of-band-operations | Get Device Out-of-Band Operations} * service. * * If the pending operations in a given server could be found, but they failed * for another server. The found operations will be returned by the {@link operations} * method, and the error will be returned by the {@link errors} method. */ class PendingOutOfBandOperationsResult { /** * Returns the out-of-band operations of the device that have not been redeemed, * nor timed-out. */ /** * Returns the errors that occurred retrieving the pending out-of-band operations. */ /** * Alternate constructor that creates a {@link PendingOutOfBandOperationsResult} from a json. * * @returns the created {@link PendingOutOfBandOperationsResult} instance. */ static fromJson(json) { return PendingOutOfBandOperationsResultImpl.fromJson(json); } } exports.PendingOutOfBandOperationsResult = PendingOutOfBandOperationsResult; class PendingOutOfBandOperationsResultImpl extends PendingOutOfBandOperationsResult { constructor(operations, errors) { super(); this.operations = operations; this.errors = errors; } static fromJson(json) { const operationsData = json.operations; const errorsData = json.errors; const operations = operationsData?.map(operation => _PendingOutOfBandOperation.PendingOutOfBandOperation.fromJson(operation)); const errors = errorsData?.map(error => new _PendingOutOfBandOperationsErrorConverter.PendingOutOfBandOperationsErrorConverter(error).convert()); return new PendingOutOfBandOperationsResultImpl(operations || [], errors || []); } } exports.PendingOutOfBandOperationsResultImpl = PendingOutOfBandOperationsResultImpl; //# sourceMappingURL=PendingOutOfBandOperationsResult.js.map