@scayle/storefront-core 7.67.1 → 7.69.0

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/index.cjs +1 -43
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.mjs +1 -7
  5. package/dist/rpc/methods/basket/basket.cjs +8 -8
  6. package/dist/rpc/methods/basket/basket.mjs +8 -8
  7. package/dist/rpc/methods/brands.cjs +4 -4
  8. package/dist/rpc/methods/brands.d.ts +2 -2
  9. package/dist/rpc/methods/brands.mjs +4 -4
  10. package/dist/rpc/methods/categories.cjs +9 -9
  11. package/dist/rpc/methods/categories.d.ts +1 -1
  12. package/dist/rpc/methods/categories.mjs +9 -9
  13. package/dist/rpc/methods/checkout/checkout.cjs +1 -1
  14. package/dist/rpc/methods/checkout/checkout.mjs +1 -1
  15. package/dist/rpc/methods/navigationTrees.cjs +3 -3
  16. package/dist/rpc/methods/navigationTrees.d.ts +3 -3
  17. package/dist/rpc/methods/navigationTrees.mjs +3 -3
  18. package/dist/rpc/methods/products.cjs +19 -19
  19. package/dist/rpc/methods/products.d.ts +4 -4
  20. package/dist/rpc/methods/products.mjs +19 -19
  21. package/dist/rpc/methods/promotion.cjs +6 -6
  22. package/dist/rpc/methods/promotion.mjs +6 -6
  23. package/dist/rpc/methods/search.cjs +9 -9
  24. package/dist/rpc/methods/search.d.ts +3 -3
  25. package/dist/rpc/methods/search.mjs +9 -9
  26. package/dist/rpc/methods/shopConfiguration.cjs +2 -2
  27. package/dist/rpc/methods/shopConfiguration.d.ts +1 -1
  28. package/dist/rpc/methods/shopConfiguration.mjs +2 -2
  29. package/dist/rpc/methods/variants.cjs +2 -2
  30. package/dist/rpc/methods/variants.d.ts +1 -1
  31. package/dist/rpc/methods/variants.mjs +2 -2
  32. package/dist/rpc/methods/wishlist.cjs +6 -6
  33. package/dist/rpc/methods/wishlist.mjs +6 -6
  34. package/dist/test/factories/index.cjs +16 -0
  35. package/dist/test/factories/index.d.ts +1 -0
  36. package/dist/test/factories/index.mjs +1 -0
  37. package/dist/types/api/context.d.ts +1 -1
  38. package/dist/utils/user.cjs +8 -8
  39. package/dist/utils/user.d.ts +3 -3
  40. package/dist/utils/user.mjs +8 -8
  41. package/package.json +14 -2
@@ -1,7 +1,7 @@
1
1
  import { ExistingItemHandling } from "../constants/index.mjs";
2
2
  export const mergeBaskets = async (fromBasketKey, toBasketKey, withOptions, context) => {
3
- const { bapiClient, campaignKey } = context;
4
- const fromOriginBasket = await bapiClient.basket.get(fromBasketKey, {
3
+ const { sapiClient, campaignKey } = context;
4
+ const fromOriginBasket = await sapiClient.basket.get(fromBasketKey, {
5
5
  with: withOptions,
6
6
  campaignKey,
7
7
  orderCustomData: withOptions.orderCustomData
@@ -23,7 +23,7 @@ export const mergeBaskets = async (fromBasketKey, toBasketKey, withOptions, cont
23
23
  pricePromotionKey: withOptions.pricePromotionKey
24
24
  }
25
25
  }));
26
- const mergedBasket = await bapiClient.basket.addOrUpdateItems(
26
+ const mergedBasket = await sapiClient.basket.addOrUpdateItems(
27
27
  toBasketKey,
28
28
  itemsToAddOrUpdate,
29
29
  {
@@ -37,14 +37,14 @@ export const mergeBaskets = async (fromBasketKey, toBasketKey, withOptions, cont
37
37
  }
38
38
  );
39
39
  fromBasket.items.map(async (item) => {
40
- return await bapiClient.basket.deleteItem(fromBasketKey, item.key);
40
+ return await sapiClient.basket.deleteItem(fromBasketKey, item.key);
41
41
  });
42
42
  return mergedBasket;
43
43
  }
44
44
  };
45
45
  export const mergeWishlists = async (fromWishlistKey, toWishlistKey, withOptions, context) => {
46
- const { bapiClient, campaignKey } = context;
47
- const oldWishlist = await bapiClient.wishlist.get(fromWishlistKey, {
46
+ const { sapiClient, campaignKey } = context;
47
+ const oldWishlist = await sapiClient.wishlist.get(fromWishlistKey, {
48
48
  with: withOptions,
49
49
  campaignKey
50
50
  });
@@ -53,7 +53,7 @@ export const mergeWishlists = async (fromWishlistKey, toWishlistKey, withOptions
53
53
  for (const item of oldWishlist.items) {
54
54
  const { productId, variantId } = item;
55
55
  if (productId || variantId) {
56
- await bapiClient.wishlist.addItem(
56
+ await sapiClient.wishlist.addItem(
57
57
  toWishlistKey,
58
58
  {
59
59
  ...variantId ? { variantId } : { productId }
@@ -64,7 +64,7 @@ export const mergeWishlists = async (fromWishlistKey, toWishlistKey, withOptions
64
64
  ...item.customData && Object.keys(item.customData).length ? { customData: item.customData } : void 0
65
65
  }
66
66
  );
67
- bapiClient.wishlist.deleteItem(fromWishlistKey, item?.key);
67
+ sapiClient.wishlist.deleteItem(fromWishlistKey, item?.key);
68
68
  }
69
69
  }
70
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "7.67.1",
3
+ "version": "7.69.0",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -24,6 +24,18 @@
24
24
  "require": "./dist/server.cjs",
25
25
  "default": "./dist/server.cjs"
26
26
  },
27
+ "./dist/test/factories": {
28
+ "types": "./dist/test/factories/index.d.ts",
29
+ "import": "./dist/test/factories/index.mjs",
30
+ "require": "./dist/test/factories/index.cjs",
31
+ "default": "./dist/test/factories/index.cjs"
32
+ },
33
+ "./test/factories": {
34
+ "types": "./dist/test/factories/index.d.ts",
35
+ "import": "./dist/test/factories/index.mjs",
36
+ "require": "./dist/test/factories/index.cjs",
37
+ "default": "./dist/test/factories/index.cjs"
38
+ },
27
39
  "./dist/*": {
28
40
  "types": "./dist/*.d.ts",
29
41
  "import": "./dist/*.mjs",
@@ -59,7 +71,7 @@
59
71
  "test:ci": "vitest --run --passWithNoTests --coverage --reporter=default --reporter=junit --outputFile=./junit.xml"
60
72
  },
61
73
  "dependencies": {
62
- "@scayle/storefront-api": "17.10.1",
74
+ "@scayle/storefront-api": "17.11.0",
63
75
  "crypto-js": "^4.2.0",
64
76
  "hookable": "^5.5.3",
65
77
  "jose": "^5.6.3",