@scayle/omnichannel-nuxt 4.5.0 → 4.6.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,11 @@
1
1
  # @scayle/omnichannel-nuxt
2
2
 
3
+ ## 4.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **[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.
8
+
3
9
  ## 4.5.0
4
10
 
5
11
  ### Minor Changes
@@ -153,7 +159,7 @@
153
159
  refreshStoreVariant,
154
160
  variantStoresData,
155
161
  refreshVariantStores,
156
- } = useStoreLocator('useStoreLocator', ['openingTimes', 'settings'])
162
+ } = useStoreLocator("useStoreLocator", ["openingTimes", "settings"]);
157
163
  ```
158
164
 
159
165
  ## 2.1.4
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.0",
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.0";
5
5
  const module$1 = defineNuxtModule({
6
6
  meta: {
7
7
  name: PACKAGE_NAME,
@@ -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,7 +18,7 @@ function getOmnichannelConfig(runtimeConfig) {
17
18
  } : {}
18
19
  };
19
20
  }
20
- export const getStores = async function getStores2(options, context) {
21
+ export const getStores = defineRpcHandler(async (options, context) => {
21
22
  const storeLocator = getOmnichannelConfig(
22
23
  context.runtimeConfiguration
23
24
  );
@@ -26,8 +27,8 @@ export const getStores = async function getStores2(options, context) {
26
27
  throw new Error(noClientMessage);
27
28
  }
28
29
  return await omnichannelClient.getStores(options);
29
- };
30
- export const getStoresForVariant = async function getStoresForVariant2(options, context) {
30
+ }, { method: "GET" });
31
+ export const getStoresForVariant = defineRpcHandler(async (options, context) => {
31
32
  const storeLocator = getOmnichannelConfig(
32
33
  context.runtimeConfiguration
33
34
  );
@@ -42,8 +43,8 @@ export const getStoresForVariant = async function getStoresForVariant2(options,
42
43
  throw new Error(noClientMessage);
43
44
  }
44
45
  return await omnichannelClient.getStoresForVariant(fetchOptions);
45
- };
46
- export const getStoreVariantById = async function getStoreVariantById2(options, context) {
46
+ }, { method: "GET" });
47
+ export const getStoreVariantById = defineRpcHandler(async (options, context) => {
47
48
  const storeLocator = getOmnichannelConfig(
48
49
  context.runtimeConfiguration
49
50
  );
@@ -52,4 +53,4 @@ export const getStoreVariantById = async function getStoreVariantById2(options,
52
53
  throw new Error(noClientMessage);
53
54
  }
54
55
  return await omnichannelClient.getStoreVariantById(options);
55
- };
56
+ }, { method: "GET" });
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.0",
4
4
  "description": "Collection of essential utilities to work with omnichannel",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -50,22 +50,21 @@
50
50
  "@arethetypeswrong/cli": "0.18.2",
51
51
  "@nuxt/module-builder": "1.0.2",
52
52
  "@nuxt/schema": "^3.20.2",
53
+ "@scayle/eslint-config-storefront": "^4.8.0",
53
54
  "@types/node": "22.19.17",
54
55
  "@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",
56
+ "@vitest/coverage-v8": "4.1.5",
57
+ "eslint-formatter-gitlab": "7.1.0",
58
+ "eslint": "10.2.1",
59
+ "h3": "1.15.11",
60
60
  "nuxt": "^3.20.2",
61
61
  "publint": "0.3.18",
62
62
  "typescript": "5.9.3",
63
63
  "unbuild": "3.6.1",
64
- "vitest": "4.1.2",
64
+ "vitest": "4.1.5",
65
65
  "vue-tsc": "3.2.6",
66
66
  "vue": "3.5.32",
67
- "@scayle/storefront-nuxt": "8.60.0",
68
- "@scayle/eslint-config-storefront": "4.8.0",
67
+ "@scayle/storefront-nuxt": "8.61.0",
69
68
  "@scayle/vitest-config-storefront": "1.0.0"
70
69
  },
71
70
  "scripts": {
@@ -74,16 +73,11 @@
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
  }