This repository has been archived by the owner on Feb 20, 2022. It is now read-only.
Releases: thibmaek/bpost
Releases · thibmaek/bpost
v1.0.0 (Stable)
Breaking changes
- Module now has to be instantiated first. The ID has to be passed to
bpost()
only once, methods are chainable to the 'constructor':
import bpost from 'bpost';
const pkg = bpost('<id>');
const status = pkg.getStatus();
Of course destructured syntax for imports is still supported but the ID needs to passed in explicitly in this case:
import { getStatus } from 'bpost';
const status = getStatus('<id>');
Features
- Support for multilanguage returns (defaults to english). The
bpost()
'constructor' can take a second argumentlang
that sets the language for data returns that have multiple language keys. Currently bpost only has keys for nl, fr and en:
import bpost from 'bpost';
const pkg = bpost('<id>', 'nl');
pkg.sourcePostalPoint(); // will return the source postal point in Dutch
Methods that have the possibilty to return a different value for a different language key can also take the argument directly:
import { sourcePostalPoint } from 'bpost';
sourcePostalPoint('<id>', 'nl');
Fixes
- Unnecessary
done()
callbacks removed from async flows. Would take up unneeded time. - Methods themselves no longer catch exceptions and errors. All
catch()
promise handlers have been removed since this proved to be an issue with the bpost API. Sending to many incorrect requests would block the origin IP address in their firewall. Therefore this decision has been made since it would also break the tests in CI and locally. Errors fromcomposedFetch
would be bubbled up one level to thethen()
handler of the method anyway.
Misc
- Add a new
test:watch
npm task to only test files changed on the fs - README and examples updated
- Git hooks are now possible to opt out of. Create a
.opt-out
file in root and put the corresponding hooks you want to opt out of in there. For further information read: https://github.com/ta2edchimp/opt-cli
v0.2.1
v0.2.0
Features
- Add support for home delivery (& absence) next to postal point delivery. 55d411c
- Introduce new methods
hasRetourOptions
andreceiver
for package data. 55d411c - Now always fetches over HTTPS, which is the way to go. 6762a94
- Set up testing with Jest. All methods are tested for their basic behavior but coverage is not great at the moment. Will be improved in future releases (alongside the perk of mocking network req/res). f15398e 5a26dae 0e17500
Bugs & fixes
- Fix data return from the bPost api. They changed the layout of their JSON response to include a top level items key which broke everything. cce345c
- Fix methods that used a arrow function + block but had no explicit return. Foolish mistake… 463dc31
- Minimum required node version (>=v4.0.0 which is minimum LTS) now explicitly set in the package.json. fee6da1