0.5.5 • Published 5 years ago
@digitregroup/salesforcer v0.5.5
Salesforcer
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.
Documentation
You can check the documentation here.
Usage
Installing
Install using npm:
npm install --save @digitregroup/salesforcerInstall using yarn:
yarn add @digitregroup/salesforcerRequest example
const {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);Composite example
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);Contributing
Building
yarn buildLinting
yarn lintRunning tests
yarn testReleasing version
npm version <version>This will:
- update the
versionfield in package.json - commit the package.json
- tag with
v<version>