@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 +14 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/lib/init.js +14 -10
- package/dist/runtime/rpc/storeLocator.d.ts +4 -5
- package/dist/runtime/rpc/storeLocator.js +46 -36
- package/package.json +18 -24
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
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.
|
|
4
|
+
const PACKAGE_VERSION = "4.6.1";
|
|
5
5
|
const module$1 = defineNuxtModule({
|
|
6
6
|
meta: {
|
|
7
7
|
name: PACKAGE_NAME,
|
package/dist/runtime/lib/init.js
CHANGED
|
@@ -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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
77
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
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 =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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.
|
|
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.
|
|
53
|
-
"@
|
|
54
|
-
"@types/
|
|
55
|
-
"@
|
|
56
|
-
"
|
|
57
|
-
"eslint-formatter-gitlab": "7.0
|
|
58
|
-
"eslint": "10.
|
|
59
|
-
"h3": "1.15.
|
|
60
|
-
"nuxt": "^3.
|
|
61
|
-
"publint": "0.3.
|
|
62
|
-
"typescript": "
|
|
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.
|
|
65
|
-
"vue-tsc": "3.
|
|
66
|
-
"vue": "3.5.
|
|
67
|
-
"@scayle/storefront-nuxt": "8.
|
|
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": "
|
|
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
|
}
|