Releases: spree/spree-api-v2-js-sdk
v5.1.0
- Squash positional arguments in all endpoints into a single argument. Examples:
client.products.list({}, { include: 'default_variant' })
->client.products.list({ include: 'default_variant' })
client.cart.addItem({ orderToken }, { variant_id: variantId, quantity: 1 })
->client.cart.addItem({ order_token, variant_id: variantId, quantity: 1 })
client.order.status({ orderToken }, orderNumber)
->client.order.status({ order_token, order_number })
- Standardise endpoints' options to use snake case.
- Allow arbitrary options when calling endpoints without requiring changes in TypeScript.
- Allow sending token and query options with all endpoints.
v5.0.1
v5.0.0
-
Breaking change: Axios is no longer the default fetcher. A fetcher must now be explicitly provided to a Spree SDK client. You can see how to do it in the Quick start section in the README. To use a different HTTP client than Axios, check the Switching the fetcher section. Requiring a fetcher every time a Spree SDK client is instantiated improves how bundlers (Webpack, Rollup etc.) analyse the Spree SDK and its dependancies and reduces the bundle size.
-
Breaking change: Axios is no longer included in the Spree SDK NPM bundle. To keep using Axios with Spree SDK, install it using NPM:
npm install axios
or include as a script in HTML:<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
. -
Axios and node-fetch are marked as optional
peerDependencies
. One of them has to be explicitly installed in a project using the Spree SDK. Installation can be skipped if a custom fetcher is used which doesn't rely on Axios or node-fetch or when using Spree SDK only client-side with native fetch. -
Breaking change: Simplify
getErrors
inExpandedSpreeError
. It's no longer reliant onlodash
'sget
function (https://docs-lodash.com/v4/get/) and supports a subset of string formats supplied aspath
. If you rely on the oldgetErrors
implementation, you can bright it back by extending theExpandedSpreeError
class or adjustingExpandedSpreeError
instances created byspreeResponse
inHttp
. -
Reduce Spree SDK bundle size:
- Remove Axios and lodash/get from the core bundle.
- Remove the
qs
(https://github.com/ljharb/qs) dependency. Essential logic was moved to theobjectToQuerystring
helper.
v4.13.1
v4.13.0
- Breaking internal change: Depreciate
ErrorClass
enum and use theErrorType
union in its place. - Add the
extractSuccess
helper. You can use it to unwrap a Spree SDKResultResponse
and reject errors.extractSuccess
is especially convenient when usingasync..await
. - Stop git versioning generated TypeScript declarations in
/types
. - Fix routes generation by encoding parameters. Reported by @EstebanBorai (#294). Thank you for the Issue and PR. 🥇
v4.12.0
- Add Wishlists and Wished Items endpoints:
client.wishlists.list
client.wishlists.show
client.wishlists.default
client.wishlists.create
client.wishlists.update
client.wishlists.remove
client.wishlists.addWishedItem
client.wishlists.updateWishedItem
client.wishlists.removeWishedItem
- Add Menus endpoints:
client.menus.list
client.menus.show
- Add Digital Assets endpoint:
client.digitalAssets.download
. - Add select Shipping Method endpoint -
client.checkout.selectShippingMethod
. - Add change Cart currency endpoints -
client.cart.changeCurrency
. - Add payment to order association endpoint -
client.cart.addPayment
. Thanks @aplegatt 🦜 - Add remove all Coupons endpoint -
client.cart.removeAllCoupons
. - Add remove saved credit card endpoint -
client.account.removeCreditCard
. - Add fetch default Country endpoint -
default.countries.default
. Thanks @aplegatt 💯 - Depreciated some TypeScript and methods.
- Added ability to return Spree responses as a JavaScript stream.
v4.11.0
v4.10.0
- Fix
client.products.list
usage example in README. - Fix
docker pull
command used in Travis CI. - Suggest the
image_transformation
parameter when fetching products. Thanks, @aplegatt 💯 - Add access token and refresh token revocation endpoint (which is exposed by Doorkeeper) to the authentication group. Thanks, @aplegatt 🕺
- Remove optional chaining syntax to support older versions of Webpack.