@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
63 lines (59 loc) • 2.54 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DeviceInformationCheckResultImpl = exports.DeviceInformationCheckResult = void 0;
var _DeviceInformationMismatch = require("./DeviceInformationMismatch");
var _DeviceInformationCheckErrorConverter = require("../../error/deviceInformation/check/DeviceInformationCheckErrorConverter");
/**
* Copyright © 2024 Nevis Security AG. All rights reserved.
*/
/**
* 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.
*
* @see {@link DeviceInformationCheck}
*/
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);
}
}
exports.DeviceInformationCheckResult = DeviceInformationCheckResult;
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.DeviceInformationMismatch.fromJson);
const errors = errorsData?.map(error => new _DeviceInformationCheckErrorConverter.DeviceInformationCheckErrorConverter(error).convert());
return new DeviceInformationCheckResultImpl(mismatches || [], errors || []);
}
}
exports.DeviceInformationCheckResultImpl = DeviceInformationCheckResultImpl;
//# sourceMappingURL=DeviceInformationCheckResult.js.map
;