Skip to content

Releases: spree/spree-api-v2-js-sdk

v5.1.0

28 Dec 12:51
0b420f8
Compare
Choose a tag to compare
  • 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

03 Dec 13:36
68a46eb
Compare
Choose a tag to compare
  • Remove tarball from NPM package.

v5.0.0

03 Dec 12:10
4d1b265
Compare
Choose a tag to compare
  • 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/axios@0.21.4/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 in ExpandedSpreeError. It's no longer reliant on lodash's get function (https://docs-lodash.com/v4/get/) and supports a subset of string formats supplied as path. If you rely on the old getErrors implementation, you can bright it back by extending the ExpandedSpreeError class or adjusting ExpandedSpreeError instances created by spreeResponse in Http.

  • 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 the objectToQuerystring helper.

v4.13.1

30 Nov 18:40
ffe9c15
Compare
Choose a tag to compare
  • Fix: Include /types (generated TypeScript declarations) in NPM package.

v4.13.0

30 Nov 14:42
87802aa
Compare
Choose a tag to compare
  • Breaking internal change: Depreciate ErrorClass enum and use the ErrorType union in its place.
  • Add the extractSuccess helper. You can use it to unwrap a Spree SDK ResultResponse and reject errors. extractSuccess is especially convenient when using async..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

09 Nov 14:25
b38cc05
Compare
Choose a tag to compare
  • 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

12 Oct 14:49
7c05cfe
Compare
Choose a tag to compare
  • Add CMS Pages endpoints (client.pages.list and client.pages.show). Thanks @aplegatt 🌮 . Description and examples coming to the README later.
  • Add an endpoint associating a guest cart with a user (client.cart.associateGuestCart). Thanks @aplegatt 🥳
  • Minor security update.

v4.10.0

30 Sep 10:16
0f05cdb
Compare
Choose a tag to compare
  • 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.

v4.9.0

13 Sep 13:41
e5a0b92
Compare
Choose a tag to compare
  • Add JSON:API helpers under import { jsonApi } from '@spree/storefront-api-v2-sdk'. Usage example is in tests/e2e/spec.ts.
  • Security updates.

v4.8.0

02 Sep 12:45
3121eea
Compare
Choose a tag to compare
  • Add remove cart endpoint (client.cart.remove(...)). Thanks @pmilewski 💪
  • Use generics instead of casting to type values returned from Spree (#211).
  • Remove optional chaining syntax to support older versions of Webpack and Babel.