@scayle/storefront-core 8.1.1 → 8.1.3
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/cache/cached.d.ts +1 -1
- package/dist/helpers/arrayHelpers.d.ts +1 -1
- package/dist/helpers/filterHelper.cjs +1 -1
- package/dist/rpc/methods/checkout/checkout.cjs +1 -1
- package/dist/rpc/methods/checkout/checkout.mjs +1 -1
- package/dist/utils/log.d.ts +1 -1
- package/dist/utils/sapi.cjs +8 -1
- package/dist/utils/sapi.mjs +8 -1
- package/dist/utils/user.d.ts +3 -3
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 8.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
**Dependencies**
|
|
8
|
+
|
|
9
|
+
- Updated dependency to @scayle/storefront-api@17.14.0
|
|
10
|
+
|
|
11
|
+
## 8.1.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- **RPC Methods:** When propogating the status code from a SAPI error, only include the statusCode and statusText. Previously the headers and body were included as well which could cause content decoding issues.
|
|
16
|
+
|
|
3
17
|
## 8.1.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cache/cached.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare class Cached {
|
|
|
13
13
|
private log;
|
|
14
14
|
private prefix;
|
|
15
15
|
private enabled;
|
|
16
|
-
constructor(cache: CacheInterface, log: Log, prefix:
|
|
16
|
+
constructor(cache: CacheInterface, log: Log, prefix: string | number | undefined, enabled: boolean);
|
|
17
17
|
get isCacheEnabled(): boolean | undefined;
|
|
18
18
|
execute<TArgs extends unknown[], TResult>(fn: Fn<TArgs, TResult>, options?: CacheOptions): Awaited<Fn<TArgs, TResult>>;
|
|
19
19
|
private getCacheValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const flattenDeep: <T extends unknown[]>(array: T) => (T extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? any : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : T)[];
|
|
1
|
+
export declare const flattenDeep: <T extends unknown[]>(array: T) => (T extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? InnerArr extends readonly (infer InnerArr)[] ? /*elided*/ any : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : InnerArr : T)[];
|
|
@@ -55,7 +55,7 @@ const groupFilterableValuesByKey = (filters, filterableKeys, {
|
|
|
55
55
|
const transformedAvailableFilters = enabledFilters.reduce((availableFilters, filter) => {
|
|
56
56
|
filter.values.forEach(value => {
|
|
57
57
|
const isBoolean = filter.type === _storefrontApi.FilterTypes.BOOLEAN;
|
|
58
|
-
const hasNameInValue =
|
|
58
|
+
const hasNameInValue = "name" in value;
|
|
59
59
|
if (isBoolean && hasNameInValue && value.name === false) {
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
@@ -37,7 +37,7 @@ const getCheckoutToken = exports.getCheckoutToken = async function getCheckoutTo
|
|
|
37
37
|
carrier,
|
|
38
38
|
basketId: context.basketKey,
|
|
39
39
|
campaignKey: context.campaignKey
|
|
40
|
-
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.1.
|
|
40
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.1.3"}`).setProtectedHeader({
|
|
41
41
|
alg: "HS256",
|
|
42
42
|
typ: "JWT"
|
|
43
43
|
}).sign(secret);
|
|
@@ -35,7 +35,7 @@ export const getCheckoutToken = async function getCheckoutToken2(jwtPayload = {}
|
|
|
35
35
|
carrier,
|
|
36
36
|
basketId: context.basketKey,
|
|
37
37
|
campaignKey: context.campaignKey
|
|
38
|
-
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.1.
|
|
38
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.1.3"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
|
|
39
39
|
return {
|
|
40
40
|
accessToken: refreshedAccessToken,
|
|
41
41
|
checkoutJwt
|
package/dist/utils/log.d.ts
CHANGED
package/dist/utils/sapi.cjs
CHANGED
|
@@ -11,7 +11,14 @@ function mapSAPIFetchErrorToResponse(func) {
|
|
|
11
11
|
return await func(...args);
|
|
12
12
|
} catch (e) {
|
|
13
13
|
if (e instanceof _storefrontApi.FetchError) {
|
|
14
|
-
|
|
14
|
+
const response = e.response;
|
|
15
|
+
return Response.json({
|
|
16
|
+
statusCode: response.status,
|
|
17
|
+
statusMessage: response.statusText
|
|
18
|
+
}, {
|
|
19
|
+
status: response.status,
|
|
20
|
+
statusText: response.statusText
|
|
21
|
+
});
|
|
15
22
|
}
|
|
16
23
|
throw e;
|
|
17
24
|
}
|
package/dist/utils/sapi.mjs
CHANGED
|
@@ -5,7 +5,14 @@ export function mapSAPIFetchErrorToResponse(func) {
|
|
|
5
5
|
return await func(...args);
|
|
6
6
|
} catch (e) {
|
|
7
7
|
if (e instanceof FetchError) {
|
|
8
|
-
|
|
8
|
+
const response = e.response;
|
|
9
|
+
return Response.json({
|
|
10
|
+
statusCode: response.status,
|
|
11
|
+
statusMessage: response.statusText
|
|
12
|
+
}, {
|
|
13
|
+
status: response.status,
|
|
14
|
+
statusText: response.statusText
|
|
15
|
+
});
|
|
9
16
|
}
|
|
10
17
|
throw e;
|
|
11
18
|
}
|
package/dist/utils/user.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ export declare const mergeBaskets: (fromBasketKey: string, toBasketKey: string,
|
|
|
4
4
|
}, context: RpcContext) => Promise<{
|
|
5
5
|
type: "failure";
|
|
6
6
|
statusCode: number;
|
|
7
|
-
basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api/dist/shared/storefront-api.
|
|
7
|
+
basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api/dist/shared/storefront-api.Dgus9ezt").P, import("@scayle/storefront-api/dist/shared/storefront-api.Dgus9ezt").a>;
|
|
8
8
|
} | {
|
|
9
9
|
readonly type: "success";
|
|
10
|
-
readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api/dist/shared/storefront-api.
|
|
10
|
+
readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api/dist/shared/storefront-api.Dgus9ezt").P, import("@scayle/storefront-api/dist/shared/storefront-api.Dgus9ezt").a>;
|
|
11
11
|
} | {
|
|
12
12
|
readonly type: "failure";
|
|
13
|
-
readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api/dist/shared/storefront-api.
|
|
13
|
+
readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api/dist/shared/storefront-api.Dgus9ezt").P, import("@scayle/storefront-api/dist/shared/storefront-api.Dgus9ezt").a>;
|
|
14
14
|
readonly errors: import("@scayle/storefront-api").AddOrUpdateItemError[];
|
|
15
15
|
} | undefined>;
|
|
16
16
|
export declare const mergeWishlists: (fromWishlistKey: string, toWishlistKey: string, withOptions: BasketWithOptions, context: RpcContext) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.3",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"test:ci": "vitest --run --passWithNoTests --coverage --reporter=default --reporter=junit --outputFile=./junit.xml"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@scayle/storefront-api": "17.
|
|
74
|
+
"@scayle/storefront-api": "17.14.0",
|
|
75
75
|
"crypto-js": "^4.2.0",
|
|
76
76
|
"hookable": "^5.5.3",
|
|
77
77
|
"jose": "^5.6.3",
|
|
@@ -81,19 +81,19 @@
|
|
|
81
81
|
"utility-types": "^3.11.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@scayle/eslint-config-storefront": "4.
|
|
84
|
+
"@scayle/eslint-config-storefront": "4.4.0",
|
|
85
85
|
"@types/crypto-js": "4.2.2",
|
|
86
|
-
"@types/node": "22.10.
|
|
86
|
+
"@types/node": "22.10.5",
|
|
87
87
|
"@types/webpack-env": "1.18.5",
|
|
88
88
|
"@vitest/coverage-v8": "2.1.8",
|
|
89
|
-
"dprint": "0.
|
|
90
|
-
"eslint": "9.
|
|
89
|
+
"dprint": "0.48.0",
|
|
90
|
+
"eslint": "9.17.0",
|
|
91
91
|
"eslint-formatter-gitlab": "5.1.0",
|
|
92
92
|
"publint": "0.2.12",
|
|
93
93
|
"rimraf": "6.0.1",
|
|
94
|
-
"typescript": "5.
|
|
95
|
-
"unbuild": "2.0
|
|
96
|
-
"unstorage": "1.
|
|
94
|
+
"typescript": "5.7.2",
|
|
95
|
+
"unbuild": "3.2.0",
|
|
96
|
+
"unstorage": "1.14.4",
|
|
97
97
|
"vitest": "2.1.8"
|
|
98
98
|
}
|
|
99
99
|
}
|