v6.0.0-rc1
Pre-release
Pre-release
·
322 commits
to master
since this release
Breaking Changes
- Bumps minimum Node from 10 to 12
- Renamed default export
APItoEasyPostClient - Overhauled the data flow of the library
- Instead of creating a local object and then calling
.save()on it to create/update it at the API level, you will pass in the same data as before but to one of eithercreate()orupdate()functions on the service in question - The base service no longer implements all functions and instead each individual service implements its own functions. This means the library namespace won't be cluttered with various
notImplementedfunctions - All instance functions (excluding
lowestRate) previously called on an object are instead called on a service. (eg:shipment.buy(shipment.lowest_rate())is nowclient.Shipment.buy(shipment.id, shipment.lowest_rate())))- All functions attached to a service are now async and must be awaited
- Instead of creating a local object and then calling
- Moved library structure around
- Introduced
/modelsthat contain the EasyPost objects - Renamed
/resourcesto/servicesto better reflect that a service called against an EasyPostClient differs from an API resource, now known as themodels - Each service file now has
_serviceappended - Added
/utilswhich contains bothinternal_util.jswhich is not intended for user consumption andutil.jswhich contains public utilities - Moved
getLowestSmartRateandvalidateWebookfunction toutil.jsas neither of them require the client object to function
- Introduced
- References of
Referralwere changed toReferralCustomerto match the API - Bumps major versions of all dependencies
- Changes the
primaryOrSecondaryparameter name topriorityin billing functions to match the API - Empty response functions now return nothing (deleting records, funding a wallet, etc)
- Explicit
typeparameter for retrieving all reports removed, includetypein genericparamsdictionary instead. - Improves error handling
- Specific error types for each category of error
- API error message may be an array rather than a string. Arrays will be concatenated (by comma) and returned as a string.
- Corrects references of
smartratetoSmartRateandsmartRateto match the API
New Features
- Add
retrieveStatelessRatesandgetLowestStatelessRatefunctions
Bug Fixes
- Completely overhauled deserialization process, nested objects (eg: rates of shipments, etc) now properly convert to their appropriate EasyPostObject
- Fixes the
verifyAddressfunction to actually verify an address - Fixes a bug that could double wrap or unintentionally wrap the results of an
/allAPI call with the name of the object in question