@trilo/hippopotamus
Version:
Make requests to the Trilo ecosystem
27 lines (26 loc) • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.makePayUrl = exports.camelApiUrl = exports.baobabUrl = exports.tokenUrl = void 0;
var constants_1 = require("./constants");
exports.tokenUrl = function (_a) {
var stagePrefix = _a.stagePrefix;
var dir = "/oauth2/token";
// cognito has restrictions on url
if (stagePrefix === "") {
// production
return "https://" + stagePrefix + constants_1.COGNITO_OAUTH_SUBDOMAIN + "." + constants_1.DOMAIN + dir;
}
return "https://" + stagePrefix + constants_1.COGNITO_OAUTH_SUBDOMAIN + "-trilo.auth.eu-west-2.amazoncognito.com" + dir;
};
exports.baobabUrl = function (_a) {
var stagePrefix = _a.stagePrefix, _b = _a.path, path = _b === void 0 ? "/" : _b;
return "https://" + stagePrefix + constants_1.BAOBAB_SUBDOMAIN + "." + constants_1.DOMAIN + path;
};
exports.camelApiUrl = function (_a) {
var stagePrefix = _a.stagePrefix, _b = _a.path, path = _b === void 0 ? "/" : _b;
return "https://" + stagePrefix + constants_1.CAMEL_SUBDOMAIN + "." + constants_1.DOMAIN + "/api" + path;
};
exports.makePayUrl = function (_a) {
var stagePrefix = _a.stagePrefix, agreementId = _a.agreementId;
return "https://" + stagePrefix + constants_1.GATEWAY_SUBDOMAIN + "." + constants_1.DOMAIN + "?p=" + agreementId;
};