UNPKG

@dasch-swiss/dsp-js

Version:

JavaScript library that handles API requests to Knora

30 lines 1.16 kB
/** * @deprecated use Version endpoint instead * @category Internal */ export var HealthConversionUtil; (function (HealthConversionUtil) { /** * Adds the versions of webapi and Pekka to the health response. * Throws an error if the header information received from Knora is invalid. * * @param healthResponse the health response reveived from Knora. * @param serverHeaderParam the server header param, if any. */ HealthConversionUtil.addHeaderInfoToHealthResponse = function (healthResponse, serverHeaderParam) { if (serverHeaderParam !== null) { // e.g., "webapi/v13.0.0-rc.16 akka-http/10.1.12" var versions = serverHeaderParam.split(" "); if (versions.length === 2) { return healthResponse; } else { throw new Error("Could not parse server header param ".concat(serverHeaderParam, ".")); } } else { throw new Error("Could not get server header param."); } }; })(HealthConversionUtil || (HealthConversionUtil = {})); //# sourceMappingURL=health-conversion-util.js.map