1.1.3 • Published 1 year ago

hover-processing v1.1.3

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

hover-processing

NodeJS Client for Processing Data from Hover APIs

Installation

npm install hover-processing

Documentation

const HoverProcessing = require('hover-processing')

const Hover = new HoverProcessing( env.BASE_URL,
                         env.CLIENT_SECRET,
                         env.REDIRECT_URL,
                         env.ACCESS_TOKEN,
                         env.REFRESH_TOKEN);


Hover.getReportDetails( hoverJobId )
    .then( details => {
        console.log(details.data)
    }).catch( err => {
        console.log(err)
    })

Hover.getJobMeasurements( hoverJobId )
    .then( measurements  => {
        console.log(measurements.data)
    }).catch( err => {
        console.log(err)
    })

Hover.getReportFile( req.params.hoverJobId )
    .then( report  => {
        
        // report.data is PDF Data
        console.log(report.data)
    }).catch( err => {
        res.status(500).send( err )
    })

Example App

The example directory contains a barebones Express application with a few working APIs

Setup

First navigate to the example directory and install the required dependencies from NPM

npm install

The example application is not setup to handle generating and refreshing an access token at this time, so you will need to add a file hover.json into the config directory (or create it if it doesn't exist) and use the following fields.

{
  "BASE_URL": "",
  "CLIENT_ID": "",
  "CLIENT_SECRET": "",
  "REDIRECT_URL": "",
  "ACCESS_TOKEN": "",
  "REFRESH_TOKEN": ""
}

Start the app

npm start

Example APIs

Get Job Details

/details/:hoverJobId

Get Job Measurements

/measurements/:hoverJobId

Get Job Report File (PDF)

/report/:hoverJobId