@scayle/storefront-core 7.59.1 → 7.59.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
|
+
## 7.59.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Resolved a memory leak within the `timeout` util where `setTimeout` might not have been garbage collected if the promise had been resolved/rejected before the timeout itself
|
|
8
|
+
|
|
3
9
|
## 7.59.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -31,7 +31,7 @@ const getCheckoutToken = exports.getCheckoutToken = async function getCheckoutTo
|
|
|
31
31
|
carrier,
|
|
32
32
|
basketId: context.basketKey,
|
|
33
33
|
campaignKey: context.campaignKey
|
|
34
|
-
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.59.
|
|
34
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.59.2"}`).setProtectedHeader({
|
|
35
35
|
alg: "HS256",
|
|
36
36
|
typ: "JWT"
|
|
37
37
|
}).sign(secret);
|
|
@@ -21,7 +21,7 @@ export const getCheckoutToken = async function getCheckoutToken2(jwtPayload = {}
|
|
|
21
21
|
carrier,
|
|
22
22
|
basketId: context.basketKey,
|
|
23
23
|
campaignKey: context.campaignKey
|
|
24
|
-
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.59.
|
|
24
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"7.59.2"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
|
|
25
25
|
return {
|
|
26
26
|
accessToken: refreshedAccessToken,
|
|
27
27
|
checkoutJwt
|
package/dist/utils/timeout.cjs
CHANGED
|
@@ -9,9 +9,10 @@ const wait = ms => {
|
|
|
9
9
|
};
|
|
10
10
|
exports.wait = wait;
|
|
11
11
|
const timeout = (ms, promise) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
let pendingTimeout;
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
pendingTimeout = setTimeout(() => reject(new Error("timeout")), ms);
|
|
15
|
+
promise.then(resolve, reject);
|
|
16
|
+
}).finally(() => clearTimeout(pendingTimeout));
|
|
16
17
|
};
|
|
17
18
|
exports.timeout = timeout;
|
package/dist/utils/timeout.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const wait: (ms: number) => Promise<unknown>;
|
|
2
|
-
export declare const timeout: (ms: number, promise: Promise<
|
|
2
|
+
export declare const timeout: <T>(ms: number, promise: Promise<T>) => Promise<T>;
|
package/dist/utils/timeout.mjs
CHANGED
|
@@ -2,8 +2,9 @@ export const wait = (ms) => {
|
|
|
2
2
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
3
3
|
};
|
|
4
4
|
export const timeout = (ms, promise) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let pendingTimeout;
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
pendingTimeout = setTimeout(() => reject(new Error("timeout")), ms);
|
|
8
|
+
promise.then(resolve, reject);
|
|
9
|
+
}).finally(() => clearTimeout(pendingTimeout));
|
|
9
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "7.59.
|
|
3
|
+
"version": "7.59.2",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"@types/crypto-js": "4.2.2",
|
|
75
75
|
"@types/node": "20.14.10",
|
|
76
76
|
"@types/webpack-env": "1.18.5",
|
|
77
|
-
"@vitest/coverage-v8": "2.0.
|
|
77
|
+
"@vitest/coverage-v8": "2.0.3",
|
|
78
78
|
"dprint": "0.47.2",
|
|
79
|
-
"eslint": "9.
|
|
79
|
+
"eslint": "9.7.0",
|
|
80
80
|
"eslint-formatter-gitlab": "5.1.0",
|
|
81
81
|
"publint": "0.2.8",
|
|
82
82
|
"rimraf": "6.0.1",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"typescript": "5.5.3",
|
|
85
85
|
"unbuild": "2.0.0",
|
|
86
86
|
"unstorage": "1.10.2",
|
|
87
|
-
"vitest": "2.0.
|
|
87
|
+
"vitest": "2.0.3"
|
|
88
88
|
},
|
|
89
89
|
"optionalDependencies": {
|
|
90
90
|
"redis": "4"
|