@scayle/storefront-nuxt 8.34.0 → 8.34.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/storefront-nuxt
2
2
 
3
+ ## 8.34.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependency `zod@^3.23.8` to `zod@^4.0.0`
8
+
9
+ **Dependencies**
10
+
11
+ - Updated dependency to @scayle/unstorage-compression-driver@1.0.0
12
+
13
+ **@scayle/storefront-core v8.34.1**
14
+
15
+ - No changes in this release.
16
+
3
17
  ## 8.34.0
4
18
 
5
19
  ### Patch Changes
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "8.34.0",
3
+ "version": "8.34.1",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -54,7 +54,7 @@ export default {
54
54
  }`;
55
55
  }
56
56
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
57
- const PACKAGE_VERSION = "8.34.0";
57
+ const PACKAGE_VERSION = "8.34.1";
58
58
  const logger = createConsola({
59
59
  fancy: true,
60
60
  formatOptions: {
@@ -1,4 +1,4 @@
1
- import { type Log, type CacheInterface } from '@scayle/storefront-core';
1
+ import type { Log, CacheInterface } from '@scayle/storefront-core';
2
2
  /**
3
3
  * Creates and returns a bound cached function.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import type { MaybeRefOrGetter } from 'vue';
2
2
  import type { RpcMethodParameters } from '@scayle/storefront-core';
3
- import { type UseRpcReturn } from '../core/useRpc.js';
3
+ import type { UseRpcReturn } from '../core/useRpc.js';
4
4
  /**
5
5
  * The shape of the data returned by the `getExternalIdpRedirect` RPC call.
6
6
  */
@@ -1,6 +1,7 @@
1
1
  import type { RpcContext, RpcMethodName, RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
2
- import { type AsyncDataOptions, useAsyncData } from 'nuxt/app';
3
- import { type MaybeRefOrGetter } from 'vue';
2
+ import { useAsyncData } from 'nuxt/app';
3
+ import type { AsyncDataOptions } from 'nuxt/app';
4
+ import type { MaybeRefOrGetter } from 'vue';
4
5
  /**
5
6
  * Extracts keys from a type `T` as an array of strings.
6
7
  *
@@ -1,8 +1,5 @@
1
1
  import { unwrap } from "@scayle/storefront-core/dist/utils/response";
2
- import {
3
- useNuxtApp,
4
- useAsyncData
5
- } from "nuxt/app";
2
+ import { useNuxtApp, useAsyncData } from "nuxt/app";
6
3
  import { useCoreLog } from "../useCoreLog.js";
7
4
  import { useCurrentShop } from "./useCurrentShop.js";
8
5
  import { toValue, isRef } from "vue";
@@ -1,6 +1,6 @@
1
1
  import type { ShopUser, UpdatePasswordParams } from '@scayle/storefront-core';
2
- import { type UseRpcReturn } from './useRpc.js';
3
- import { type ComputedRef } from 'vue';
2
+ import type { UseRpcReturn } from './useRpc.js';
3
+ import type { ComputedRef } from 'vue';
4
4
  /**
5
5
  * Extended parameters for the `useUser` composable.
6
6
  */
@@ -1,8 +1,8 @@
1
1
  import { generateBasketKey } from '@scayle/storefront-core/dist/utils/keys';
2
2
  import type { AddOrUpdateItemType, RpcMethodParameters, BasketResponseData, BasketItem, Product, BasketTotalPrice } from '@scayle/storefront-core';
3
3
  import { ExistingItemHandling } from '@scayle/storefront-core';
4
- import { type NormalizedRpcResponse, type UseRpcReturn } from '../core/useRpc.js';
5
- import { type MaybeRefOrGetter, type ComputedRef, type Ref } from 'vue';
4
+ import type { NormalizedRpcResponse, UseRpcReturn } from '../core/useRpc.js';
5
+ import type { MaybeRefOrGetter, ComputedRef, Ref } from 'vue';
6
6
  import type { BasketKey, BasketPackageInformation } from '@scayle/storefront-api';
7
7
  import type { BasketItemUpdateData } from '@scayle/storefront-core/dist/rpc/methods/index';
8
8
  /**
@@ -8,14 +8,9 @@ import {
8
8
  wasAddedWithReducedQuantity
9
9
  } from "@scayle/storefront-core/dist/utils/basket";
10
10
  import { extendPromise } from "../../utils/promise.js";
11
- import {
12
- useRpc
13
- } from "../core/useRpc.js";
11
+ import { useRpc } from "../core/useRpc.js";
14
12
  import { useRpcCall } from "../core/useRpcCall.js";
15
- import {
16
- toValue,
17
- computed
18
- } from "vue";
13
+ import { toValue, computed } from "vue";
19
14
  import { FetchError } from "ofetch";
20
15
  export function useBasket({
21
16
  params
@@ -1,5 +1,5 @@
1
1
  import type { MaybeRefOrGetter } from 'vue';
2
- import { type KeysOf, type NormalizedRpcResponse, type UseRpcOptions, type UseRpcReturn } from '../core/useRpc.js';
2
+ import type { KeysOf, NormalizedRpcResponse, UseRpcOptions, UseRpcReturn } from '../core/useRpc.js';
3
3
  import type { RpcMethodParameters } from '@scayle/storefront-core';
4
4
  type UseCategoriesBaseReturn<DataT, PickKeys extends KeysOf<DataT>, DefaultT> = Awaited<UseRpcReturn<'getCategoryTree', DataT, PickKeys, DefaultT>> & Promise<Awaited<UseRpcReturn<'getCategoryTree', DataT, PickKeys, DefaultT>>>;
5
5
  export declare function useCategoryTree<DataT = NormalizedRpcResponse<'getCategoryTree'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
@@ -1,6 +1,4 @@
1
- import {
2
- useRpc
3
- } from "../core/useRpc.js";
1
+ import { useRpc } from "../core/useRpc.js";
4
2
  export function useCategoryTree({
5
3
  params,
6
4
  options
@@ -1,6 +1,6 @@
1
1
  import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
2
2
  import type { AsyncDataOptions } from 'nuxt/app';
3
- import { type KeysOf, type ExtendedAsyncData } from '../core/useRpc.js';
3
+ import type { KeysOf, ExtendedAsyncData } from '../core/useRpc.js';
4
4
  import type { MaybeRefOrGetter } from 'vue';
5
5
  /**
6
6
  * Retrieves order data by ID using the `getOrderById` RPC method.
@@ -1,6 +1,6 @@
1
1
  import type { Product, WishlistItem, RpcMethodParameters } from '@scayle/storefront-core';
2
- import { type UseRpcReturn } from '../core/useRpc.js';
3
- import { type MaybeRefOrGetter, type ComputedRef } from 'vue';
2
+ import type { UseRpcReturn } from '../core/useRpc.js';
3
+ import type { MaybeRefOrGetter, ComputedRef } from 'vue';
4
4
  /**
5
5
  * Representation of options for configuring the `useWishlist` composable.
6
6
  */
@@ -1,11 +1,7 @@
1
1
  import { useNuxtApp } from "nuxt/app";
2
2
  import { useRpc } from "../core/useRpc.js";
3
3
  import { extendPromise } from "../../utils/promise.js";
4
- import {
5
- computed,
6
- toValue,
7
- toRef
8
- } from "vue";
4
+ import { computed, toValue, toRef } from "vue";
9
5
  import { useRpcCall } from "../core/useRpcCall.js";
10
6
  export function useWishlist({
11
7
  params
@@ -1,6 +1,6 @@
1
1
  import type { Session } from '@scayle/h3-session';
2
2
  import type { RuntimeConfig } from '@nuxt/schema';
3
- import { type H3Event } from 'h3';
3
+ import type { H3Event } from 'h3';
4
4
  import type { Log, RpcContext, Cache as CacheInterface } from '@scayle/storefront-core';
5
5
  import { StorefrontAPIClient } from '@scayle/storefront-core';
6
6
  import type { ShopConfig, StorefrontConfig } from '../module.js';
@@ -1,10 +1,11 @@
1
1
  import type { RuntimeConfig } from '@nuxt/schema';
2
- import type { ZodIssue } from 'zod';
2
+ import type { z } from 'zod/mini';
3
3
  /**
4
4
  * List of keys considered sensitive.
5
5
  * These keys will have their values redacted in logs.
6
6
  */
7
7
  export declare const sensitiveKeys: string[];
8
+ type ZodIssue = z.core.$ZodIssue;
8
9
  /**
9
10
  * Gets a value from a nested object using a path array.
10
11
  *
@@ -13,7 +14,7 @@ export declare const sensitiveKeys: string[];
13
14
  *
14
15
  * @returns The value at the specified path, stringified.
15
16
  */
16
- export declare const getValue: (object: Record<string | number, unknown>, pathArray: (string | number)[]) => string;
17
+ export declare const getValue: (object: Record<string | number, unknown>, pathArray: PropertyKey[]) => string;
17
18
  /**
18
19
  * Formats Zod errors for display, redacting sensitive values.
19
20
  *
@@ -28,7 +29,7 @@ export declare const getValue: (object: Record<string | number, unknown>, pathAr
28
29
  *
29
30
  * @returns An array of formatted error messages.
30
31
  */
31
- export declare const formatZodError: (issues: Array<ZodIssue>, runtimeConfig: RuntimeConfig) => (ZodIssue | {
32
+ export declare const formatZodError: (issues: Array<ZodIssue>, runtimeConfig: RuntimeConfig) => (z.core.$ZodIssue | {
32
33
  code: string;
33
34
  path: string;
34
35
  message: string;
@@ -20,8 +20,8 @@ export const formatZodError = (issues, runtimeConfig) => {
20
20
  const errorMessages = [];
21
21
  issues.forEach((issue) => {
22
22
  if (issue.code === "invalid_union") {
23
- return issue.unionErrors.forEach((unionError) => {
24
- errorMessages.push(...formatZodError(unionError.errors, runtimeConfig));
23
+ return issue.errors.forEach((unionError) => {
24
+ errorMessages.push(...formatZodError(unionError, runtimeConfig));
25
25
  });
26
26
  }
27
27
  const key = issue.path[issue.path.length - 1];
@@ -47,7 +47,7 @@ export default defineNitroPlugin(() => {
47
47
  const runtimeConfig = useRuntimeConfig();
48
48
  const { success, error } = RuntimeConfigSchema.safeParse(runtimeConfig);
49
49
  if (!success) {
50
- const errorMessages = formatZodError(error.errors, runtimeConfig);
50
+ const errorMessages = formatZodError(error.issues, runtimeConfig);
51
51
  consola.error("[storefront-nuxt] configValidation:", errorMessages);
52
52
  throw Error("[storefront-nuxt] configValidation: Runtime config invalid");
53
53
  }
@@ -1,4 +1,4 @@
1
- import { type H3Event } from 'h3';
1
+ import type { H3Event } from 'h3';
2
2
  import type { ModuleBaseOptions, PublicShopConfig, ShopConfig, ShopConfigIndexed } from '../../../module.js';
3
3
  import type { NitroRuntimeConfigApp } from 'nitropack';
4
4
  /**
@@ -1,8 +1,4 @@
1
- import {
2
- getRequestHeaders,
3
- getRequestHost,
4
- getRequestURL
5
- } from "h3";
1
+ import { getRequestHeaders, getRequestHost, getRequestURL } from "h3";
6
2
  import { joinURL } from "ufo";
7
3
  export function getBootstrapPath(url, baseUrl) {
8
4
  const queryUrl = url.searchParams.get("url");
@@ -1,10 +1,7 @@
1
1
  import { defineEventHandler, getCookie, deleteCookie, getRequestURL } from "h3";
2
2
  import { decodeJwt } from "jose";
3
3
  import { randomUUID } from "uncrypto";
4
- import {
5
- useSession,
6
- unsignCookie
7
- } from "@scayle/h3-session";
4
+ import { useSession, unsignCookie } from "@scayle/h3-session";
8
5
  import { trace, SpanStatusCode } from "@opentelemetry/api";
9
6
  import { joinURL } from "ufo";
10
7
  import { buildContext } from "../../context.js";
@@ -1,6 +1,6 @@
1
1
  import type { Log } from '@scayle/storefront-core';
2
2
  import { UnstorageCache } from '@scayle/storefront-core/dist/cache/providers/unstorage';
3
- import { type SessionStore } from '@scayle/h3-session';
3
+ import type { SessionStore } from '@scayle/h3-session';
4
4
  import type { SessionConfig } from '../../../index.js';
5
5
  export declare const STORAGE_MOUNT_BASE = "storefront";
6
6
  export declare const STORAGE_MOUNT_CACHE = "storefront-cache";
@@ -1,4 +1,4 @@
1
- import { type RpcMethods, type RpcMethodName, type RpcHandler } from '@scayle/storefront-core';
1
+ import type { RpcMethods, RpcMethodName, RpcHandler } from '@scayle/storefront-core';
2
2
  /**
3
3
  * Normalizes a rpc handler function that are not defined with `defineRpcHandler`.
4
4
  * Normalization sets the `rpcType` property to `WithParam` or `NoParam` based on the number of parameters the handler function takes.
@@ -1,6 +1,4 @@
1
- import {
2
- defineRpcHandler
3
- } from "@scayle/storefront-core";
1
+ import { defineRpcHandler } from "@scayle/storefront-core";
4
2
  export const normalizeRpcHandler = (handler) => {
5
3
  if (handler && !("rpcType" in handler)) {
6
4
  return defineRpcHandler(handler);