UNPKG

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

Version:

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

59 lines (54 loc) 2.22 kB
"use strict"; /** * Copyright © 2024 Nevis Security AG. All rights reserved. */ import { DeviceInformationMismatch } from "./DeviceInformationMismatch.js"; import { DeviceInformationCheckErrorConverter } from "../../error/deviceInformation/check/DeviceInformationCheckErrorConverter.js"; /** * This is the result of the {@link DeviceInformationCheck} operation. * * If configuration mismatches in a given server could be found, but retrieving the server * configuration failed for another server. The found mismatches will be returned by the * {@link mismatches} property, and the error will be returned by the {@link errors} property. * * @group Common Objects * @see {@link DeviceInformationCheck} */ export class DeviceInformationCheckResult { /** * Returns the mismatches configuration mismatches between the mobile SDK. * * > [!WARNING] * > If your application has been upgraded from versions of the SDK previous to 3.8.0, and thus * > some users were registered using earlier versions, some false positive {@link MissingAuthenticatorInServer} * > mismatches can be returned for those users. */ /** * Returns the errors that occurred retrieving the configuration mismatches. * * @return the errors that occurred retrieving the configuration mismatches. */ /** * Alternate constructor that creates a {@link DeviceInformationCheckResult} from a json. * * @returns the created {@link DeviceInformationCheckResult} instance. */ static fromJson(json) { return DeviceInformationCheckResultImpl.fromJson(json); } } export class DeviceInformationCheckResultImpl extends DeviceInformationCheckResult { constructor(mismatches, errors) { super(); this.mismatches = mismatches; this.errors = errors; } static fromJson(json) { const mismatchesData = json.mismatches; const errorsData = json.errors; const mismatches = mismatchesData?.map(DeviceInformationMismatch.fromJson); const errors = errorsData?.map(error => new DeviceInformationCheckErrorConverter(error).convert()); return new DeviceInformationCheckResultImpl(mismatches || [], errors || []); } } //# sourceMappingURL=DeviceInformationCheckResult.js.map