@scayle/storefront-core 8.22.0 → 8.23.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 8.23.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Deprecated attribute group specific utilities `getFlattenedVariantCrosssellings` and
|
|
8
|
+
`getFlattenedMaterialComposition`.
|
|
9
|
+
|
|
10
|
+
These functions should be a part of the Storefront application.
|
|
11
|
+
|
|
3
12
|
## 8.22.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -21,6 +21,8 @@ interface FlattenedMaterialComposition {
|
|
|
21
21
|
* @param materialCompositions The material compositions to flatten.
|
|
22
22
|
*
|
|
23
23
|
* @returns An array of flattened material compositions.
|
|
24
|
+
*
|
|
25
|
+
* @deprecated Logic for flattening material compositions should be handled within the Storefront project itself.
|
|
24
26
|
*/
|
|
25
27
|
export declare const getFlattenedMaterialComposition: (materialCompositions: Array<{
|
|
26
28
|
fieldSet: FieldSet;
|
|
@@ -42,6 +44,8 @@ export declare const getFlattenedAdvancedAttribute: <T>(attributeGroup: Array<{
|
|
|
42
44
|
*
|
|
43
45
|
* @param variantCrosssellings The variant cross-selling data to flatten.
|
|
44
46
|
* @returns A generically typed array of flattened variant cross-selling data.
|
|
47
|
+
*
|
|
48
|
+
* @deprecated Logic for flattening variant crosssellings should be handled within the Storefront project itself.
|
|
45
49
|
*/
|
|
46
50
|
export declare const getFlattenedVariantCrosssellings: <T>(variantCrosssellings: Array<{
|
|
47
51
|
fieldSet: FieldSet;
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import type { Attributes, Value } from '@scayle/storefront-api';
|
|
2
|
-
|
|
3
|
-
* Retrieves the first attribute value for a given attribute name from a set of attributes.
|
|
4
|
-
*
|
|
5
|
-
* @param attributes The set of attributes.
|
|
6
|
-
* @param attributeName The name of the attribute to retrieve.
|
|
7
|
-
*
|
|
8
|
-
* @returns The first attribute value, or undefined if not found.
|
|
9
|
-
*/
|
|
10
|
-
export declare const getFirstAttributeValue: (attributes: Attributes | undefined, attributeName: string) => Value | undefined;
|
|
2
|
+
import { getAttributeValues, getFirstAttributeValue } from '@scayle/storefront-api';
|
|
11
3
|
/**
|
|
12
4
|
* Retrieves the value or label of the first attribute value for a given attribute name.
|
|
13
5
|
*
|
|
@@ -17,15 +9,6 @@ export declare const getFirstAttributeValue: (attributes: Attributes | undefined
|
|
|
17
9
|
* @returns The value or label of the first attribute value, or null if not found.
|
|
18
10
|
*/
|
|
19
11
|
export declare const getAttributeValue: (attributes: Attributes | undefined, attributeName: string) => string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves all attribute values for a given attribute name.
|
|
22
|
-
*
|
|
23
|
-
* @param attributes The set of attributes.
|
|
24
|
-
* @param attributeName The name of the attribute to retrieve.
|
|
25
|
-
*
|
|
26
|
-
* @returns An array of attribute values, or an empty array if not found.
|
|
27
|
-
*/
|
|
28
|
-
export declare const getAttributeValueTuples: (attributes: Attributes | undefined, attributeName: string) => Value[];
|
|
29
12
|
/**
|
|
30
13
|
* Retrieves the first attribute value for multiple attribute names.
|
|
31
14
|
*
|
|
@@ -35,3 +18,4 @@ export declare const getAttributeValueTuples: (attributes: Attributes | undefine
|
|
|
35
18
|
* @returns An array of attribute values, filtered to remove any null or undefined values.
|
|
36
19
|
*/
|
|
37
20
|
export declare const getManyAttributeValueTuples: (attributes: Attributes | undefined, attributeNames: string[]) => Value[];
|
|
21
|
+
export { getAttributeValues as getAttributeValueTuples, getFirstAttributeValue };
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
getAttributeValues
|
|
3
|
-
getFirstAttributeValue
|
|
2
|
+
getAttributeValues,
|
|
3
|
+
getFirstAttributeValue
|
|
4
4
|
} from "@scayle/storefront-api";
|
|
5
|
-
export const getFirstAttributeValue = (attributes, attributeName) => {
|
|
6
|
-
return _getFirstAttributeValue(attributes, attributeName);
|
|
7
|
-
};
|
|
8
5
|
export const getAttributeValue = (attributes, attributeName) => {
|
|
9
6
|
const values = getFirstAttributeValue(attributes, attributeName);
|
|
10
7
|
return values?.value ?? values?.label;
|
|
11
8
|
};
|
|
12
|
-
export const getAttributeValueTuples = (attributes, attributeName) => {
|
|
13
|
-
return _getAttributeValues(attributes, attributeName);
|
|
14
|
-
};
|
|
15
9
|
export const getManyAttributeValueTuples = (attributes, attributeNames) => {
|
|
16
10
|
return attributeNames.map((key) => getFirstAttributeValue(attributes, key)).filter((entry) => !!entry);
|
|
17
11
|
};
|
|
12
|
+
export { getAttributeValues as getAttributeValueTuples, getFirstAttributeValue };
|
|
@@ -36,7 +36,7 @@ export const getCheckoutToken = async function getCheckoutToken2(jwtPayload = {}
|
|
|
36
36
|
carrier,
|
|
37
37
|
basketId: context.basketKey,
|
|
38
38
|
campaignKey
|
|
39
|
-
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.
|
|
39
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.23.0"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
|
|
40
40
|
return {
|
|
41
41
|
accessToken: refreshedAccessToken,
|
|
42
42
|
checkoutJwt
|