@scayle/storefront-core 8.61.0 → 8.61.2
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.
- package/CHANGELOG-V7.md +1 -11
- package/CHANGELOG.md +100 -103
- package/dist/api/customer.mjs +1 -3
- package/dist/api/oauth.mjs +9 -6
- package/dist/cache/providers/unstorage.mjs +1 -3
- package/dist/constants/withParameters.mjs +2 -16
- package/dist/helpers/attributeHelpers.mjs +3 -1
- package/dist/helpers/filterHelper.mjs +11 -8
- package/dist/helpers/productHelpers.mjs +1 -3
- package/dist/helpers/sanitizationHelpers.mjs +1 -4
- package/dist/helpers/sortingHelper.mjs +1 -3
- package/dist/rpc/methods/basket/basket.d.ts +2 -2
- package/dist/rpc/methods/basket/basket.mjs +334 -321
- package/dist/rpc/methods/brands.mjs +26 -20
- package/dist/rpc/methods/campaign.mjs +32 -23
- package/dist/rpc/methods/categories.mjs +156 -135
- package/dist/rpc/methods/cbd.mjs +52 -49
- package/dist/rpc/methods/checkout/checkout.mjs +42 -39
- package/dist/rpc/methods/checkout/order.mjs +46 -40
- package/dist/rpc/methods/checkout/shopUser.mjs +112 -106
- package/dist/rpc/methods/navigationTrees.mjs +50 -32
- package/dist/rpc/methods/oauth/idp.mjs +64 -55
- package/dist/rpc/methods/products.mjs +224 -212
- package/dist/rpc/methods/promotion.mjs +46 -31
- package/dist/rpc/methods/search.mjs +26 -20
- package/dist/rpc/methods/session.mjs +289 -260
- package/dist/rpc/methods/shopConfiguration.mjs +12 -9
- package/dist/rpc/methods/user.mjs +87 -78
- package/dist/rpc/methods/variants.mjs +17 -14
- package/dist/rpc/methods/wishlist.mjs +71 -62
- package/dist/utils/hash.mjs +2 -7
- package/dist/utils/sapi.mjs +10 -7
- package/package.json +4 -4
|
@@ -95,14 +95,17 @@ export const getActiveFilters = (filters, activeFilters) => {
|
|
|
95
95
|
return [].concat(...Object.values(filters)).filter((item) => isFilterActive(activeFilters, item)) || [];
|
|
96
96
|
};
|
|
97
97
|
export const groupFiltersByKey = (filters) => {
|
|
98
|
-
const groupedFilters = filters.reduce(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
acc[groupId]
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
const groupedFilters = filters.reduce(
|
|
99
|
+
(acc, item) => {
|
|
100
|
+
const groupId = item.key;
|
|
101
|
+
if (!acc[groupId]) {
|
|
102
|
+
acc[groupId] = [];
|
|
103
|
+
}
|
|
104
|
+
acc[groupId].push(item);
|
|
105
|
+
return acc;
|
|
106
|
+
},
|
|
107
|
+
{}
|
|
108
|
+
);
|
|
106
109
|
return Object.entries(groupedFilters);
|
|
107
110
|
};
|
|
108
111
|
export const transformMinAndMaxPriceToFilter = (prices) => {
|
|
@@ -50,9 +50,7 @@ export const getAllSizesFromVariants = (variantsAttributes, attributeName = "sho
|
|
|
50
50
|
const array = variantsAttributes.map(
|
|
51
51
|
(variant) => getFirstAttributeValue(variant.attributes, attributeName)
|
|
52
52
|
).filter(Boolean);
|
|
53
|
-
return [
|
|
54
|
-
...new Map(array.map((item) => [item?.id ?? item, item])).values()
|
|
55
|
-
];
|
|
53
|
+
return [...new Map(array.map((item) => [item?.id ?? item, item])).values()];
|
|
56
54
|
};
|
|
57
55
|
export const getProductSiblings = (product, colorAttributeName = "colorDetail") => {
|
|
58
56
|
if (!product) {
|
|
@@ -15,10 +15,7 @@ export const purifySensitiveData = (data = {}, blacklistedKeys = ["password", "t
|
|
|
15
15
|
(excludedKey) => key.includes(excludedKey)
|
|
16
16
|
);
|
|
17
17
|
if (isSensitiveData && value) {
|
|
18
|
-
purifiedPayload[key] = purifySensitiveValue(
|
|
19
|
-
value,
|
|
20
|
-
showFirstAndLastChar
|
|
21
|
-
);
|
|
18
|
+
purifiedPayload[key] = purifySensitiveValue(value, showFirstAndLastChar);
|
|
22
19
|
} else {
|
|
23
20
|
purifiedPayload[key] = value;
|
|
24
21
|
}
|
|
@@ -46,9 +46,7 @@ export const getSortingValues = (options = [
|
|
|
46
46
|
"reductionAsc"
|
|
47
47
|
]) => {
|
|
48
48
|
return Object.fromEntries(
|
|
49
|
-
options.filter((key) => key in SORTING_VALUES).map(
|
|
50
|
-
(key) => [key, SORTING_VALUES[key]]
|
|
51
|
-
)
|
|
49
|
+
options.filter((key) => key in SORTING_VALUES).map((key) => [key, SORTING_VALUES[key]])
|
|
52
50
|
);
|
|
53
51
|
};
|
|
54
52
|
export const getSortByValue = (query, defaultSort) => {
|
|
@@ -61,9 +61,9 @@ export declare const addItemsToBasket: RpcHandler<{
|
|
|
61
61
|
* @returns The basket data. It will return an `ErrorResponse` alternatively
|
|
62
62
|
* if no session is found or retrieving the basket fails.
|
|
63
63
|
*/
|
|
64
|
-
export declare const getBasket: RpcHandler<BasketWithOptions & {
|
|
64
|
+
export declare const getBasket: RpcHandler<(BasketWithOptions & {
|
|
65
65
|
orderCustomData?: Record<string, unknown>;
|
|
66
|
-
} | undefined, {
|
|
66
|
+
}) | undefined, {
|
|
67
67
|
basket: BasketResponseData<Product, Variant>;
|
|
68
68
|
}>;
|
|
69
69
|
/**
|