@scayle/storefront-core 8.1.1 → 8.1.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
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 8.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- **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.
|
|
8
|
+
|
|
3
9
|
## 8.1.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -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.2"}`).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.2"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
|
|
39
39
|
return {
|
|
40
40
|
accessToken: refreshedAccessToken,
|
|
41
41
|
checkoutJwt
|
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
|
}
|