@scayle/storefront-nuxt 7.61.5 → 7.62.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,18 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.62.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `useProductsByReferenceKeys` composable
8
+ Add `useCategoryById` composable
9
+
10
+ ### Patch Changes
11
+
12
+ - Do not throw error in `useRpc`. This is the reversion of a change introduced in 7.61.5. If you need a thrown error when a `useRpc` request fails, check the `error` property returned by `useRpc` and `throw` it.
13
+ - Updated dependencies
14
+ - @scayle/storefront-core@7.46.0
15
+
3
16
  ## 7.61.5
4
17
 
5
18
  ### Patch Changes
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.9.0"
6
6
  },
7
- "version": "7.61.4"
7
+ "version": "7.61.5"
8
8
  }
@@ -66,9 +66,6 @@ export const useRpc = async (method, key, params, options = { autoFetch: true, l
66
66
  options.lazy ? fetch() : await fetch();
67
67
  }
68
68
  }
69
- if (data.value === void 0 && error.value) {
70
- throw createError(error.value);
71
- }
72
69
  return {
73
70
  data,
74
71
  fetching,
@@ -0,0 +1,16 @@
1
+ import type { RpcMethodParameters } from '@scayle/storefront-core';
2
+ import type { RpcOptions } from '../core/useRpc';
3
+ import type { MaybeRefOrGetter } from '#imports';
4
+ type Options = Partial<{
5
+ params: MaybeRefOrGetter<RpcMethodParameters<'getCategoryById'>>;
6
+ options: RpcOptions;
7
+ key: string;
8
+ }>;
9
+ export declare function useCategoryById({ params, options, key, }?: Options): Promise<{
10
+ data: import("vue").Ref<import("@scayle/storefront-core").Category | undefined>;
11
+ fetching: import("vue").Ref<boolean>;
12
+ fetch: () => Promise<void>;
13
+ error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
14
+ status: import("vue").Ref<import("../core/useRpc").Status>;
15
+ }>;
16
+ export {};
@@ -0,0 +1,20 @@
1
+ import { useRpc } from "../core/useRpc.mjs";
2
+ export async function useCategoryById({
3
+ params,
4
+ options,
5
+ key = "useCategoryById"
6
+ } = {}) {
7
+ const { data, fetching, fetch, error, status } = await useRpc(
8
+ "getCategoryById",
9
+ key,
10
+ params,
11
+ options
12
+ );
13
+ return {
14
+ data,
15
+ fetching,
16
+ fetch,
17
+ error,
18
+ status
19
+ };
20
+ }
@@ -0,0 +1,16 @@
1
+ import { type RpcMethodParameters } from '@scayle/storefront-core';
2
+ import { type RpcOptions } from '../core/useRpc';
3
+ import { type MaybeRefOrGetter } from '#imports';
4
+ type Options = Partial<{
5
+ params: MaybeRefOrGetter<RpcMethodParameters<'getProductsByReferenceKeys'>>;
6
+ options: RpcOptions;
7
+ key: string;
8
+ }>;
9
+ export declare function useProductsByReferenceKeys({ params, options, key, }?: Options): Promise<{
10
+ data: import("vue").Ref<import("@scayle/storefront-core").Product[] | undefined>;
11
+ fetching: import("vue").Ref<boolean>;
12
+ fetch: () => Promise<void>;
13
+ error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
14
+ status: import("vue").Ref<import("../core/useRpc").Status>;
15
+ }>;
16
+ export {};
@@ -0,0 +1,20 @@
1
+ import { useRpc } from "../core/useRpc.mjs";
2
+ export async function useProductsByReferenceKeys({
3
+ params,
4
+ options,
5
+ key = "useProductsByReferenceKeys"
6
+ } = {}) {
7
+ const { data, fetching, fetch, error, status } = await useRpc(
8
+ "getProductsByReferenceKeys",
9
+ key,
10
+ params,
11
+ options
12
+ );
13
+ return {
14
+ data,
15
+ fetching,
16
+ fetch,
17
+ error,
18
+ status
19
+ };
20
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.61.5",
4
+ "version": "7.62.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,7 +62,7 @@
62
62
  "dependencies": {
63
63
  "@nuxt/kit": "3.10.3",
64
64
  "@scayle/h3-session": "0.3.5",
65
- "@scayle/storefront-core": "7.45.0",
65
+ "@scayle/storefront-core": "7.46.0",
66
66
  "@scayle/unstorage-compression-driver": "0.1.2",
67
67
  "@vueuse/core": "10.9.0",
68
68
  "consola": "3.2.3",
@@ -74,7 +74,7 @@
74
74
  "ofetch": "1.3.3",
75
75
  "radash": "12.1.0",
76
76
  "uncrypto": "0.1.3",
77
- "unstorage": "1.10.1",
77
+ "unstorage": "1.10.2",
78
78
  "vue-router": "4.3.0",
79
79
  "yn": "5.0.0"
80
80
  },