@scayle/storefront-nuxt 8.62.7 → 8.62.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 +28 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/server/middleware/redirects.js +7 -3
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.62.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed the redirects middleware applying the cached redirect of one URL to every URL that differs from it only in its query params. With `redirects.queryParamWhitelist` set, `/sale?campaign=summer`, `/sale?campaign=winter` and `/sale` shared one redirect cache entry, because unstorage cuts a key at the first `?`. Whichever URL was looked up first decided the result for all of them until the entry expired, so the bare page could get a campaign redirect, and a cached "no redirect" hid the redirect of another campaign. Each lookup URL now has its own cache entry.
|
|
8
|
+
|
|
9
|
+
The middleware also no longer follows a cached redirect whose target is the requested URL. With the shared entry, a redirect from `/search?query=trousers` to `/search?query=pants` sent every search to `?query=pants`, which then redirected to itself.
|
|
10
|
+
|
|
11
|
+
**Dependencies**
|
|
12
|
+
|
|
13
|
+
**@scayle/storefront-core v8.62.9**
|
|
14
|
+
|
|
15
|
+
- No changes in this release.
|
|
16
|
+
|
|
17
|
+
## 8.62.8
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependency `zod@^4.4.3` to `zod@^4.6.7`
|
|
22
|
+
- Raised the minimum supported versions of the `nuxt` and `@nuxt/kit` peer dependencies to `3.15.0` on the Nuxt 3 line. The module registers server templates with `addServerTemplate`, which `@nuxt/kit` provides from `3.15.0` on, so the module could not run on Nuxt 3.10 to 3.14. The ranges for Nuxt 4 stay the same.
|
|
23
|
+
- Raised the `zod` dependency to `^4.6.7`. Versions below `4.6.6` are affected by CVE-2023-54404.
|
|
24
|
+
|
|
25
|
+
**Dependencies**
|
|
26
|
+
|
|
27
|
+
**@scayle/storefront-core v8.62.8**
|
|
28
|
+
|
|
29
|
+
- No changes in this release.
|
|
30
|
+
|
|
3
31
|
## 8.62.7
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -6,12 +6,16 @@ const REDIS_REDIRECT_PREFIX = ":REDIRECT";
|
|
|
6
6
|
const REDIRECT_NOT_SET = "REDIRECT_NOT_SET";
|
|
7
7
|
const REDIRECT_CACHE_TTL = 120;
|
|
8
8
|
async function fetchRedirectWithCache(sourceUrl, storefrontAPIClient, redirectCache, log, waitUntil) {
|
|
9
|
+
const cacheKey = encodeURIComponent(sourceUrl);
|
|
9
10
|
try {
|
|
10
|
-
const cachedResult = await redirectCache.get(
|
|
11
|
+
const cachedResult = await redirectCache.get(cacheKey);
|
|
11
12
|
if (cachedResult) {
|
|
12
13
|
if (cachedResult === REDIRECT_NOT_SET) {
|
|
13
14
|
return null;
|
|
14
15
|
}
|
|
16
|
+
if (cachedResult.target === sourceUrl) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
15
19
|
return cachedResult;
|
|
16
20
|
}
|
|
17
21
|
} catch (e) {
|
|
@@ -32,13 +36,13 @@ async function fetchRedirectWithCache(sourceUrl, storefrontAPIClient, redirectCa
|
|
|
32
36
|
};
|
|
33
37
|
if (!sapiResult || !isValidRedirect(sapiResult)) {
|
|
34
38
|
waitUntil(
|
|
35
|
-
redirectCache.set(
|
|
39
|
+
redirectCache.set(cacheKey, REDIRECT_NOT_SET, REDIRECT_CACHE_TTL).catch((e) => log.error("Error saving redirect to cache", e))
|
|
36
40
|
);
|
|
37
41
|
return null;
|
|
38
42
|
}
|
|
39
43
|
waitUntil(
|
|
40
44
|
redirectCache.set(
|
|
41
|
-
|
|
45
|
+
cacheKey,
|
|
42
46
|
{
|
|
43
47
|
target: sapiResult.target,
|
|
44
48
|
statusCode: sapiResult.statusCode
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.62.
|
|
4
|
+
"version": "8.62.9",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -67,19 +67,19 @@
|
|
|
67
67
|
"node": ">= 22.0.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@nuxt/kit": ">=3.
|
|
70
|
+
"@nuxt/kit": ">=3.15.0 || >=4.2.0",
|
|
71
71
|
"@scayle/storefront-api": "^19.2.1",
|
|
72
72
|
"fishery": "^2.2.2",
|
|
73
73
|
"h3": "^1.10.0",
|
|
74
74
|
"nitropack": "^2.9.7",
|
|
75
|
-
"nuxt": ">=3.
|
|
75
|
+
"nuxt": ">=3.15.0 || >=4.2.2",
|
|
76
76
|
"unstorage": "^1.10.1",
|
|
77
77
|
"vue": "^3.4.0"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@opentelemetry/api": "^1.9.1",
|
|
81
81
|
"@scayle/h3-session": "0.7.2",
|
|
82
|
-
"@scayle/storefront-core": "8.62.
|
|
82
|
+
"@scayle/storefront-core": "8.62.9",
|
|
83
83
|
"@scayle/unstorage-compression-driver": "1.6.0",
|
|
84
84
|
"@vercel/nft": "1.11.0",
|
|
85
85
|
"@vueuse/core": "15.0.0",
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
"jose": "^6.0.8",
|
|
92
92
|
"knitwork": "^1.3.0",
|
|
93
93
|
"ofetch": "^1.5.1",
|
|
94
|
-
"schema-dts": "
|
|
94
|
+
"schema-dts": "2.1.0",
|
|
95
95
|
"ufo": "^1.5.4",
|
|
96
96
|
"uncrypto": "^0.1.3",
|
|
97
|
-
"unstorage": "1.17.
|
|
97
|
+
"unstorage": "1.17.6",
|
|
98
98
|
"utility-types": "^3.11.0",
|
|
99
99
|
"vue-router": "4.6.4",
|
|
100
|
-
"zod": "^4.
|
|
100
|
+
"zod": "^4.6.7"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@arethetypeswrong/cli": "0.18.5",
|
|
@@ -112,21 +112,21 @@
|
|
|
112
112
|
"@scayle/unstorage-scayle-kv-driver": "^3.0.0",
|
|
113
113
|
"@scayle/vitest-config-storefront": "1.0.0",
|
|
114
114
|
"@types/node": "^24",
|
|
115
|
-
"@vitest/coverage-v8": "5.0.
|
|
116
|
-
"eslint": "10.
|
|
115
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
116
|
+
"eslint": "10.14.0",
|
|
117
117
|
"eslint-formatter-gitlab": "7.2.0",
|
|
118
118
|
"fishery": "2.4.0",
|
|
119
119
|
"h3": "1.15.11",
|
|
120
|
-
"happy-dom": "
|
|
120
|
+
"happy-dom": "21.0.4",
|
|
121
121
|
"nitro-test-utils": "0.11.2",
|
|
122
|
-
"nitropack": "2.13.
|
|
122
|
+
"nitropack": "2.13.5",
|
|
123
123
|
"node-mocks-http": "1.18.1",
|
|
124
124
|
"nuxt": "^3.21.10",
|
|
125
125
|
"publint": "0.3.25",
|
|
126
126
|
"typescript": "6.0.3",
|
|
127
127
|
"unbuild": "3.6.1",
|
|
128
|
-
"vitest": "5.0.
|
|
129
|
-
"vue-tsc": "3.3.
|
|
128
|
+
"vitest": "5.0.5",
|
|
129
|
+
"vue-tsc": "3.3.14"
|
|
130
130
|
},
|
|
131
131
|
"scripts": {
|
|
132
132
|
"build": "nuxt-module-build build",
|