@scayle/storefront-nuxt 8.53.2 → 8.53.3

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 (60) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -1
  4. package/dist/runtime/composables/core/useIDP.d.ts +2 -2
  5. package/dist/runtime/composables/core/useRpc.d.ts +5 -1
  6. package/dist/runtime/composables/core/useRpc.js +1 -0
  7. package/dist/runtime/composables/core/useUser.d.ts +2 -2
  8. package/dist/runtime/composables/core/useUser.js +2 -2
  9. package/dist/runtime/composables/index.d.ts +1 -1
  10. package/dist/runtime/composables/storefront/useBasket.d.ts +2 -3
  11. package/dist/runtime/composables/storefront/useBasket.js +5 -3
  12. package/dist/runtime/composables/storefront/useBrand.d.ts +2 -2
  13. package/dist/runtime/composables/storefront/useBrand.js +3 -1
  14. package/dist/runtime/composables/storefront/useBrands.d.ts +2 -2
  15. package/dist/runtime/composables/storefront/useBrands.js +3 -1
  16. package/dist/runtime/composables/storefront/useCampaign.d.ts +2 -2
  17. package/dist/runtime/composables/storefront/useCampaign.js +3 -1
  18. package/dist/runtime/composables/storefront/useCategories.d.ts +2 -2
  19. package/dist/runtime/composables/storefront/useCategories.js +3 -1
  20. package/dist/runtime/composables/storefront/useCategoryById.d.ts +2 -2
  21. package/dist/runtime/composables/storefront/useCategoryById.js +3 -1
  22. package/dist/runtime/composables/storefront/useCategoryByPath.d.ts +2 -2
  23. package/dist/runtime/composables/storefront/useCategoryByPath.js +3 -1
  24. package/dist/runtime/composables/storefront/useCategoryTree.d.ts +2 -2
  25. package/dist/runtime/composables/storefront/useCategoryTree.js +3 -1
  26. package/dist/runtime/composables/storefront/useCurrentPromotions.d.ts +2 -2
  27. package/dist/runtime/composables/storefront/useCurrentPromotions.js +6 -4
  28. package/dist/runtime/composables/storefront/useFilters.d.ts +2 -2
  29. package/dist/runtime/composables/storefront/useFilters.js +3 -1
  30. package/dist/runtime/composables/storefront/useNavigationTree.d.ts +3 -3
  31. package/dist/runtime/composables/storefront/useNavigationTree.js +3 -1
  32. package/dist/runtime/composables/storefront/useNavigationTrees.d.ts +2 -2
  33. package/dist/runtime/composables/storefront/useNavigationTrees.js +3 -1
  34. package/dist/runtime/composables/storefront/useOrder.d.ts +2 -2
  35. package/dist/runtime/composables/storefront/useOrder.js +3 -1
  36. package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +2 -2
  37. package/dist/runtime/composables/storefront/useOrderConfirmation.js +3 -1
  38. package/dist/runtime/composables/storefront/useProduct.d.ts +2 -2
  39. package/dist/runtime/composables/storefront/useProduct.js +3 -1
  40. package/dist/runtime/composables/storefront/useProducts.d.ts +2 -2
  41. package/dist/runtime/composables/storefront/useProducts.js +3 -1
  42. package/dist/runtime/composables/storefront/useProductsByIds.d.ts +2 -2
  43. package/dist/runtime/composables/storefront/useProductsByIds.js +3 -1
  44. package/dist/runtime/composables/storefront/useProductsByReferenceKeys.d.ts +2 -2
  45. package/dist/runtime/composables/storefront/useProductsByReferenceKeys.js +3 -1
  46. package/dist/runtime/composables/storefront/useProductsCount.d.ts +2 -2
  47. package/dist/runtime/composables/storefront/useProductsCount.js +3 -1
  48. package/dist/runtime/composables/storefront/usePromotions.d.ts +2 -2
  49. package/dist/runtime/composables/storefront/usePromotions.js +3 -1
  50. package/dist/runtime/composables/storefront/usePromotionsByIds.d.ts +2 -2
  51. package/dist/runtime/composables/storefront/usePromotionsByIds.js +3 -1
  52. package/dist/runtime/composables/storefront/useShopConfiguration.d.ts +2 -2
  53. package/dist/runtime/composables/storefront/useShopConfiguration.js +3 -1
  54. package/dist/runtime/composables/storefront/useUserAddresses.d.ts +2 -2
  55. package/dist/runtime/composables/storefront/useUserAddresses.js +3 -1
  56. package/dist/runtime/composables/storefront/useVariant.d.ts +2 -2
  57. package/dist/runtime/composables/storefront/useVariant.js +3 -1
  58. package/dist/runtime/composables/storefront/useWishlist.d.ts +2 -2
  59. package/dist/runtime/types/module.d.ts +5 -1
  60. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,95 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 8.53.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Enhanced data fetching composables to support reactive keys, aligning with [Nuxt 3.17 data fetching improvements](https://nuxt.com/blog/v3-17#data-fetching-improvements).
8
+
9
+ You can now pass a `ref`, `computed`, or getter function as the `key` parameter to `useRpc` and derived composables (like `useProducts`, `useBrand` etc.). When the reactive key changes, the data will automatically re-fetch.
10
+
11
+ - **Before:** Keys were static strings.
12
+ - **After:** Keys can be reactive, enabling dynamic caching and automatic updates.
13
+
14
+ ```ts
15
+ // Before
16
+ const { data } = await useRpc('getProduct', 'my-static-product-key', {
17
+ productId: 123,
18
+ })
19
+
20
+ // After
21
+ const productId = ref(123)
22
+
23
+ // The key is now reactive. If `productId` changes, the key updates
24
+ // to 'product-456' (for example) and triggers a new fetch.
25
+ const { data } = await useRpc(
26
+ 'getProduct',
27
+ () => `product-${productId.value}`,
28
+ { productId },
29
+ )
30
+ ```
31
+
32
+ - Deprecated the `CheckoutEvent` type, which will be removed in the next major version.
33
+
34
+ This type has been moved to the Storefront Application to better align with application-specific tracking requirements.
35
+
36
+ If you are currently importing `CheckoutEvent` from `@scayle/storefront-nuxt`, you should migrate to using the type definition from the Storefront Application or define it locally in your codebase.
37
+
38
+ The type definition remains unchanged, so you can copy it directly:
39
+
40
+ ```ts
41
+ import type { ShopUser } from '@scayle/storefront-nuxt'
42
+
43
+ export interface CheckoutEvent {
44
+ /** Action. */
45
+ action?: 'authenticated'
46
+ /** Type. */
47
+ type?: 'tracking'
48
+ /** User. */
49
+ user: ShopUser
50
+ /**
51
+ * The OAuth 2.0 access token for the authenticated user.
52
+ * This token can be used to access protected resources on behalf of the user.
53
+ *
54
+ * @see https://www.rfc-editor.org/rfc/rfc6749
55
+ */
56
+ accessToken: string
57
+ /**
58
+ * Details about a specific event within the checkout process.
59
+ * This field is optional and is only used when tracking specific actions
60
+ * like `add_to_cart` or `remove_from_cart`.
61
+ *
62
+ * @see https://scayle.dev/en/core-documentation/storefront/checkout-guide/tracking
63
+ */
64
+ event?: {
65
+ /** Event name. */
66
+ event: 'login' | 'add_to_cart' | 'remove_from_cart'
67
+ /** Event status. */
68
+ status: 'successful' | 'error'
69
+ }
70
+ }
71
+ ```
72
+
73
+ - Updated the `StorefrontRuntimeConfig` type to ensure configured `shops` correctly incorporates all extended properties from `AdditionalShopConfig`.
74
+
75
+ ```ts
76
+ declare module '@scayle/storefront-nuxt' {
77
+ // Extend the shop config
78
+ export interface AdditionalShopConfig {
79
+ extendedProp: string
80
+ }
81
+ }
82
+
83
+ // `extendedProp` is now properly typed
84
+ useRuntimeConfig().storefront.shops?.[shopId]?.extendedProp
85
+ ```
86
+
87
+ **Dependencies**
88
+
89
+ **@scayle/storefront-core v8.53.3**
90
+
91
+ - No changes in this release.
92
+
3
93
  ## 8.53.2
4
94
 
5
95
  ### Patch Changes
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "8.53.2",
3
+ "version": "8.53.3",
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.53.2";
57
+ const PACKAGE_VERSION = "8.53.3";
58
58
  const logger = createConsola({
59
59
  fancy: true,
60
60
  formatOptions: {
@@ -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, type UseRpcCacheKey } from '../core/useRpc.js';
4
4
  /**
5
5
  * The shape of the data returned by the `getExternalIdpRedirect` RPC call.
6
6
  */
@@ -19,5 +19,5 @@ type UseIDPBaseReturn = Pick<Awaited<UseRpcReturn<'getExternalIdpRedirect'>>, 'd
19
19
  the current `status` and a function to manually `refresh` the RPC call.
20
20
  * It also acts as a promise that resolves to the same object.
21
21
  */
22
- export declare function useIDP(params?: MaybeRefOrGetter<RpcMethodParameters<'getExternalIdpRedirect'>>, key?: string): UseIDPBaseReturn & Promise<UseIDPBaseReturn>;
22
+ export declare function useIDP(params?: MaybeRefOrGetter<RpcMethodParameters<'getExternalIdpRedirect'>>, key?: UseRpcCacheKey): UseIDPBaseReturn & Promise<UseIDPBaseReturn>;
23
23
  export {};
@@ -24,6 +24,10 @@ export type NormalizedRpcResponse<N extends RpcMethodName> = Exclude<Awaited<Rpc
24
24
  * @template ResponseT The response type. Defaults to `NormalizedRpcResponse<N>`.
25
25
  */
26
26
  export type UseRpcOptions<N extends RpcMethodName, DataT = NormalizedRpcResponse<N>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null, ResponseT = NormalizedRpcResponse<N>> = AsyncDataOptions<ResponseT, DataT, PickKeys, DefaultT>;
27
+ /**
28
+ * Type of the key parameter for the `useRpc` composable.
29
+ */
30
+ export type UseRpcCacheKey = Parameters<typeof useAsyncData>[0];
27
31
  /**
28
32
  * Return type of the `useRpc` composable, extending `ExtendedAsyncData`.
29
33
  *
@@ -91,5 +95,5 @@ export declare const defaultCachedData: <ResponseT>(key: string, nuxtApp: NuxtAp
91
95
  * const { data: shopId, fetching } = useRpc('getShopId', 'current-shop-id')
92
96
  * ```
93
97
  */
94
- export declare function useRpc<N extends RpcMethodName, DataT = NormalizedRpcResponse<N>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null, ResponseT = NormalizedRpcResponse<N>>(method: N, key: string, params?: MaybeRefOrGetter<RpcMethodParameters<N> extends RpcContext ? undefined : RpcMethodParameters<N>>, options?: UseRpcOptions<N, DataT, PickKeys, DefaultT, ResponseT>): ExtendedAsyncData<ResponseT, unknown, DataT, PickKeys, DefaultT>;
98
+ export declare function useRpc<N extends RpcMethodName, DataT = NormalizedRpcResponse<N>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null, ResponseT = NormalizedRpcResponse<N>>(method: N, key: UseRpcCacheKey, params?: MaybeRefOrGetter<RpcMethodParameters<N> extends RpcContext ? undefined : RpcMethodParameters<N>>, options?: UseRpcOptions<N, DataT, PickKeys, DefaultT, ResponseT>): ExtendedAsyncData<ResponseT, unknown, DataT, PickKeys, DefaultT>;
95
99
  export {};
@@ -43,6 +43,7 @@ export function useRpc(method, key, params, options) {
43
43
  );
44
44
  },
45
45
  {
46
+ // TODO v9: Remove automatically watching params with next major and solely rely on passed watch options and reactive keys
46
47
  // Both refs and getter functions are valid watch sources
47
48
  ...isRef(params) || typeof params === "function" ? { watch: [params] } : {},
48
49
  getCachedData: storefront.legacy?.enableDefaultGetCachedDataOverride ? defaultCachedData : void 0,
@@ -1,12 +1,12 @@
1
1
  import type { ShopUser, UpdatePasswordParams } from '@scayle/storefront-core';
2
- import type { UseRpcReturn } from './useRpc.js';
2
+ import { type UseRpcReturn, type UseRpcCacheKey } from './useRpc.js';
3
3
  import type { ComputedRef } from 'vue';
4
4
  /**
5
5
  * Extended parameters for the `useUser` composable.
6
6
  */
7
7
  export type ExtendedUseUserParams = {
8
8
  /** The key used for caching the user data. Defaults to 'useUser'. */
9
- key?: string;
9
+ key?: UseRpcCacheKey;
10
10
  /** Whether to fetch the user data immediately. Defaults to `true`. */
11
11
  immediate?: boolean;
12
12
  /** Whether to enable lazy loading of user data. Defaults to `false`. */
@@ -24,8 +24,8 @@ export function useUser(options = {}) {
24
24
  lazy,
25
25
  server: false,
26
26
  dedupe: "defer",
27
- getCachedData: (key2) => {
28
- return toValue(nuxtApp._asyncData[key2]?.data) ?? void 0;
27
+ getCachedData: (cacheKey) => {
28
+ return toValue(nuxtApp._asyncData[cacheKey]?.data) ?? void 0;
29
29
  }
30
30
  }
31
31
  );
@@ -3,7 +3,7 @@ export * from './core/useCurrentShop.js';
3
3
  export * from './core/useFormatHelpers.js';
4
4
  export * from './core/useIDP.js';
5
5
  export * from './core/useLog.js';
6
- export { useRpc, type KeysOf, type NormalizedRpcResponse, type UseRpcOptions, type UseRpcReturn, type Status, type ExtendedAsyncData, } from './core/useRpc.js';
6
+ export { useRpc, type KeysOf, type NormalizedRpcResponse, type UseRpcOptions, type UseRpcReturn, type UseRpcCacheKey, type Status, type ExtendedAsyncData, } from './core/useRpc.js';
7
7
  export * from './core/useRpcCall.js';
8
8
  export * from './core/useSession.js';
9
9
  export * from './core/useUser.js';
@@ -1,6 +1,6 @@
1
1
  import type { AddOrUpdateItemType, RpcMethodParameters, BasketResponseData, BasketItem, Product, BasketTotalPrice, BasketItemUpdateData } from '@scayle/storefront-core';
2
2
  import { ExistingItemHandling, generateBasketKey } from '@scayle/storefront-core';
3
- import type { NormalizedRpcResponse, UseRpcReturn } from '../core/useRpc.js';
3
+ import { type NormalizedRpcResponse, type UseRpcReturn, type UseRpcCacheKey } from '../core/useRpc.js';
4
4
  import type { MaybeRefOrGetter, ComputedRef, Ref } from 'vue';
5
5
  import type { BasketKey, BasketPackageInformation } from '@scayle/storefront-api';
6
6
  /**
@@ -8,7 +8,6 @@ import type { BasketKey, BasketPackageInformation } from '@scayle/storefront-api
8
8
  */
9
9
  type UseBasketOptions = Partial<{
10
10
  params: MaybeRefOrGetter<Omit<RpcMethodParameters<'getBasket'>, 'orderCustomData'>>;
11
- key: string;
12
11
  }>;
13
12
  type UseBasketBaseReturn = Omit<Awaited<UseRpcReturn<'getBasket'>>, 'data'> & {
14
13
  data: Ref<NormalizedRpcResponse<'getBasket'>['basket'] | null>;
@@ -81,5 +80,5 @@ type UseBasketBaseReturn = Omit<Awaited<UseRpcReturn<'getBasket'>>, 'data'> & {
81
80
  *
82
81
  * @throws {Error} If an item cannot be found during removal or if an item is added with a reduced quantity. Also throws FetchError if RPC calls fail.
83
82
  */
84
- export declare function useBasket({ params, }?: UseBasketOptions, key?: string): UseBasketBaseReturn & Promise<UseBasketBaseReturn>;
83
+ export declare function useBasket({ params, }?: UseBasketOptions, key?: UseRpcCacheKey): UseBasketBaseReturn & Promise<UseBasketBaseReturn>;
85
84
  export {};
@@ -6,7 +6,9 @@ import {
6
6
  wasAddedWithReducedQuantity
7
7
  } from "@scayle/storefront-core";
8
8
  import { extendPromise } from "../../utils/promise.js";
9
- import { useRpc } from "../core/useRpc.js";
9
+ import {
10
+ useRpc
11
+ } from "../core/useRpc.js";
10
12
  import { useRpcCall } from "../core/useRpcCall.js";
11
13
  import { toValue, computed } from "vue";
12
14
  import { FetchError } from "ofetch";
@@ -36,8 +38,8 @@ export function useBasket({
36
38
  watch: [sanitizedParams],
37
39
  dedupe: "defer",
38
40
  transform: (basketResponse) => basketResponse.basket,
39
- getCachedData: (key2, nuxtApp) => {
40
- return toValue(nuxtApp._asyncData[key2]?.data) ?? void 0;
41
+ getCachedData: (cacheKey, nuxtApp) => {
42
+ return toValue(nuxtApp._asyncData[cacheKey]?.data) ?? void 0;
41
43
  }
42
44
  });
43
45
  const {
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
2
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves brand data using the `getBrandById` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useBrand<DataT = NormalizedRpcResponse<'getBrandById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getBrandById'>>;
27
27
  options: UseRpcOptions<'getBrandById', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getBrandById', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getBrandById', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useBrand({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
2
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves multiple brands data using the 'getBrands' RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useBrands<DataT = NormalizedRpcResponse<'getBrands'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getBrands'>>;
27
27
  options: UseRpcOptions<'getBrands', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getBrands', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getBrands', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useBrands({
3
5
  params,
4
6
  options
@@ -1,4 +1,4 @@
1
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
1
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
2
2
  /**
3
3
  * Retrieves the first active campaign.
4
4
  *
@@ -15,4 +15,4 @@ import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from
15
15
  */
16
16
  export declare function useCampaign<DataT = NormalizedRpcResponse<'getCampaign'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ options, }?: Partial<{
17
17
  options: UseRpcOptions<'getCampaign', DataT, PickKeys, DefaultT>;
18
- }>, key?: string): UseRpcReturn<'getCampaign', DataT, PickKeys, DefaultT>;
18
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getCampaign', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useCampaign({
3
5
  options
4
6
  } = {}, key = "useCampaign") {
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
2
- import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
2
+ import { type KeysOf, type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  type UseCategoriesBaseReturn<DataT, PickKeys extends KeysOf<DataT>, DefaultT> = Pick<Awaited<UseRpcReturn<'getCategoriesByPath', DataT, PickKeys, DefaultT>>, 'data' | 'error' | 'status' | 'refresh'> & {
5
5
  getCategoryById: (id: number, includeHidden?: true) => RpcMethodReturnType<'getCategoryById'>;
@@ -35,5 +35,5 @@ type UseCategoriesBaseReturn<DataT, PickKeys extends KeysOf<DataT>, DefaultT> =
35
35
  export declare function useCategories<DataT = NormalizedRpcResponse<'getCategoriesByPath'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
36
36
  params: MaybeRefOrGetter<RpcMethodParameters<'getCategoriesByPath'>>;
37
37
  options: UseRpcOptions<'getCategoriesByPath', DataT, PickKeys, DefaultT>;
38
- }>, key?: string): UseCategoriesBaseReturn<DataT, PickKeys, DefaultT> & Promise<UseCategoriesBaseReturn<DataT, PickKeys, DefaultT>>;
38
+ }>, key?: UseRpcCacheKey): UseCategoriesBaseReturn<DataT, PickKeys, DefaultT> & Promise<UseCategoriesBaseReturn<DataT, PickKeys, DefaultT>>;
39
39
  export {};
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  import { extendPromise } from "../../utils/promise.js";
3
5
  import { useRpcCall } from "../core/useRpcCall.js";
4
6
  export function useCategories({
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
2
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data for a single category by its ID using the `getCategoryById` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useCategoryById<DataT = NormalizedRpcResponse<'getCategoryById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getCategoryById'>>;
27
27
  options: UseRpcOptions<'getCategoryById', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getCategoryById', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getCategoryById', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useCategoryById({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
2
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data for a single category by its path using the `getCategoryByPath` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useCategoryByPath<DataT = NormalizedRpcResponse<'getCategoryByPath'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }: {
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getCategoryByPath'>>;
27
27
  options?: UseRpcOptions<'getCategoryByPath', DataT, PickKeys, DefaultT>;
28
- }, key?: string): UseRpcReturn<'getCategoryByPath', DataT, PickKeys, DefaultT>;
28
+ }, key?: UseRpcCacheKey): UseRpcReturn<'getCategoryByPath', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useCategoryByPath({
3
5
  params,
4
6
  options
@@ -1,9 +1,9 @@
1
1
  import type { MaybeRefOrGetter } from 'vue';
2
- import type { KeysOf, NormalizedRpcResponse, UseRpcOptions, UseRpcReturn } from '../core/useRpc.js';
2
+ import { type KeysOf, type NormalizedRpcResponse, type UseRpcOptions, type UseRpcReturn, type UseRpcCacheKey } 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<{
6
6
  params: MaybeRefOrGetter<RpcMethodParameters<'getCategoryTree'>>;
7
7
  options: UseRpcOptions<'getCategoryTree', DataT, PickKeys, DefaultT>;
8
- }>, key?: string): UseCategoriesBaseReturn<DataT, PickKeys, DefaultT>;
8
+ }>, key?: UseRpcCacheKey): UseCategoriesBaseReturn<DataT, PickKeys, DefaultT>;
9
9
  export {};
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useCategoryTree({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
2
+ import { type KeysOf, type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data of the current active promotion data using the `getCurrentPromotions` RPC method.
@@ -28,4 +28,4 @@ import type { MaybeRefOrGetter } from 'vue';
28
28
  export declare function useCurrentPromotions<DataT = NormalizedRpcResponse<'getCurrentPromotions'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
29
29
  params: MaybeRefOrGetter<RpcMethodParameters<'getCurrentPromotions'>>;
30
30
  options: UseRpcOptions<'getCurrentPromotions', DataT, PickKeys, DefaultT>;
31
- }>, key?: string): UseRpcReturn<'getCurrentPromotions', DataT, PickKeys, DefaultT>;
31
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getCurrentPromotions', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useCurrentPromotions({
3
5
  params,
4
6
  options
@@ -8,9 +10,9 @@ export function useCurrentPromotions({
8
10
  key,
9
11
  params,
10
12
  {
11
- getCachedData(key2, nuxtApp) {
12
- const hydrationData = nuxtApp.isHydrating ? nuxtApp.payload.data[key2] : nuxtApp.static.data[key2];
13
- return hydrationData ?? nuxtApp._asyncData[key2]?.data.value;
13
+ getCachedData(cacheKey, nuxtApp) {
14
+ const hydrationData = nuxtApp.isHydrating ? nuxtApp.payload.data[cacheKey] : nuxtApp.static.data[cacheKey];
15
+ return hydrationData ?? nuxtApp._asyncData[cacheKey]?.data.value;
14
16
  },
15
17
  ...options
16
18
  }
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
2
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves filter data using the `getFilters` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useFilters<DataT = NormalizedRpcResponse<'getFilters'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getFilters'>>;
27
27
  options: UseRpcOptions<'getFilters', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getFilters', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getFilters', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useFilters({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
2
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data of a single navigation tree using the `fetchNavigationTreeById` RPC method.
@@ -25,7 +25,7 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useNavigationTreeById<DataT = NormalizedRpcResponse<'fetchNavigationTreeById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'fetchNavigationTreeById'>>;
27
27
  options: UseRpcOptions<'fetchNavigationTreeById', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'fetchNavigationTreeById', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'fetchNavigationTreeById', DataT, PickKeys, DefaultT>;
29
29
  /**
30
30
  * Retrieves data of a single navigation tree using the `fetchNavigationTreeByName` RPC method.
31
31
  *
@@ -50,4 +50,4 @@ export declare function useNavigationTreeById<DataT = NormalizedRpcResponse<'fet
50
50
  export declare function useNavigationTreeByName<DataT = NormalizedRpcResponse<'fetchNavigationTreeById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
51
51
  params: MaybeRefOrGetter<RpcMethodParameters<'fetchNavigationTreeByName'>>;
52
52
  options: UseRpcOptions<'fetchNavigationTreeById', DataT, PickKeys, DefaultT>;
53
- }>, key?: string): UseRpcReturn<'fetchNavigationTreeByName', DataT, PickKeys, DefaultT>;
53
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'fetchNavigationTreeByName', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useNavigationTreeById({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcReturn, UseRpcOptions, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
2
+ import { type UseRpcReturn, type UseRpcOptions, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data of all navigation trees using the `fetchAllNavigationTrees` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useNavigationTrees<DataT = NormalizedRpcResponse<'fetchAllNavigationTrees'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'fetchAllNavigationTrees'>>;
27
27
  options: UseRpcOptions<'fetchAllNavigationTrees', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'fetchAllNavigationTrees', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'fetchAllNavigationTrees', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useNavigationTrees({
3
5
  params = {},
4
6
  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, ExtendedAsyncData } from '../core/useRpc.js';
3
+ import { type KeysOf, type ExtendedAsyncData, type UseRpcCacheKey } 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.
@@ -28,4 +28,4 @@ import type { MaybeRefOrGetter } from 'vue';
28
28
  export declare function useOrder<P = Record<string, unknown>, V = Record<string, unknown>, DataT = Order<P, V>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: {
29
29
  params?: MaybeRefOrGetter<RpcMethodParameters<'getOrderById'>>;
30
30
  options?: AsyncDataOptions<Order<P, V>, DataT, PickKeys, DefaultT>;
31
- }, key?: string): ExtendedAsyncData<Order<P, V>, unknown, DataT, PickKeys, DefaultT>;
31
+ }, key?: UseRpcCacheKey): ExtendedAsyncData<Order<P, V>, unknown, DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useOrder({
3
5
  params,
4
6
  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 { ExtendedAsyncData, KeysOf } from '../core/useRpc.js';
3
+ import { type ExtendedAsyncData, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
4
4
  import type { MaybeRefOrGetter } from 'vue';
5
5
  /**
6
6
  * Retrieves order data by ID using the `getOrderDataByCbd RPC method.
@@ -26,4 +26,4 @@ import type { MaybeRefOrGetter } from 'vue';
26
26
  export declare function useOrderConfirmation<P = Record<string, unknown>, V = Record<string, unknown>, DataT = Order<P, V>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: {
27
27
  params?: MaybeRefOrGetter<RpcMethodParameters<'getOrderDataByCbd'>>;
28
28
  options?: AsyncDataOptions<Order<P, V>, DataT, PickKeys, DefaultT>;
29
- }, key?: string): ExtendedAsyncData<Order<P, V>, unknown, DataT, PickKeys, DefaultT>;
29
+ }, key?: UseRpcCacheKey): ExtendedAsyncData<Order<P, V>, unknown, DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useOrderConfirmation({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
2
+ import { type KeysOf, type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data for a single product by its ID using the `getProductById` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useProduct<DataT = NormalizedRpcResponse<'getProductById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getProductById'>>;
27
27
  options: UseRpcOptions<'getProductById', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getProductById', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getProductById', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useProduct({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
2
+ import { type KeysOf, type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves product data by its category using the `getProductById` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useProducts<DataT = NormalizedRpcResponse<'getProductsByCategory'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getProductsByCategory'>>;
27
27
  options: UseRpcOptions<'getProductsByCategory', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getProductsByCategory', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getProductsByCategory', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useProducts({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
2
+ import { type KeysOf, type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data of multiple products by their ID using the `getProductsByIds` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useProductsByIds<DataT = NormalizedRpcResponse<'getProductsByIds'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getProductsByIds'>>;
27
27
  options: UseRpcOptions<'getProductsByIds', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getProductsByIds', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getProductsByIds', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useProductsByIds({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
2
+ import { type KeysOf, type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data of multiple products by their reference keys using the `getProductsByReferenceKeys` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useProductsByReferenceKeys<DataT = NormalizedRpcResponse<'getProductsByReferenceKeys'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getProductsByReferenceKeys'>>;
27
27
  options: UseRpcOptions<'getProductsByReferenceKeys', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getProductsByReferenceKeys', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getProductsByReferenceKeys', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useProductsByReferenceKeys({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
2
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves product count of a category by its ID using the `getProductsCount` RPC method.
@@ -23,4 +23,4 @@ import type { MaybeRefOrGetter } from 'vue';
23
23
  export declare function useProductsCount<DataT = NormalizedRpcResponse<'getProductsCount'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
24
24
  params: MaybeRefOrGetter<RpcMethodParameters<'getProductsCount'>>;
25
25
  options: UseRpcOptions<'getProductsCount', DataT, PickKeys, DefaultT>;
26
- }>, key?: string): UseRpcReturn<'getProductsCount', DataT, PickKeys, DefaultT>;
26
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getProductsCount', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useProductsCount({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
2
+ import { type KeysOf, type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data for all available promotion using the `getPromotions` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function usePromotions<DataT = NormalizedRpcResponse<'getPromotions'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getPromotions'>>;
27
27
  options: UseRpcOptions<'getPromotions', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getPromotions', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getPromotions', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function usePromotions({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
2
+ import { type KeysOf, type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data for multiple promotions by their IDs using the `getPromotionsByIds` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function usePromotionsByIds<DataT = NormalizedRpcResponse<'getPromotionsByIds'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getPromotionsByIds'>>;
27
27
  options: UseRpcOptions<'getPromotionsByIds', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getPromotionsByIds', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getPromotionsByIds', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function usePromotionsByIds({
3
5
  params,
4
6
  options
@@ -1,4 +1,4 @@
1
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
1
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
2
2
  /**
3
3
  * Retrieves data about the current shop by its shopID using the `getShopConfiguration` RPC method.
4
4
  *
@@ -22,4 +22,4 @@ import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from
22
22
  */
23
23
  export declare function useShopConfiguration<DataT = NormalizedRpcResponse<'getShopConfiguration'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ options, }?: Partial<{
24
24
  options: UseRpcOptions<'getShopConfiguration', DataT, PickKeys, DefaultT>;
25
- }>, key?: string): UseRpcReturn<'getShopConfiguration', DataT, PickKeys, DefaultT>;
25
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getShopConfiguration', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useShopConfiguration({
3
5
  options
4
6
  } = {}, key = "useShopConfiguration") {
@@ -1,4 +1,4 @@
1
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
1
+ import { type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type KeysOf, type UseRpcCacheKey } from '../core/useRpc.js';
2
2
  /**
3
3
  * Retrieves address data for a logged-in user using the `getCategoryById` RPC method.
4
4
  *
@@ -22,4 +22,4 @@ import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from
22
22
  */
23
23
  export declare function useUserAddresses<DataT = NormalizedRpcResponse<'getShopUserAddresses'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ options, }?: Partial<{
24
24
  options: UseRpcOptions<'getShopUserAddresses', DataT, PickKeys, DefaultT>;
25
- }>, key?: string): UseRpcReturn<'getShopUserAddresses', DataT, PickKeys, DefaultT>;
25
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getShopUserAddresses', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useUserAddresses({
3
5
  options
4
6
  } = {}, key = "useUserAddresses") {
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { KeysOf, UseRpcOptions, UseRpcReturn, NormalizedRpcResponse } from '../core/useRpc.js';
2
+ import { type KeysOf, type UseRpcOptions, type UseRpcReturn, type NormalizedRpcResponse, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from 'vue';
4
4
  /**
5
5
  * Retrieves data for a single or multiple product variant by its ID using the `getVariantById` RPC method.
@@ -25,4 +25,4 @@ import type { MaybeRefOrGetter } from 'vue';
25
25
  export declare function useVariant<DataT = NormalizedRpcResponse<'getVariantById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
26
26
  params: MaybeRefOrGetter<RpcMethodParameters<'getVariantById'>>;
27
27
  options: UseRpcOptions<'getVariantById', DataT, PickKeys, DefaultT>;
28
- }>, key?: string): UseRpcReturn<'getVariantById', DataT, PickKeys, DefaultT>;
28
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getVariantById', DataT, PickKeys, DefaultT>;
@@ -1,4 +1,6 @@
1
- import { useRpc } from "../core/useRpc.js";
1
+ import {
2
+ useRpc
3
+ } from "../core/useRpc.js";
2
4
  export function useVariant({
3
5
  params,
4
6
  options
@@ -1,5 +1,5 @@
1
1
  import type { Product, WishlistItem, RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcReturn } from '../core/useRpc.js';
2
+ import { type UseRpcReturn, type UseRpcCacheKey } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter, ComputedRef } from 'vue';
4
4
  /**
5
5
  * Representation of options for configuring the `useWishlist` composable.
@@ -68,5 +68,5 @@ type UseWishlistBaseReturn = Awaited<UseRpcReturn<'getWishlist'>> & {
68
68
  *
69
69
  * @throws {Error} If an item cannot be found during removal or replacement.
70
70
  */
71
- export declare function useWishlist({ params, }?: Options, key?: string): UseWishlistBaseReturn & Promise<UseWishlistBaseReturn>;
71
+ export declare function useWishlist({ params, }?: Options, key?: UseRpcCacheKey): UseWishlistBaseReturn & Promise<UseWishlistBaseReturn>;
72
72
  export {};
@@ -117,12 +117,16 @@ export interface PublicShopConfig extends Pick<ShopConfig, 'shopId' | 'domain' |
117
117
  /**
118
118
  * Storefront configuration.
119
119
  */
120
+ export interface StorefrontRuntimeConfig extends Omit<StorefrontRuntimeConfigType, 'shops'> {
121
+ shops: ShopConfigIndexed;
122
+ }
120
123
  export type SupportedDriverName = BuiltinDriverName | 'scayleKv';
121
124
  /**
122
125
  * Module base options. Extends `StorefrontConfig` and `ModuleOption`.
123
126
  */
124
127
  export type ModuleOptions = ModuleOptionType;
125
128
  /**
129
+ * @deprecated - will be removed in the next major version. Please switch to `CheckoutEvent` in the Storefront Application (v1.15.0).
126
130
  * Checkout event used for tracking with Google Tag Manager.
127
131
  *
128
132
  * @see https://scayle.dev/en/core-documentation/storefront/checkout-guide/implementation/webcomponent#tracking
@@ -159,7 +163,7 @@ export interface ModulePublicRuntimeConfig extends StorefrontPublicRuntimeConfig
159
163
  }
160
164
  declare module '@nuxt/schema' {
161
165
  interface RuntimeConfig {
162
- storefront: StorefrontRuntimeConfigType;
166
+ storefront: StorefrontRuntimeConfig;
163
167
  }
164
168
  interface PublicRuntimeConfig {
165
169
  storefront: ModulePublicRuntimeConfig;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "8.53.2",
4
+ "version": "8.53.3",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -90,7 +90,7 @@
90
90
  "utility-types": "^3.11.0",
91
91
  "vue-router": "^4.4.0",
92
92
  "zod": "^4.0.0",
93
- "@scayle/storefront-core": "8.53.2",
93
+ "@scayle/storefront-core": "8.53.3",
94
94
  "@scayle/unstorage-compression-driver": "1.2.4"
95
95
  },
96
96
  "devDependencies": {
@@ -103,7 +103,7 @@
103
103
  "@nuxt/schema": "3.20.0",
104
104
  "@nuxt/test-utils": "3.20.1",
105
105
  "@types/node": "22.19.1",
106
- "@vitest/coverage-v8": "4.0.13",
106
+ "@vitest/coverage-v8": "4.0.14",
107
107
  "dprint": "0.50.2",
108
108
  "eslint-formatter-gitlab": "6.0.1",
109
109
  "eslint": "9.39.1",
@@ -116,7 +116,7 @@
116
116
  "publint": "0.3.15",
117
117
  "typescript": "5.9.3",
118
118
  "unbuild": "3.6.1",
119
- "vitest": "4.0.13",
119
+ "vitest": "4.0.14",
120
120
  "vue-tsc": "3.1.5",
121
121
  "happy-dom": "20.0.10",
122
122
  "@scayle/eslint-config-storefront": "4.7.14",