@scayle/storefront-core 7.65.7 → 7.65.9
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,19 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 7.65.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
**Dependencies**
|
|
8
|
+
|
|
9
|
+
- Updated dependency to @scayle/storefront-api@17.8.1
|
|
10
|
+
|
|
11
|
+
## 7.65.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Fixed an issue with handling the deprecated MD5 hash support, e.g. used for generating a user-specific basket hash, resulting in a potential application crash
|
|
16
|
+
|
|
3
17
|
## 7.65.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -349,8 +363,8 @@
|
|
|
349
363
|
|
|
350
364
|
```ts
|
|
351
365
|
const { data: externalIDPRedirects } = await useIDP({
|
|
352
|
-
queryParams: { redirectTo:
|
|
353
|
-
})
|
|
366
|
+
queryParams: { redirectTo: '/account' },
|
|
367
|
+
})
|
|
354
368
|
```
|
|
355
369
|
|
|
356
370
|
Please note that `code` and `state` are not supported as these are used by the SCAYLE Authentication API.
|
|
@@ -967,7 +981,7 @@
|
|
|
967
981
|
|
|
968
982
|
```js
|
|
969
983
|
env: {
|
|
970
|
-
SFC_OMIT_MD5: true
|
|
984
|
+
SFC_OMIT_MD5: true
|
|
971
985
|
}
|
|
972
986
|
```
|
|
973
987
|
|
|
@@ -975,7 +989,7 @@
|
|
|
975
989
|
|
|
976
990
|
```js
|
|
977
991
|
env: {
|
|
978
|
-
SFC_OMIT_MD5: process.env.SFC_OMIT_MD5
|
|
992
|
+
SFC_OMIT_MD5: process.env.SFC_OMIT_MD5
|
|
979
993
|
}
|
|
980
994
|
```
|
|
981
995
|
|
|
@@ -1013,7 +1027,7 @@
|
|
|
1013
1027
|
|
|
1014
1028
|
```js
|
|
1015
1029
|
env: {
|
|
1016
|
-
SFC_OMIT_MD5: true
|
|
1030
|
+
SFC_OMIT_MD5: true
|
|
1017
1031
|
}
|
|
1018
1032
|
```
|
|
1019
1033
|
|
|
@@ -1021,7 +1035,7 @@
|
|
|
1021
1035
|
|
|
1022
1036
|
```js
|
|
1023
1037
|
env: {
|
|
1024
|
-
SFC_OMIT_MD5: process.env.SFC_OMIT_MD5
|
|
1038
|
+
SFC_OMIT_MD5: process.env.SFC_OMIT_MD5
|
|
1025
1039
|
}
|
|
1026
1040
|
```
|
|
1027
1041
|
|
|
@@ -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"}@${"7.65.
|
|
40
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.65.9"}`).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"}@${"7.65.
|
|
38
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.65.9"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
|
|
39
39
|
return {
|
|
40
40
|
accessToken: refreshedAccessToken,
|
|
41
41
|
checkoutJwt
|
package/dist/utils/hash.cjs
CHANGED
|
@@ -5,12 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.verifyOrderSuccessToken = exports.sha256 = exports.md5 = exports.hmac = exports.encodeBase64 = exports.decodeBase64 = exports.buildSignature = exports.buildHashPayload = void 0;
|
|
7
7
|
var _uncrypto = require("uncrypto");
|
|
8
|
+
function stringToBoolean(value, defaultValue = false) {
|
|
9
|
+
return value ? value.toLowerCase() === "true" : defaultValue;
|
|
10
|
+
}
|
|
8
11
|
const md5 = async value => {
|
|
9
|
-
if (!process.env.SFC_OMIT_MD5) {
|
|
10
|
-
const md5EncryptImport = await Promise.resolve().then(() => require("crypto-js/md5"));
|
|
11
|
-
const hexImport = await Promise.resolve().then(() => require("crypto-js/enc-hex"));
|
|
12
|
-
const md5Encrypt = md5EncryptImport.default && typeof md5EncryptImport.default === "function" ? md5EncryptImport.default : md5EncryptImport;
|
|
13
|
-
const hex = hexImport.default && typeof hexImport.default === "function" ? hexImport.default : hexImport;
|
|
12
|
+
if (!stringToBoolean(process.env.SFC_OMIT_MD5)) {
|
|
13
|
+
const md5EncryptImport = await Promise.resolve().then(() => require("crypto-js/md5.js"));
|
|
14
|
+
const hexImport = await Promise.resolve().then(() => require("crypto-js/enc-hex.js"));
|
|
15
|
+
const md5Encrypt = md5EncryptImport.default && (typeof md5EncryptImport.default === "function" || typeof md5EncryptImport.default === "object") ? md5EncryptImport.default : md5EncryptImport;
|
|
16
|
+
const hex = hexImport.default && (typeof hexImport.default === "function" || typeof hexImport.default === "object") ? hexImport.default : hexImport;
|
|
14
17
|
return hex.stringify(md5Encrypt(value));
|
|
15
18
|
} else {
|
|
16
19
|
throw Error("SFC was built without support for MD5");
|
package/dist/utils/hash.mjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { subtle } from "uncrypto";
|
|
2
|
+
function stringToBoolean(value, defaultValue = false) {
|
|
3
|
+
return value ? value.toLowerCase() === "true" : defaultValue;
|
|
4
|
+
}
|
|
2
5
|
export const md5 = async (value) => {
|
|
3
|
-
if (!process.env.SFC_OMIT_MD5) {
|
|
4
|
-
const md5EncryptImport = await import("crypto-js/md5");
|
|
5
|
-
const hexImport = await import("crypto-js/enc-hex");
|
|
6
|
-
const md5Encrypt = md5EncryptImport.default && typeof md5EncryptImport.default === "function" ? md5EncryptImport.default : md5EncryptImport;
|
|
7
|
-
const hex = hexImport.default && typeof hexImport.default === "function" ? hexImport.default : hexImport;
|
|
6
|
+
if (!stringToBoolean(process.env.SFC_OMIT_MD5)) {
|
|
7
|
+
const md5EncryptImport = await import("crypto-js/md5.js");
|
|
8
|
+
const hexImport = await import("crypto-js/enc-hex.js");
|
|
9
|
+
const md5Encrypt = md5EncryptImport.default && (typeof md5EncryptImport.default === "function" || typeof md5EncryptImport.default === "object") ? md5EncryptImport.default : md5EncryptImport;
|
|
10
|
+
const hex = hexImport.default && (typeof hexImport.default === "function" || typeof hexImport.default === "object") ? hexImport.default : hexImport;
|
|
8
11
|
return hex.stringify(md5Encrypt(value));
|
|
9
12
|
} else {
|
|
10
13
|
throw Error("SFC was built without support for MD5");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "7.65.
|
|
3
|
+
"version": "7.65.9",
|
|
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 --outputFile=./junit.xml"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@scayle/storefront-api": "17.8.
|
|
62
|
+
"@scayle/storefront-api": "17.8.1",
|
|
63
63
|
"crypto-js": "^4.2.0",
|
|
64
64
|
"hookable": "^5.5.3",
|
|
65
65
|
"jose": "^5.6.3",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@scayle/eslint-config-storefront": "4.3.2",
|
|
73
73
|
"@types/crypto-js": "4.2.2",
|
|
74
|
-
"@types/node": "20.
|
|
74
|
+
"@types/node": "20.17.0",
|
|
75
75
|
"@types/webpack-env": "1.18.5",
|
|
76
76
|
"@vitest/coverage-v8": "2.1.3",
|
|
77
|
-
"dprint": "0.47.
|
|
78
|
-
"eslint": "9.
|
|
77
|
+
"dprint": "0.47.4",
|
|
78
|
+
"eslint": "9.13.0",
|
|
79
79
|
"eslint-formatter-gitlab": "5.1.0",
|
|
80
80
|
"publint": "0.2.11",
|
|
81
81
|
"rimraf": "6.0.1",
|