@axway/amplify-cli-utils
Version:
Common utils for Axway CLI packages
75 lines (69 loc) • 1.37 kB
JavaScript
/**
* Environment specific settings.
*
* @type {Object}
*/
const environments = {
dev: {
auth: {
clientId: 'cli-test-public',
realm: 'Broker'
},
registry: {
url: 'http://localhost:8082'
},
title: 'Development'
},
staging: {
auth: {
clientId: 'amplify-cli',
realm: 'Broker'
},
registry: {
url: 'https://registry.axwaytest.net'
},
title: 'Staging'
},
prod: {
auth: {
clientId: 'amplify-cli',
realm: 'Broker'
},
registry: {
url: 'https://registry.platform.axway.com'
},
title: 'Production'
}
};
const mapping = {
development: 'dev',
preprod: 'staging',
preproduction: 'staging',
'pre-production': 'staging',
production: 'prod',
test: 'staging'
};
function resolve(env) {
let environment = 'prod';
if (env) {
if (typeof env !== 'string') {
throw new TypeError('Expected environment to be a string');
}
environment = env.toLowerCase();
environment = mapping[environment] || environment;
if (!environments[environment]) {
throw new Error(`Invalid environment "${env}"`);
}
}
return {
name: environment,
...environments[environment]
};
}
var environments$1 = /*#__PURE__*/Object.freeze({
__proto__: null,
environments: environments,
resolve: resolve
});
export { environments as a, environments$1 as e, resolve as r };
//# sourceMappingURL=environments-D5PDL_fe.js.map