Salesforcer is a wrapper around SalesForce API allowing to simply build single and composite requests.
It uses axios to make HTTP requests.
LIMITATIONS AND DISCLAIMER
This library is in pre 1.0.0 state. Api and structure can change and break frequently.
Currently only sobjects, query and composite requests are supported.
Authentification only supports grant_type=password.
You can check the documentation here.
Install using npm:
npm install --save @digitregroup/salesforcerInstall using yarn:
yarn add @digitregroup/salesforcerconst {Auth, SObjects} = require('@digitregroup/salesforcer');
const auth = new Auth({ /* Ommited */ });
const so = new SObjects({
method: 'POST',
sobject: 'Task',
body: { foo: 'bar' },
});
const response = await so.execute(auth);const {Auth, SObjects, Composite} = require('@digitregroup/salesforcer');
const auth = new Auth({ /* Ommited */ });
const composite = new Composite(true);
composite
.add('NewLead', new SObjects({
method: 'POST',
sobject: 'Lead',
body: { foo: 'bar' },
}))
.add('AddTask', new SObjects({
method: 'POST',
sobject: 'Task',
body: { bar: 'baz', WhoId: '@{NewLead.id}' },
}));
const response = await composite.execute(auth);yarn buildyarn lintyarn testnpm version <version>This will:
- update the
versionfield in package.json - commit the package.json
- tag with
v<version>