@scayle/omnichannel-nuxt 4.5.0 → 4.6.1

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/omnichannel-nuxt
2
2
 
3
+ ## 4.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - **\[Security\]** Use the patched Nuxt for build — `nuxt@3.21.8` (3.x) / `nuxt@4.4.8` (4.x), with matching `@nuxt/kit` and `@nuxt/schema` — which includes the fix for [CVE-2026-53721](https://nvd.nist.gov/vuln/detail/CVE-2026-53721) ([GHSA-mm7m-92g8-7m47](https://github.com/nuxt/nuxt/security/advisories/GHSA-mm7m-92g8-7m47)), a route-rule middleware bypass.
8
+
9
+ Compatibility with previously-supported Nuxt versions is unchanged and remains specified via each package's `peerDependencies` and the Nuxt compatibility flag. `@scayle/storefront-core` is released in lockstep with `@scayle/storefront-nuxt`.
10
+
11
+ ## 4.6.0
12
+
13
+ ### Minor Changes
14
+
15
+ - **[RPC]** Updated built-in RPC methods to use `GET` for safe, cacheable reads and `PUT`/`POST`/`DELETE` for mutations, enabling CDN and browser caching for public data fetches.
16
+
3
17
  ## 4.5.0
4
18
 
5
19
  ### Minor Changes
@@ -14,7 +28,6 @@
14
28
 
15
29
  - Introduced support for Nuxt 4 while maintaining full backward compatibility with Nuxt 3.
16
30
  This enables consumers to migrate to Nuxt 4 ahead of the Nuxt 3 end of support on 31 Jan 2026.
17
-
18
31
  - **Version Requirements:**
19
32
  - Nuxt 3: `v3.13.0+`
20
33
  - Nuxt 4: `v4.2.0+`
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/omnichannel-nuxt",
3
- "version": "4.5.0",
3
+ "version": "4.6.1",
4
4
  "configKey": "@scayle/omnichannel-nuxt",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineNuxtModule, isNuxtMajorVersion, createResolver, addImportsDir } from '@nuxt/kit';
2
2
 
3
3
  const PACKAGE_NAME = "@scayle/omnichannel-nuxt";
4
- const PACKAGE_VERSION = "4.5.0";
4
+ const PACKAGE_VERSION = "4.6.1";
5
5
  const module$1 = defineNuxtModule({
6
6
  meta: {
7
7
  name: PACKAGE_NAME,
@@ -48,9 +48,7 @@ export class OmnichannelClient {
48
48
  const response = await fetch(`${this.host}/stores/locator?${params}`, {
49
49
  headers: this.headers
50
50
  });
51
- return await this.handleResponse(
52
- response
53
- );
51
+ return await this.handleResponse(response);
54
52
  }
55
53
  async getStoresForVariant(options) {
56
54
  const fetchOptions = {
@@ -62,19 +60,25 @@ export class OmnichannelClient {
62
60
  perPage: 10,
63
61
  with: options.with
64
62
  };
65
- const params = qs.stringify({
66
- ...fetchOptions,
67
- with: options.with?.map((property) => `store.${property}`)
68
- }, { arrayFormat: "comma" });
63
+ const params = qs.stringify(
64
+ {
65
+ ...fetchOptions,
66
+ with: options.with?.map((property) => `store.${property}`)
67
+ },
68
+ { arrayFormat: "comma" }
69
+ );
69
70
  const response = await fetch(`${this.host}/variants/locator?${params}`, {
70
71
  headers: this.headers
71
72
  });
72
73
  return await this.handleResponse(response);
73
74
  }
74
75
  async getStoreVariantById(options) {
75
- const params = qs.stringify({
76
- with: options.with?.map((property) => `store.${property}`)
77
- }, { arrayFormat: "comma" });
76
+ const params = qs.stringify(
77
+ {
78
+ with: options.with?.map((property) => `store.${property}`)
79
+ },
80
+ { arrayFormat: "comma" }
81
+ );
78
82
  const response = await fetch(
79
83
  `${this.host}/stores/${options.storeId}/variants/${options.variantId}?${params}`,
80
84
  { headers: this.headers }
@@ -1,5 +1,4 @@
1
- import type { RpcContext } from '@scayle/storefront-nuxt';
2
- import type { StoreLocatorSearchParams, FetchStoreVariantByIdParams, VariantLocationResponse, StoreAvailabilityCheckResponse, StoreLocationResponse, GetStoresForVariantOptions } from '../types/index.js';
3
- export declare const getStores: (options: StoreLocatorSearchParams, context: RpcContext) => Promise<StoreLocationResponse>;
4
- export declare const getStoresForVariant: (options: GetStoresForVariantOptions, context: RpcContext) => Promise<VariantLocationResponse>;
5
- export declare const getStoreVariantById: (options: FetchStoreVariantByIdParams, context: RpcContext) => Promise<StoreAvailabilityCheckResponse>;
1
+ import type { StoreLocatorSearchParams, FetchStoreVariantByIdParams, GetStoresForVariantOptions } from '../types/index.js';
2
+ export declare const getStores: import("@scayle/storefront-core").ParamRpcHandler<StoreLocatorSearchParams, import("../types/index.js").StoreLocationResponse>;
3
+ export declare const getStoresForVariant: import("@scayle/storefront-core").ParamRpcHandler<GetStoresForVariantOptions, import("../types/index.js").VariantLocationResponse>;
4
+ export declare const getStoreVariantById: import("@scayle/storefront-core").ParamRpcHandler<FetchStoreVariantByIdParams, import("../types/index.js").StoreAvailabilityCheckResponse>;
@@ -1,3 +1,4 @@
1
+ import { defineRpcHandler } from "@scayle/storefront-nuxt";
1
2
  import { init } from "../lib/init.js";
2
3
  const noClientMessage = "Client not configured";
3
4
  function getOmnichannelConfig(runtimeConfig) {
@@ -17,39 +18,48 @@ function getOmnichannelConfig(runtimeConfig) {
17
18
  } : {}
18
19
  };
19
20
  }
20
- export const getStores = async function getStores2(options, context) {
21
- const storeLocator = getOmnichannelConfig(
22
- context.runtimeConfiguration
23
- );
24
- const omnichannelClient = init(storeLocator);
25
- if (!omnichannelClient) {
26
- throw new Error(noClientMessage);
27
- }
28
- return await omnichannelClient.getStores(options);
29
- };
30
- export const getStoresForVariant = async function getStoresForVariant2(options, context) {
31
- const storeLocator = getOmnichannelConfig(
32
- context.runtimeConfiguration
33
- );
34
- const fetchOptions = {
35
- filters: options.filters,
36
- variantId: options.variantId,
37
- perPage: 10,
38
- with: options.with
39
- };
40
- const omnichannelClient = init(storeLocator);
41
- if (!omnichannelClient) {
42
- throw new Error(noClientMessage);
43
- }
44
- return await omnichannelClient.getStoresForVariant(fetchOptions);
45
- };
46
- export const getStoreVariantById = async function getStoreVariantById2(options, context) {
47
- const storeLocator = getOmnichannelConfig(
48
- context.runtimeConfiguration
49
- );
50
- const omnichannelClient = init(storeLocator);
51
- if (!omnichannelClient) {
52
- throw new Error(noClientMessage);
53
- }
54
- return await omnichannelClient.getStoreVariantById(options);
55
- };
21
+ export const getStores = defineRpcHandler(
22
+ async (options, context) => {
23
+ const storeLocator = getOmnichannelConfig(
24
+ context.runtimeConfiguration
25
+ );
26
+ const omnichannelClient = init(storeLocator);
27
+ if (!omnichannelClient) {
28
+ throw new Error(noClientMessage);
29
+ }
30
+ return await omnichannelClient.getStores(options);
31
+ },
32
+ { method: "GET" }
33
+ );
34
+ export const getStoresForVariant = defineRpcHandler(
35
+ async (options, context) => {
36
+ const storeLocator = getOmnichannelConfig(
37
+ context.runtimeConfiguration
38
+ );
39
+ const fetchOptions = {
40
+ filters: options.filters,
41
+ variantId: options.variantId,
42
+ perPage: 10,
43
+ with: options.with
44
+ };
45
+ const omnichannelClient = init(storeLocator);
46
+ if (!omnichannelClient) {
47
+ throw new Error(noClientMessage);
48
+ }
49
+ return await omnichannelClient.getStoresForVariant(fetchOptions);
50
+ },
51
+ { method: "GET" }
52
+ );
53
+ export const getStoreVariantById = defineRpcHandler(
54
+ async (options, context) => {
55
+ const storeLocator = getOmnichannelConfig(
56
+ context.runtimeConfiguration
57
+ );
58
+ const omnichannelClient = init(storeLocator);
59
+ if (!omnichannelClient) {
60
+ throw new Error(noClientMessage);
61
+ }
62
+ return await omnichannelClient.getStoreVariantById(options);
63
+ },
64
+ { method: "GET" }
65
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/omnichannel-nuxt",
3
- "version": "4.5.0",
3
+ "version": "4.6.1",
4
4
  "description": "Collection of essential utilities to work with omnichannel",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -49,41 +49,35 @@
49
49
  "devDependencies": {
50
50
  "@arethetypeswrong/cli": "0.18.2",
51
51
  "@nuxt/module-builder": "1.0.2",
52
- "@nuxt/schema": "^3.20.2",
53
- "@types/node": "22.19.17",
54
- "@types/qs": "6.15.0",
55
- "@vitest/coverage-v8": "4.1.2",
56
- "dprint": "0.53.2",
57
- "eslint-formatter-gitlab": "7.0.1",
58
- "eslint": "10.2.0",
59
- "h3": "1.15.10",
60
- "nuxt": "^3.20.2",
61
- "publint": "0.3.18",
62
- "typescript": "5.9.3",
52
+ "@nuxt/schema": "^3.21.7",
53
+ "@scayle/eslint-config-storefront": "^4.8.0",
54
+ "@types/node": "24.12.2",
55
+ "@types/qs": "6.15.1",
56
+ "@vitest/coverage-v8": "4.1.9",
57
+ "eslint-formatter-gitlab": "7.1.0",
58
+ "eslint": "10.5.0",
59
+ "h3": "1.15.11",
60
+ "nuxt": "^3.21.7",
61
+ "publint": "0.3.21",
62
+ "typescript": "6.0.3",
63
63
  "unbuild": "3.6.1",
64
- "vitest": "4.1.2",
65
- "vue-tsc": "3.2.6",
66
- "vue": "3.5.32",
67
- "@scayle/storefront-nuxt": "8.60.0",
68
- "@scayle/eslint-config-storefront": "4.8.0",
64
+ "vitest": "4.1.9",
65
+ "vue-tsc": "3.3.5",
66
+ "vue": "3.5.38",
67
+ "@scayle/storefront-nuxt": "8.62.1",
69
68
  "@scayle/vitest-config-storefront": "1.0.0"
70
69
  },
71
70
  "scripts": {
72
- "clean": "rimraf ./dist",
71
+ "clean": "node -e \"require('fs').rmSync('./dist',{recursive:true,force:true})\"",
73
72
  "build": "nuxt-module-build build",
74
73
  "dev": "nuxt dev playground",
75
74
  "dev:build": "nuxt build playground",
76
75
  "prep": "nuxt-module-build prepare && nuxt prepare playground",
77
- "format": "dprint check",
78
- "format:fix": "dprint fmt",
79
76
  "lint": "eslint .",
80
77
  "lint:ci": "eslint . --format gitlab",
81
78
  "lint:fix": "eslint . --fix",
82
79
  "package:lint": "publint",
83
80
  "verify-packaging": "attw --pack . --profile esm-only",
84
- "typecheck": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
85
- "test": "vitest --run --passWithNoTests",
86
- "test:watch": "vitest --passWithNoTests",
87
- "test:ci": "vitest --run --passWithNoTests --coverage --reporter=default --reporter=junit --outputFile=./coverage/junit.xml"
81
+ "typecheck": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
88
82
  }
89
83
  }