Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Releases: thibmaek/bpost

v1.0.0 (Stable)

06 Dec 12:10
Compare
Choose a tag to compare

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 argument lang 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 from composedFetch would be bubbled up one level to the then() 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

03 Dec 01:23
Compare
Choose a tag to compare
v0.2.1 Pre-release
Pre-release

Misc

  • Include Codecov reports for coverage
  • Use np for publishing workflow instead of release-it

v0.2.0

02 Dec 14:16
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release

Features

  • Add support for home delivery (& absence) next to postal point delivery. 55d411c
  • Introduce new methods hasRetourOptions and receiver 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

Misc

  • Optimised lodash depedency. Now only downloads lodash.find from npm instead of the whole 5MB module. 32d4715
  • Updated the docs with new methods & information about contributing. 9218d6b

v0.1.1

19 Nov 23:19
Compare
Choose a tag to compare
v0.1.1 Pre-release
Pre-release

Initial release!

bpost is now available on Github, npm and yarn!