"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.monitoringDisableUrl = exports.monitoringConfirmUrl = exports.editNodeUrl = void 0;
const lodash_1 = __importDefault(require("lodash"));
const config_1 = require("../config");
// TODO: Typed URLs
function formUrl(route, queryParams) {
    let url = config_1.config.server.baseUrl;
    if (route || queryParams) {
        url += '/#/';
    }
    if (route) {
        url += route;
    }
    if (queryParams) {
        url += '?';
        url += lodash_1.default.join(lodash_1.default.map(queryParams, function (value, key) {
            return encodeURIComponent(key) + '=' + encodeURIComponent(value);
        }), '&');
    }
    return url;
}
function editNodeUrl() {
    return formUrl('update');
}
exports.editNodeUrl = editNodeUrl;
function monitoringConfirmUrl(monitoringToken) {
    return formUrl('monitoring/confirm', { token: monitoringToken });
}
exports.monitoringConfirmUrl = monitoringConfirmUrl;
function monitoringDisableUrl(monitoringToken) {
    return formUrl('monitoring/disable', { token: monitoringToken });
}
exports.monitoringDisableUrl = monitoringDisableUrl;
//# sourceMappingURL=urlBuilder.js.map