A JavaScript client library for the Duffel API.
Content
You can install the dependencies for this library by executing the following command:
yarn install
You can run the test suite for this library by executing the following command:
yarn test
You can run the linters configured for this library by executing the following command:
yarn lint
You can install this library into your current project by executing the following command:
yarn add @duffel/api
If you need to create a new API operation class, just type yarn generate:operation
and you will be prompted with a few questions. This script will create the relevant operation folder and files for you.
To be able to publish the correct version to npm, this project is currently following Angular conventional commit message guidelines which is based on conventional commits. This commit message guideline allows the semantic-release GitHub action to be triggered.
Before creating a commit you should run a husky hook which will check if the commit structure is valid or not. If you don't want to create the commit manually, you can use yarn commit
which will use commitzen
to help you out creating the message.
Every time a commit is merged to main, a GitHub Action is run to analyse the commit messages with semantic-release
and automatically update the current version to be deployed by following semantic versioning. When the deployment is complete, the action updates the package version, using Duffel's machine user (@duffel-bot
) as the author, and this change will be automatically approved by the GitHub Action via the [autoapprove
workflow] (../.github/workflows/autoapprove.yml).
You can learn more about the Duffel API and this library in our documentation.