@scayle/storefront-nuxt 7.38.0 → 7.39.0

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,23 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.39.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Redirects should use the cache provider configured for the shop
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @scayle/storefront-core@7.25.1
13
+
14
+ ## 7.38.1
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+ - @scayle/storefront-core@7.25.0
20
+
3
21
  ## 7.38.0
4
22
 
5
23
  ### Minor Changes
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.7.0"
6
6
  },
7
- "version": "7.37.2"
7
+ "version": "7.38.1"
8
8
  }
@@ -1,4 +1,5 @@
1
- import { Cache as CacheInterface, Log } from '@scayle/storefront-core';
1
+ import { Log } from '@scayle/storefront-core';
2
+ import { UnstorageCache } from '@scayle/storefront-core/dist/cache/providers/unstorage';
2
3
  import { RedisConfig, StorageProvider } from '../../../types/module';
3
4
  /**
4
5
  * Create an unstorage-backed cache interface
@@ -9,4 +10,4 @@ import { RedisConfig, StorageProvider } from '../../../types/module';
9
10
  */
10
11
  export declare function createCache(provider: StorageProvider, prefix: string, log: Log, options?: {
11
12
  redis?: RedisConfig;
12
- }): CacheInterface;
13
+ }): UnstorageCache;
@@ -1,6 +1,6 @@
1
1
  import { sendRedirect, getRequestURL } from "h3";
2
+ import { UnstorageCache } from "@scayle/storefront-core/dist/cache/providers/unstorage";
2
3
  import { getRedirectLookupUrls, getTargetLocation } from "./redirects.utils.mjs";
3
- import { createCache } from "./cache.mjs";
4
4
  import { useRuntimeConfig } from "#imports";
5
5
  const REDIS_REDIRECT_PREFIX = ":REDIRECT";
6
6
  const REDIRECT_NOT_SET = "REDIRECT_NOT_SET";
@@ -46,13 +46,11 @@ export async function useRedirects(event) {
46
46
  xForwardedProto: true,
47
47
  xForwardedHost: true
48
48
  });
49
- const currentShop = event.context.$currentShop;
50
49
  const log = event.context.$rpcContext.log.space("sfc").space("redirects");
51
- const redirectCache = createCache(
52
- "redis",
53
- currentShop.shopId + REDIS_REDIRECT_PREFIX,
54
- log,
55
- { redis: $storefrontConfig.redis }
50
+ const shopCache = event.context.$cache;
51
+ const redirectCache = new UnstorageCache(
52
+ shopCache.storage,
53
+ shopCache.prefix + REDIS_REDIRECT_PREFIX
56
54
  );
57
55
  const bapiClient = event.context.$rpcContext.bapiClient;
58
56
  const queryParamWhitelist = new Set(options?.queryParamWhitelist ?? []);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.38.0",
4
+ "version": "7.39.0",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -62,8 +62,8 @@
62
62
  "dependencies": {
63
63
  "@nuxt/kit": "3.7.4",
64
64
  "@scayle/h3-session": "0.3.4",
65
- "@scayle/storefront-core": "7.24.1",
66
- "@vueuse/core": "10.5.0",
65
+ "@scayle/storefront-core": "7.25.1",
66
+ "@vueuse/core": "10.6.1",
67
67
  "consola": "3.2.3",
68
68
  "core-js": "3.33.2",
69
69
  "defu": "6.1.3",
@@ -88,7 +88,7 @@
88
88
  "nuxt": "3.7.4",
89
89
  "prettier": "3.0.0",
90
90
  "publint": "0.2.5",
91
- "unstorage": "1.9.0",
91
+ "unstorage": "1.10.1",
92
92
  "vitest": "0.34.6",
93
93
  "vue-tsc": "1.8.22"
94
94
  },