@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
48 lines (46 loc) • 1.66 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.OutOfBandPlatformOperationType = exports.OutOfBandPlatformOperation = void 0;
var _PlatformOperation = require("./PlatformOperation");
/**
* Copyright © 2023-2024 Nevis Security AG. All rights reserved.
*/
/**
* Represents the eligible types of an out-of-band operation.
*/
let OutOfBandPlatformOperationType = exports.OutOfBandPlatformOperationType = /*#__PURE__*/function (OutOfBandPlatformOperationType) {
/**
* Out-of-band registration.
*/
OutOfBandPlatformOperationType["registration"] = "REGISTRATION";
/**
* Out-of-band authentication.
*/
OutOfBandPlatformOperationType["authentication"] = "AUTHENTICATION";
return OutOfBandPlatformOperationType;
}({});
/**
* Helps in following the states of out-of-band operations during method channel calls.
*/
class OutOfBandPlatformOperation extends _PlatformOperation.PlatformOperation {
constructor(operationId, onOperationType) {
super();
this.operationId = operationId;
this.onOperationType = onOperationType;
}
/**
* Provides a way to update the current operation type.
* When an out-of-band operation is started at first we cannot know whether it will be an
* authentication or a registration operation. This information is provided once the native sdk
* reaches either the authentication or the registration callback.
*
* @param type the new operation type.
*/
updateOperationType(type) {
this.onOperationType?.(type);
}
}
exports.OutOfBandPlatformOperation = OutOfBandPlatformOperation;
//# sourceMappingURL=OutOfBandPlatformOperation.js.map
;