@scayle/storefront-nuxt 8.34.0 → 8.35.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.
Files changed (29) hide show
  1. package/CHANGELOG-V7.md +1 -1
  2. package/CHANGELOG.md +31 -3
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +1 -1
  5. package/dist/runtime/cached.d.ts +1 -1
  6. package/dist/runtime/composables/core/useIDP.d.ts +1 -1
  7. package/dist/runtime/composables/core/useRpc.d.ts +3 -2
  8. package/dist/runtime/composables/core/useRpc.js +1 -4
  9. package/dist/runtime/composables/core/useUser.d.ts +2 -2
  10. package/dist/runtime/composables/storefront/useBasket.d.ts +2 -2
  11. package/dist/runtime/composables/storefront/useBasket.js +2 -7
  12. package/dist/runtime/composables/storefront/useCategoryTree.d.ts +1 -1
  13. package/dist/runtime/composables/storefront/useCategoryTree.js +1 -3
  14. package/dist/runtime/composables/storefront/useOrder.d.ts +1 -1
  15. package/dist/runtime/composables/storefront/useWishlist.d.ts +2 -2
  16. package/dist/runtime/composables/storefront/useWishlist.js +1 -5
  17. package/dist/runtime/context.d.ts +1 -1
  18. package/dist/runtime/nitro/plugins/configValidation.d.ts +4 -3
  19. package/dist/runtime/nitro/plugins/configValidation.js +3 -3
  20. package/dist/runtime/nitro/plugins/internalFetch.d.ts +1 -1
  21. package/dist/runtime/server/middleware/bootstrap-utils.d.ts +1 -1
  22. package/dist/runtime/server/middleware/bootstrap-utils.js +1 -5
  23. package/dist/runtime/server/middleware/bootstrap.js +1 -4
  24. package/dist/runtime/server/utils/cacheStorage.d.ts +1 -1
  25. package/dist/runtime/utils/rpc.d.ts +1 -1
  26. package/dist/runtime/utils/rpc.js +1 -3
  27. package/dist/runtime/utils/zodSchema.d.ts +985 -2470
  28. package/dist/runtime/utils/zodSchema.js +76 -69
  29. package/package.json +10 -9
package/CHANGELOG-V7.md CHANGED
@@ -1184,7 +1184,7 @@ For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.
1184
1184
 
1185
1185
  ### Patch Changes
1186
1186
 
1187
- - Fix the type of unitialized data in `useBasket` and `useWishlist`
1187
+ - Fix the type of uninitialized data in `useBasket` and `useWishlist`
1188
1188
 
1189
1189
  When the request for the basket/wishlist has not completed or has failed, the `data` property is `undefined`. In the previous release this was inadvertently changed to `null`. Now it is once again `undefined`.
1190
1190
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 8.35.0
4
+
5
+ ### Patch Changes
6
+
7
+ **Dependencies**
8
+
9
+ **@scayle/storefront-core v8.35.0**
10
+
11
+ - Minor
12
+ - Removed optional key `fbook` from `ShopUser` interface
13
+ - Renamed incorrectly formatted function `getBackurlFromBreadcrumbs` to `getBackURLFromBreadcrumbs`
14
+ - Patch
15
+ - Renamed interface incorrectly named `IdenfitierFilterItemWithValues` to `IdentifierFilterItemWithValues`
16
+
17
+ ## 8.34.1
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependency `zod@^3.23.8` to `zod@^4.0.0`
22
+
23
+ **Dependencies**
24
+
25
+ - Updated dependency to @scayle/unstorage-compression-driver@1.0.0
26
+
27
+ **@scayle/storefront-core v8.34.1**
28
+
29
+ - No changes in this release.
30
+
3
31
  ## 8.34.0
4
32
 
5
33
  ### Patch Changes
@@ -609,7 +637,7 @@
609
637
  - `FilterItemWithValues`
610
638
  - `BooleanFilterItemWithValues`
611
639
  - `RangeFilterItemWithValues`
612
- - `IdenfitierFilterItemWithValues`
640
+ - `IdentifierFilterItemWithValues`
613
641
  - `AttributesFilterValue`
614
642
 
615
643
  ## 8.20.1
@@ -1314,7 +1342,7 @@
1314
1342
  ### Patch Changes
1315
1343
 
1316
1344
  - Removed dependency `@nuxt/kit@^3.12.2`
1317
- - Fixed misspelling of interface `BaskteItemDisplayDataItem` to `BasketItemDisplayDataItem`
1345
+ - Fixed misspelling of interface `BasketItemDisplayDataItem` to `BasketItemDisplayDataItem`
1318
1346
 
1319
1347
  **Dependencies**
1320
1348
 
@@ -1625,7 +1653,7 @@
1625
1653
  }
1626
1654
  ```
1627
1655
 
1628
- - **\[💥 BREAKING\]** The `store` option in the module configuration has been removed. scayle/storefront-nuxt@7.84.0` introduced the `shops` option as a replacement, but maintained backward compatibility with the `store` option. Going forward, configuring shops must be done using the `shops` keyword.
1656
+ - **\[💥 BREAKING\]** The `store` option in the module configuration has been removed. `@scayle/storefront-nuxt@7.84.0` introduced the `shops` option as a replacement, but maintained backward compatibility with the `store` option. Going forward, configuring shops must be done using the `shops` keyword.
1629
1657
 
1630
1658
  - For more information, please refer to the [documentation](https://scayle.dev/en/storefront-guide/developer-guide/basic-setup/introduction#shops).
1631
1659
  - **NOTE:** These changes might impact your environment variables used for deployments. Please check your infrastructure and deployment setup and adapt accordingly!
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.35.0",
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.35.0";
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
  }
@@ -9,7 +9,7 @@ declare module 'h3' {
9
9
  * Nitro includes an `event.$fetch` function for internal fetch requests to allow sharing the headers and
10
10
  * context across requests. However, as of 2.11.7, the context is no longer shared, just the headers. As our
11
11
  * bootstrapping depends on this behavior, we create a custom function with the pre-2.11.7 behavior. This enables
12
- * compability with 2.11.7 as well as earlier versions.
12
+ * compatibility with 2.11.7 as well as earlier versions.
13
13
  *
14
14
  * @see https://nitro.build/guide/plugins
15
15
  *
@@ -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);