@sprucelabs/spruce-event-utils
Version:
Some helpful utilities to speed up working with Mercury! 🚅
30 lines (29 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HEARTWOOD_REMOTES = void 0;
const schema_1 = require("@sprucelabs/schema");
const constants_1 = require("../constants");
exports.HEARTWOOD_REMOTES = {
local: 'http://localhost:8080',
developer: 'https://dev.spruce.bot',
demo: 'https://demo.spruce.bot',
sandbox: 'https://sandbox.spruce.bot',
polish: 'https://polish.spruce.bot',
production: 'https://spruce.bot',
heartwood_test: 'https://heartwood-test.spruce.bot',
};
const heartwoodRemoteUtil = {
buildUrl(remote) {
//@ts-ignore
if (exports.HEARTWOOD_REMOTES[remote]) {
//@ts-ignore
return exports.HEARTWOOD_REMOTES[remote];
}
throw new schema_1.SchemaError({
code: 'INVALID_PARAMETERS',
friendlyMessage: `\`${remote}\` is not a valid Remote. Valid options are:\n\n${Object.keys(constants_1.REMOTES).join('\n')}`,
parameters: ['remote'],
});
},
};
exports.default = heartwoodRemoteUtil;