@scayle/storefront-nuxt 7.61.5 → 7.62.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,26 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.62.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Revert breaking change in `handleIDPLoginCallback` signature
8
+ - Updated dependencies
9
+ - @scayle/storefront-core@7.46.1
10
+
11
+ ## 7.62.0
12
+
13
+ ### Minor Changes
14
+
15
+ - Add `useProductsByReferenceKeys` composable
16
+ Add `useCategoryById` composable
17
+
18
+ ### Patch Changes
19
+
20
+ - 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.
21
+ - Updated dependencies
22
+ - @scayle/storefront-core@7.46.0
23
+
3
24
  ## 7.61.5
4
25
 
5
26
  ### 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.62.0"
8
8
  }
@@ -6,7 +6,11 @@ export default defineEventHandler(async (event) => {
6
6
  const pathComponents = event.path.split("?")[0].split("/");
7
7
  const method = pathComponents[pathComponents.length - 1];
8
8
  const body = await readBody(event);
9
- const payloadToBeLogged = JSON.stringify(purifySensitiveData(body?.payload));
9
+ const payloadToBeLogged = JSON.stringify(
10
+ purifySensitiveData(
11
+ typeof body?.payload !== "object" ? { [typeof body?.payload]: body?.payload } : body?.payload
12
+ )
13
+ );
10
14
  event.context.$rpcContext.log.space("sfc").debug(`RPC Handler: ${method}, Payload: ${payloadToBeLogged}`);
11
15
  try {
12
16
  return await handler(method, body?.payload, event.context.$rpcContext);
@@ -6,7 +6,7 @@ export declare const useIDP: () => Promise<{
6
6
  fetch: () => Promise<void>;
7
7
  error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | undefined>;
8
8
  status: import("vue").Ref<import("../core/useRpc").Status>;
9
- handleIDPLoginCallback: (params: {
9
+ handleIDPLoginCallback: (params: string | {
10
10
  code: string;
11
11
  }) => Promise<{
12
12
  message: string;
@@ -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,
@@ -20,7 +20,7 @@ export declare function useSession(): {
20
20
  success: false;
21
21
  }>;
22
22
  resetPasswordByHash: (params: import("utility-types").Optional<import("@scayle/storefront-core").UpdatePasswordByHashRequest, "shop_id">) => Promise<never>;
23
- loginWithIDP: (params: {
23
+ loginWithIDP: (params: string | {
24
24
  code: string;
25
25
  }) => Promise<{
26
26
  message: string;
@@ -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.1",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -62,29 +62,29 @@
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.1",
66
66
  "@scayle/unstorage-compression-driver": "0.1.2",
67
67
  "@vueuse/core": "10.9.0",
68
68
  "consola": "3.2.3",
69
- "core-js": "3.36.0",
69
+ "core-js": "3.36.1",
70
70
  "defu": "6.1.4",
71
71
  "jose": "^5.2.0",
72
72
  "knitwork": "1.0.0",
73
- "nitropack": "2.9.3",
73
+ "nitropack": "2.9.4",
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
  },
81
81
  "devDependencies": {
82
82
  "@nuxt/module-builder": "0.5.5",
83
83
  "@nuxt/schema": "3.10.3",
84
- "@nuxt/test-utils": "3.11.0",
84
+ "@nuxt/test-utils": "3.12.0",
85
85
  "@scayle/eslint-config-storefront": "3.2.6",
86
86
  "@scayle/prettier-config-storefront": "2.0.2",
87
- "@types/node": "20.11.28",
87
+ "@types/node": "20.11.30",
88
88
  "eslint": "8.57.0",
89
89
  "eslint-formatter-gitlab": "5.1.0",
90
90
  "h3": "1.11.1",
@@ -92,8 +92,8 @@
92
92
  "nuxt": "3.10.3",
93
93
  "prettier": "3.0.0",
94
94
  "publint": "0.2.7",
95
- "vitest": "1.3.1",
96
- "vue-tsc": "2.0.6"
95
+ "vitest": "1.4.0",
96
+ "vue-tsc": "2.0.7"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "h3": "^1.10.0",