Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function constructRegisterServer2Request(
server: any,
isOnline: boolean
): RegisterServer2Request {
const discoveryUrls = server.getDiscoveryUrls();
assert(!isOnline || discoveryUrls.length >= 1, "expecting some discoveryUrls if we go online ....");
return new RegisterServer2Request({
server: {
// The globally unique identifier for the Server instance. The serverUri matches
// the applicationUri from the ApplicationDescription defined in 7.1.
serverUri: server.serverInfo.applicationUri,
// The globally unique identifier for the Server product.
productUri: server.serverInfo.productUri,
serverNames: [
{ locale: "en", text: server.serverInfo.productName }
],
serverType: server.serverType,
discoveryUrls,
gatewayServerUri: null,
isOnline,