0.5.5 • Published 3 years ago

@digitregroup/salesforcer v0.5.5

Weekly downloads
41
License
MIT
Repository
-
Last release
3 years ago

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/salesforcer

Install using yarn:

yarn add @digitregroup/salesforcer

Request 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 build

Linting

yarn lint

Running tests

yarn test

Releasing version

npm version <version>

This will:

  • update the version field in package.json
  • commit the package.json
  • tag with v<version>
0.5.5

3 years ago

0.5.4

3 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago