Javascript utility methods around Solenopsis
You will need to have your environment.properties
files configured based on the standard Solenopsis configuration pattern.
Parse the environment.properties
file and return the values inside
const solenopsis = require('solenopsis');
solenopsis.getCredentials('production')
.then(function (credentials) {
console.log(credentials.username);
})
.catch(console.error);
A helper method is provided to automatically create a jsforce connection based on an environment name.
const solenopsis = require('solenopsis');
solenopsis.login('production')
.then(function (conn) {
conn.query('select Id from Account limit 1', function (error, rows) {
console.error(error);
console.log(rows);
})
})
.catch(console.error);
You can pass in the client name with / without a version that will be made with SOAP / REST calls. This is useful if the user is being used for multiple applications
const opts = {
client_name: 'myApp'
};
solenopsis.login('production', opts)
const opts = {
client_name: 'myApp'
client_version: '1.0.0'
};
solenopsis.login('production', opts)