@scayle/storefront-core 7.49.0 → 7.49.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.md +14 -0
- package/dist/helpers/advancedAttributeHelpers.cjs +10 -6
- package/dist/helpers/advancedAttributeHelpers.d.ts +5 -1
- package/dist/helpers/advancedAttributeHelpers.mjs +7 -4
- package/dist/rpc/methods/wishlist.cjs +7 -5
- package/dist/rpc/methods/wishlist.mjs +3 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 7.49.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed a bug where the `addItemToWishlist` RPC method returned an empty response upon failure.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @aboutyou/backbone@16.2.2
|
|
10
|
+
|
|
11
|
+
## 7.49.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Fix accidental rename of `getFlattenedVariantCrosssellings` in the previous release
|
|
16
|
+
|
|
3
17
|
## 7.49.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getFlattenedMaterialComposition = exports.
|
|
6
|
+
exports.getFlattenedVariantCrosssellings = exports.getFlattenedMaterialComposition = exports.getFlattenedAdvancedAttribute = exports.flattenFieldSet = void 0;
|
|
7
7
|
var _arrayHelpers = require("./arrayHelpers.cjs");
|
|
8
8
|
var _objectHelpers = require("./objectHelpers.cjs");
|
|
9
9
|
const flattenFieldSet = fieldSet => {
|
|
@@ -17,10 +17,14 @@ const getFlattenedMaterialComposition = materialCompositions => {
|
|
|
17
17
|
}));
|
|
18
18
|
};
|
|
19
19
|
exports.getFlattenedMaterialComposition = getFlattenedMaterialComposition;
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
...(0, _arrayHelpers.flattenDeep)(flattenFieldSet(
|
|
23
|
-
values: (0, _arrayHelpers.flattenDeep)(
|
|
20
|
+
const getFlattenedAdvancedAttribute = attributeGroup => {
|
|
21
|
+
return attributeGroup.map(groupItem => ({
|
|
22
|
+
...(0, _arrayHelpers.flattenDeep)(flattenFieldSet(groupItem.fieldSet))[0],
|
|
23
|
+
values: (0, _arrayHelpers.flattenDeep)(groupItem.groupSet.map(g => flattenFieldSet(g.fieldSet)))
|
|
24
24
|
}));
|
|
25
25
|
};
|
|
26
|
-
exports.
|
|
26
|
+
exports.getFlattenedAdvancedAttribute = getFlattenedAdvancedAttribute;
|
|
27
|
+
const getFlattenedVariantCrosssellings = variantCrosssellings => {
|
|
28
|
+
return getFlattenedAdvancedAttribute(variantCrosssellings);
|
|
29
|
+
};
|
|
30
|
+
exports.getFlattenedVariantCrosssellings = getFlattenedVariantCrosssellings;
|
|
@@ -6,7 +6,11 @@ export declare const getFlattenedMaterialComposition: (materialCompositions: Arr
|
|
|
6
6
|
fieldSet: FieldSet;
|
|
7
7
|
groupSet: GroupSet;
|
|
8
8
|
}>) => object[];
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const getFlattenedAdvancedAttribute: <T>(attributeGroup: Array<{
|
|
10
|
+
fieldSet: FieldSet;
|
|
11
|
+
groupSet: GroupSet;
|
|
12
|
+
}>) => T[];
|
|
13
|
+
export declare const getFlattenedVariantCrosssellings: <T>(variantCrosssellings: Array<{
|
|
10
14
|
fieldSet: FieldSet;
|
|
11
15
|
groupSet: GroupSet;
|
|
12
16
|
}>) => T[];
|
|
@@ -11,11 +11,14 @@ export const getFlattenedMaterialComposition = (materialCompositions) => {
|
|
|
11
11
|
)
|
|
12
12
|
}));
|
|
13
13
|
};
|
|
14
|
-
export const
|
|
15
|
-
return
|
|
16
|
-
...flattenDeep(flattenFieldSet(
|
|
14
|
+
export const getFlattenedAdvancedAttribute = (attributeGroup) => {
|
|
15
|
+
return attributeGroup.map((groupItem) => ({
|
|
16
|
+
...flattenDeep(flattenFieldSet(groupItem.fieldSet))[0],
|
|
17
17
|
values: flattenDeep(
|
|
18
|
-
|
|
18
|
+
groupItem.groupSet.map((g) => flattenFieldSet(g.fieldSet))
|
|
19
19
|
)
|
|
20
20
|
}));
|
|
21
21
|
};
|
|
22
|
+
export const getFlattenedVariantCrosssellings = (variantCrosssellings) => {
|
|
23
|
+
return getFlattenedAdvancedAttribute(variantCrosssellings);
|
|
24
|
+
};
|
|
@@ -52,15 +52,17 @@ const addItemToWishlist = exports.addItemToWishlist = async function addItemToWi
|
|
|
52
52
|
pricePromotionKey
|
|
53
53
|
});
|
|
54
54
|
if (result.type === "success") {
|
|
55
|
-
return
|
|
55
|
+
return result.wishlist;
|
|
56
56
|
} else {
|
|
57
57
|
const {
|
|
58
|
-
code,
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
statusCode: code,
|
|
59
|
+
kind,
|
|
60
|
+
type
|
|
61
|
+
} = result;
|
|
61
62
|
context.log.error("Adding to wishlist failed", result.wishlist);
|
|
62
63
|
return new Response(JSON.stringify({
|
|
63
|
-
|
|
64
|
+
kind,
|
|
65
|
+
type
|
|
64
66
|
}), {
|
|
65
67
|
status: code
|
|
66
68
|
});
|
|
@@ -33,11 +33,11 @@ export const addItemToWishlist = async function addItemToWishlist2(options, cont
|
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
35
|
if (result.type === "success") {
|
|
36
|
-
return
|
|
36
|
+
return result.wishlist;
|
|
37
37
|
} else {
|
|
38
|
-
const { code,
|
|
38
|
+
const { statusCode: code, kind, type } = result;
|
|
39
39
|
context.log.error("Adding to wishlist failed", result.wishlist);
|
|
40
|
-
return new Response(JSON.stringify({
|
|
40
|
+
return new Response(JSON.stringify({ kind, type }), { status: code });
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
export const removeItemFromWishlist = async function removeItemFromWishlist2(options, context) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "7.49.
|
|
3
|
+
"version": "7.49.2",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"test:ci": "vitest --run --passWithNoTests --coverage --reporter=default --reporter=junit"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@aboutyou/backbone": "16.2.
|
|
62
|
+
"@aboutyou/backbone": "16.2.2",
|
|
63
63
|
"crypto-js": "4.2.0",
|
|
64
64
|
"jose": "5.2.4",
|
|
65
65
|
"radash": "12.1.0",
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"@types/crypto-js": "4.2.2",
|
|
74
74
|
"@types/node": "20.12.7",
|
|
75
75
|
"@types/webpack-env": "1.18.4",
|
|
76
|
-
"@vitest/coverage-v8": "1.5.
|
|
76
|
+
"@vitest/coverage-v8": "1.5.2",
|
|
77
77
|
"dprint": "0.45.1",
|
|
78
|
-
"eslint": "9.
|
|
78
|
+
"eslint": "9.1.1",
|
|
79
79
|
"eslint-formatter-gitlab": "5.1.0",
|
|
80
80
|
"publint": "0.2.7",
|
|
81
81
|
"rimraf": "5.0.5",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"typescript": "5.4.5",
|
|
84
84
|
"unbuild": "2.0.0",
|
|
85
85
|
"unstorage": "1.10.2",
|
|
86
|
-
"vitest": "1.5.
|
|
86
|
+
"vitest": "1.5.2"
|
|
87
87
|
},
|
|
88
88
|
"optionalDependencies": {
|
|
89
89
|
"redis": "4"
|