@ikas/bp-storefront 1.4.0-beta.168 → 1.4.0-beta.169

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,13 @@ export declare function getCheckoutUrlFromCartStore(cartStore: IkasCartStore): s
26
26
  /**
27
27
  * Add a product variant to the shopping cart.
28
28
  *
29
+ * Clamps the quantity to the sales channel's `minQuantityPerCart`/`maxQuantityPerCart` only
30
+ * when it creates a new cart line. When the variant already has a line in the cart, the add
31
+ * is delegated to `changeItemQuantity` (existing quantity + `initialQuantity`) with no
32
+ * client-side clamp — a quantity past `maxQuantityPerCart` is then rejected by the API with
33
+ * the `MAX_QUANTITY_PER_CART_LIMIT_REACHED` code in `result.response.errorCodes`, never as a
34
+ * `validationError`. See `changeItemQuantity` for the handling pattern.
35
+ *
29
36
  * @ai-category ProductDetail, Cart
30
37
  * @ai-related getSelectedProductVariant, findExistingCartItem, hasProductVariantStock
31
38
  *
@@ -5,6 +5,12 @@ export default interface API<T> {
5
5
  saveBulk?: (models: T[]) => Promise<APIResponse<any>>;
6
6
  delete?: (idList: string[]) => Promise<APIResponse<any>>;
7
7
  }
8
+ /**
9
+ * Error codes the SDK itself distinguishes. NOT exhaustive: the APIResponse
10
+ * constructor copies `extensions.code` from GraphQL errors verbatim, so
11
+ * `errorCodes` can carry backend codes that are not listed here (e.g.
12
+ * VARIANT_NOT_FOUND). Never build an exhaustive switch over this enum.
13
+ */
8
14
  export declare enum APIErrorCode {
9
15
  ARGUMENT_VALIDATION_ERROR = "ARGUMENT_VALIDATION_ERROR",
10
16
  UNAUTHENTICATED = "UNAUTHENTICATED",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "1.4.0-beta.168",
3
+ "version": "1.4.0-beta.169",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",