@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
54 lines (50 loc) • 1.49 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ServerImpl = exports.Server = void 0;
/**
* Copyright © 2023-2024 Nevis Security AG. All rights reserved.
*/
/**
* The object defining a server. Each {@link Account} is defined in a given {@link Server} object.
*/
class Server {
/**
* The base URL for the server. This is the base URL for the HTTP endpoints the SDK must interact
* with when dealing with the {@link Account}s associated with this server.
*
* The endpoints are built using this URL and the paths specified in {@link Configuration}
* (like {@link Configuration.getAuthenticationRequestPath}).
*/
/**
* Default constructor for {@link Server}.
*
* @param baseUrl The endpoints are built using this URL and the paths specified in {@link Configuration}.
* @returns the created {@link Server} instance.
*/
static create(baseUrl) {
return new ServerImpl(baseUrl);
}
/**
* Alternate constructor that creates a {@link Server} from a json.
*
* @param json contains the source for instance creation.
* @returns a {@link Server} instance.
*/
static fromJson(json) {
return ServerImpl.fromJson(json);
}
}
exports.Server = Server;
class ServerImpl extends Server {
constructor(baseUrl) {
super();
this.baseUrl = baseUrl;
}
static fromJson(json) {
return new ServerImpl(json.baseUrl);
}
}
exports.ServerImpl = ServerImpl;
//# sourceMappingURL=Server.js.map
;