EasyPost/easypost-node

Not able to create reports of any type

Closed this issue · 1 comments

Using the examples documented here https://www.easypost.com/docs/api/node#create-a-report I am getting errors such as:

`Logan:nodejs logan.simonsen$ node reports/createReport.js
/Users/logan.simonsen/easypostLibrary/nodejs/reports/createReport.js:18
const shipmentReport = new api.ShipmentReport({
^

TypeError: api.ShipmentReport is not a constructor
at Object. (/Users/logan.simonsen/easypostLibrary/nodejs/reports/createReport.js:18:24)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3`

This happens for each type of shipment attempted. I've checked with other team members and they get the same result.

I've tested creating a report using the python library and that seems to work fine.

Looks like those docs are for an old version of this library.

The current docs should (and will shortly) read:

const report = new api.Report({
  type: 'shipment',
  start_date: '2016-10-01',
  end_date: '2016-10-31'
});
report.save().then(console.log);