Socket
Socket
Sign inDemoInstall

@barchart/events-client-js

Package Overview
Dependencies
19
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @barchart/events-client-js

JavaScript library for interfacing with Barchart's Events API


Version published
Weekly downloads
5
increased by25%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@barchart/events-client-js

JavaScript library for interfacing with Barchart's Events API

The Barchart Events System accepts HTTP requests, offering the following functionality:

  • Accepts and saves events (e.g. Job Started, Pizza Ordered, Lightning Struck, etc).
  • Accepts requests to generate log files containing events, given a customer, product type, and optional start and end dates.

This library simplifies interaction with the Barchart Events System, by exposing JavaScript classes with simple functions like:

  • EventGateway.sendEvents (sends a new event(s) to the backend),
  • ReportGateway.startReport (triggers generation of a new report),
  • ReportGateway.getReportAvailability (checks progress of report generation), and
  • ReportGateway.getReport (gets the download link for a completed report)

Also, two utilities exist:

  • EventBatcher (Wraps an EventGateway, temporarily caching new events before sending them to the backend), and
  • EventFactory (Simplifies creation of event objects)

Use of this client is optional, you may interact with the backend directly via HTTP requests

Code Documentation

The code is documented with JSDoc. While the output hasn't been committed to source control, you can generate the documentation by using the following commands:

> npm i jsdoc -g
> gulp document

Examples

Usage Guide

The following usage guide details report generation using this library or direct HTTP request (with cURL examples).

Browser

Two example pages exist. One allows you to send manually generate new events.events to server. The other allows you to trigger report generation, check report status, and download reports.

Open the example pages in a browser, from your local file system, here

  • ./example/browser/example.event.html
  • ./example/browser/example.report.html

Or, visit the hosted page at:

Development

Check for Lint

> gulp lint

Local Testing

Build the example pages manually:

> gulp build-example-bundles

Alternately, a gulp task exists automatically rebuilds the example page bundle, as you make changes to the code:

> gulp watch

FAQs

Last updated on 14 Oct 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc