0.2.2 • Published 5 years ago

bardog-eal-js v0.2.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

npm.io

EAL JS

Library to interact with EAL API from any JS based project.

Installation

With NPM

npm install --save bardog-eal-js

With YARN

yarn add bardog-eal-js

First steps

Import the package from your JS project:

import EAL from 'bardog-eal-js'

Use it on your project:

const EventManager = new EAL({
    user: 'YOUR_EAL_USERNAME',
    password: 'YOUR_EAL_PASSWORD'
});

// Adding an event
EventManager.addEvent({
    user: {
      id: 4903,
      username: 'myusername',
      email: 'user@mailinator.com'
    },
    business: {
      id: 601,
      name: 'Test Organization'
    },
    action: {
        datetime: (new Date()).toISOString(),
        name: 'My first action',
        category: 'General actions'
    }
});

Supported methods

:: addEvent

  • Description: adds a single event through EAL API.
  • Returns a Promise.
  • Params:
    {
        user: {                                                         //optional
            id,
            username,                                                   
            email,
            firstName,                                                  //optional
            lastName,                                                   //optional
            phone,                                                      //optional
            extraFields: {},                                            //optional
        },
        business: {
            id,
            name,
            email,                                                      //optional
            phone,                                                      //optional
            website,                                                    //optional
            extraFields: {}                                             //optional
        },
        action: {
            datetime,
            name,
            category,                                                   //optional
            object: {                                                   //optional
                id,
                className,
                before,                                                 //optional
                after,                                                  //optional
            },
            extraFields: {},                                            //optional
        }
    }

:: addEvents

  • Description: adds multiple events through EAL API.
  • Returns a Promise.
  • Params:
    {
        user: {                                                         //optional
            id,
            username,                                                   
            email,
            firstName,                                                  //optional
            lastName,                                                   //optional
            phone,                                                      //optional
            extraFields: {},                                            //optional
        },
        business: {
            id,
            name,
            email,                                                      //optional
            phone,                                                      //optional
            website,                                                    //optional
            extraFields: {}                                             //optional
        },
        actions: [{
            datetime,
            name,
            category,                                                   //optional
            object: {                                                   //optional
                id,
                className,
                before,                                                 //optional
                after,                                                  //optional
            },
            extraFields: {},                                            //optional
        }]
    }

:: resetSessionToken

  • Description: reset the EAL activity session token.
  • Returns nothing.
  • Params: none.
0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago