- Fix a bug when including both hidden and specific category properties on the products endpoint
- Improve filter types to represent the behavior from the API accurately.
- Refactor Wishlist implementation
WishlistResponseData
export is now deprecated, please use the newWishlist
import- Removed
masterKey
fromAddWishlistItemParameters
parameters - Added
itemGroup
support to the wishlist - Added separated
WishlistWith
type - Added
WishlistItemCustomData
to allow for extension of custom data on wishlists
-
Adds support for boolean filters in the Search V2 endpoints
Example (shortened for readability):
{ "type": "category", "categorySuggestion": { "category": { "id": 1, "path": "/women/jackets", "name": "Jacke" }, "filters": [ { "type": "boolean", "booleanFilter": { "slug": "sale", "value": true, "label": "sale" } } ] } }
-
Removes the
considerItemGroupForUniqueness
option from theStorefrontAPIClient.addOrUpdateItems
.This behavior is now enabled by default that we consider the item group when checking for existing basket items.
-
Improve ShopConfiguration endpoint and typings
We now also export a
ShopCustomData
andShopCountryCustomData
type that can be used to define your custom data by augmenting the TypeScript type definition of@scayle/storefront-api
like follows:declare module '@scayle/storefront-api' { interface ShopCountryCustomData { isEnabled: boolean } }
- Add missing
BuyXGetYEffect
andAutomaticDiscountEffect
exports
-
- Rename
BapiClient
toStorefrontAPIClient
- Rename
BapiAuthentication
toStorefrontAPIAuth
- Drop support for basic authentication
- Drop support for header shop id placement We recommend sticking with basic query parameters, which are usually safer and easier to use. In the past, we have seen issues with headers and caching layers, which need to be specifically instrumented to consider the header.
- The
host
parameter provided to the StorefrontAPIClient should now be the URL host (example:{{tenant-space}}.storefront.api.scayle.cloud
) The old format ofhttps://{{tenant-space}}.storefront.api.scayle.clou/v1/
is still supported - Removed all
Bapi
namings from types These include:BapiPrice
,BapiProduct
,BapiProductCategory
andBapiCategory
- Drop the
ModeledBapiClient
- Updated the build system
The package is now bundled into a single file, disallowing import from internally compiled files.
All imports must import the main module from
@scayle/storefront-api
. We have also increased the build target to ES2018.
- Rename
- Add orFiltersOperator support to filter values endpoint
- Add orFiltersOperator support to filter values endpoint
-
Resolved an issue where the
instanceof
check forFetchError
always incorrectly returnedfalse
, by upgrading the compilation target from ES5 to ES2015.This resulted in
404
errors on the redirects endpoint being treated as errors.
- Add filters to CategorySearchSuggestion
- remove inline sourcemaps
- Add support for Search V2 Endpoints
- Fixed a bug when brands.getBySlug method was returning brand by id if numeric value was given
- Switch from axios to fetch
- Add
priority
field to promotion response
- Export Promotion Condition types
- Export types
- Add promotions integration for Basket Endpoints
- Added new
/v1/promotions
endpoints
- Bring back the vouchers
- Add support for Promotion IDs in Basket Endpoints
- Don't include tests in NPM package
- Add
name
field toNavigationItem
- Add
filters:not
support on products and filters endpoint - Add support for
categories.countryLevelCustomData
andcategories.shopLevelCustomData
- Add
categoryId
support for/search/resolve
- Add support for
orFiltersOperator
on the/filters
and/products
endpoints - Remove empty
?with=
parameter on the/filters
endpoint - Remove type restrictions on AttributeKey
- Expose status codes in multi basket operations
- Expose status codes in basket responses
- Moved Github repository to new Scayle Org
- Allow a new filter
filters[hasCampaignReduction]
on the /filters and /products endpoints
- Adds supported request parameters to navigation endpoints
- Updates navigation response to reflect the new structure
- Adds ?includeSellableForFree parameter for filters API call
- Refactor Extract typings for better import handling
- Implements
redirects.get
method - Implements
redirects.match
method -> method will return either a matched redirect or undefined if the redirect is matched
- extraFilters on NavigationItemCategory are now correctly typed as number[] instead of boolean
- Add support for
itemGroup
on basket endpoints
- Add
includeSoldOut
on filters endpoint
- Allows querying products with
reductionRange
- Fix Basket Item Status
- Add
includeItemsWithoutProductData
option for basket endpoints
- Add 409 and 413 wishlist response status codes
- Returns merchantId information on product variant level
- Allows querying products with
searchCategoryIds
- Allows querying products and variants with
lowestPriorPrice
- Allows querying products based on minimum and max reduction
- Allows querying products with baseCategories
- Expose
/campaigns
API asBapiClient.campaigns.get
- Expose
/campaigns/{campaignId}
API asBapiClient.campaigns.getById
- Expose
/navigation/trees
API asBapiClient.navigation.getAll
- Expose
/navigation/trees/{navigationTreeId}
API asBapiClient.navigation.getById
- Allow arbitrary campaign keys
- Ignore
displayData
onBapiClient.addOrUpdateItems
when strategyExistingItemHandling.AddQuantityToExisting
is used- Reason: The underlying API does not support updating display data of existing items, only the custom data
- Support parameters
containsSearch
anddisableFuzziness
for product searches
BapiClient.basket.updateItem
(and its usage throughBapiClient.basket.addOrUpdateItems
) now supports updating thecustomData
as well as thepricePromotionKey
- Beware that setting either of these entirely replaces any previous
customData
the item may have had
- Beware that setting either of these entirely replaces any previous
- Expose
/search/resolve
API asBapiClient.search.resolve
- Add
getByReferenceKey
, which uses a faster implementation thangetByReferenceKeys
when requesting products for a single reference key
- Expose
attributeGroupType
forAttributesFilterItemWithValues
on/filters
endpoint
- Include
campaignKey
in/filters
request
- Now supports CloudVault's token based authentication.
- Throw error if category's
getByPath
argument is invalid, resulting in the server returning the full list of categories
- Add category properties to root categories request
- Breaking Change: For categories included with products on
/products
, properties will not be included by default anymore. Responses are now small by default. Usewith: { categories: { properties: 'all' } }
to get the previous behavior, or better yet specify the exact properties you need usingwith: { categories: { properties: { withName: ['foo', 'bar'] } } }
- Breaking Change: For category requests, properties are not included by default anymore. Responses are now small by default.
Use
with: { properties: 'all' }
to get the previous behavior, or better yet specify the exact properties you need usingwith: { properties: { withName: ['foo', 'bar'] } }
- Add
shop-configuration
endpoint
- Expose the
score
property on the Typeahead suggestions
- Fix incorrectly named "attribute by key" response type
- Add support for the "attribute by key"
/attributes/${key}
API endpoint
- Update
BapiClient.addOrUpdateItems
to return more detailled errors if any occured during the operations - Make
AddToBasketFailureKind
enum string-based, so it's suitable for logging - Expose
skipAvailabilityCheck
on "add to wishlist" operation
- Expose
referenceKey
on BAPI - Expose
products.byReferenceKeys
onBapiClient
- Move
axios
back to a normal dependency, but with a wide range of versions supported, so consumers define which exact version should be used easily - Export
BasketItemPrice
andBasketTotalPrice
(28)- Thanks to @sqonde for contributing this fix
- Expose
/typeahead
API endpoint methods
depth
is now exposed on the category response typeskipAvailabilityCheck
can now be specified for basket requests
- The
axios
library is now a peer dependency, so you can specify the version to be used in the consumer'spackage.json
.
BapiClient
: Change the defaultshopID
placement to bequery
, which avoidsCORS
OPTIONS
requests forGET
requests.
-
Align the parameters across
BapiClient.categories.*
methods- The
depth
parameter is now send to BAPI in all cases, even though it's not needed for every case (e.g. requesting categories by IDs wouldn't include children, unless those where specified using thewith
parameter). This is done to have a consistent behavior across the SDK methods, and not be reliant on per endpoint behavior in BAPI. - The legacy behavior of not returning the whole category tree by default when requesting the root categories (
BapiClient.categories.getRoots
) is kept. Pass an explicitchildren
parameter (e.g.1000
) to request the whole tree. BapiClient.categories.getByIds
andcreateCategoriesByIdsEndpointRequest
used to take adepth
parameter which mapped directly to the BAPI HTTP APIdepth
parameter. This has now been removed in favor ofwith.children
, which specifies the additional levels of children that should be loaded. Setwith.children
to"previous depth" - 1
when upgrading to this version.
- The
-
Adds support for the
/filters/:groupName/values
endpoint
- Remove support for
/masters
endpoisrc/endpoints/typeahead/typeahead.tsnt
- Add
minProductId
toProductsSearchEndpointParameters
- Add
variants.getByIds
toBapiClient
- Fix types for the
BapiProductCategory
andBapiCategory
- Removal of the following product helpers:
findBrand
,attributeLabel
,variantAttributeLabel
,variantAttributeId
,attributeNames
andlabelFromAttributeGroup
- Addition of the following helpers:
getAttributeValues
These helpers have been removed because they were not very useful by themselves. With the new optional chaining operator, most of these operations can be performed inline in the code.
For more information, see: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#optional-chaining
Fix ObjectMap
type usage, such that it's included in the final output package.
Breaking changes:
- Remove
tax
fromBapiPrice
for theBasketItemPrice
since BAPI won't supply that anymore soon.
Add includeHidden
parameter to categories by IDs request (corresponds to BAPI's showHidden
URL query parameter).
The tax
field on the basket total costs is not exposed anymore, as it will shortly be removed from the API responses.
The Axios adapter is now configurable.
Expose including
on /filters
endpoint
Expose id
on appropriate FilterItemWithValues
Expose id
for attributes.
Support overwriting the Checkout shop ID on basket GET
s with checkoutShopId
parameter.
Add addOrUpdateItems
method to BapiClient
that handles adding or updating of many items, including merging quantities of new items with existing ones.
Add pricePromotionKey
to every wishlist request.
Add ability to provide pricePromotionKey
when adding items to wishlist.
Expose deliveryForecast
on variant stock.
Expose availableQuantity
and deliveryForecast
on basket item.
Attribute group type
property now correctly typed as nullable to match API schema.
Reference price size
property now correctly typed as nullable to match API schema.
createProductsByIdsEndpointRequest
throws when an empty array is provided for the productIds
parameter.
BapiClient.products.getByIds
returns an empty array when an empty array is provided for the productIds
parameter, not making any network request.
pricePromotionKey
can now be set for product listing request and products by IDs queries.
Add includeHidden
parameter to product's categories
include to request hidden categories on the product.
Support childShopId
in addWishlistItemEndpointRequest
.
Set accept-encoding: gzip, deflate
in NodeJS context
Expose campaignKey
in wishlist API calls.
Rename includeSoldOutProducts
parameter to includeSoldOut
.
Allow passing custom headers to execute
.
Add search mappings endpoint.
Allow specifying includeSellableForFree
parameter on /product
endpoints
Allow specifying parameters.includeSoldOutProducts
parameter on /products
search endpoint
Allow specifying with
parameter for /filters
requests
Expose displayData
on Basket
response
Improve displayData
type, only allowing expected keys
Use CentAmount
type for range filters, as their is only 1 for prices ( …
Expose displayData
property in "create basket item" requests
Fix brands
include for search suggestions
Set sortingKey
parameter correctly (as sortingKey
) for product queries
Expose currencyCode
on price
Add search suggestions endpoint.
Add ability to set HTTP basic auth credentials.
Expose customData
property on stocks. Remove it from variants.
Refine type for BooleanFilterValue
, which can contain 0, 1, or 2 values.
Expose appliedPricePromotionKey
on variant
Expose categoryProperties
on product and allow it to be included in requests.
Enable sortingKey
for product search queries
Expose customData
property on variants
export AddToBasketFailureKind
enum
Support campaignKey
for basket requests
Expose optional priceRange
property on product entities.
The key
property is now exposed on basket responses.
A childShopId
parameter can now be passed to "add to basket" calls, which will be forward as appId
in the payload of the checkout call.
The shop ID can now be set via the header or via an URL query parameter.
Since it the URL parameter doesn't infere with CORS it's now mandatory in the SDK (and also in upcoming versions of the BAPI itself).
The execute
function by default will place the shop ID in the URL, while the BapiClient
will place the shop ID in the header to support existing BAPI installations. This might change in the future.
Respect advancedAttributes
query for variants in basket requests
Fix "Add Wishlist Item" requests
Request non-legacy image attributes by default. No specific setting needed. Now matches the types of the response in all cases.
Correct types for product image attributes (non-legacy style).
Make the shopId
optional, for cases where only a single shop ID is used and one wants to avoid CORS OPTIONS request in browser settings.
Send explicit depth
parameter for all /categories
requests. To request the whole category tree use an explicit depth exceeding the tree depth.