@jupiterone/jupiterone-mcp
Version:
Model Context Protocol server for JupiterOne account rules and rule details
24 lines • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.constructAppUrl = constructAppUrl;
const getEnv_js_1 = require("./getEnv.js");
/**
* Build a link into the JupiterOne web app for the caller's account.
*
* The app host (`app`, formerly `apps`) and the per-environment domain live here so every
* deep link is built one way. Returns an empty string when the subdomain or environment is
* unknown — callers surface that as "no link available" rather than a broken URL.
*
* @param path Path within the app (e.g. `insights/dashboards/<id>`). A leading slash is optional;
* it is trimmed so the URL never contains a doubled separator.
* @param subdomain The account subdomain; when absent, no link can be built.
*/
function constructAppUrl(path, subdomain) {
const environment = (0, getEnv_js_1.getEnv)();
if (!subdomain || !environment) {
return '';
}
const normalizedPath = path.replace(/^\/+/, '');
return `https://${subdomain}.app.${environment}.jupiterone.io/${normalizedPath}`;
}
//# sourceMappingURL=appUrl.js.map