UNPKG

@sprucelabs/spruce-event-utils

Version:

Some helpful utilities to speed up working with Mercury! 🚅

27 lines (26 loc) • 912 B
import { SchemaError } from '@sprucelabs/schema'; import { REMOTES } from '../constants.js'; export const 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 (HEARTWOOD_REMOTES[remote]) { //@ts-ignore return HEARTWOOD_REMOTES[remote]; } throw new SchemaError({ code: 'INVALID_PARAMETERS', friendlyMessage: `\`${remote}\` is not a valid Remote. Valid options are:\n\n${Object.keys(REMOTES).join('\n')}`, parameters: ['remote'], }); }, }; export default heartwoodRemoteUtil;