@scayle/storefront-nuxt 7.61.2 → 7.61.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.61.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix types of useBasket and useWishlist
8
+
3
9
  ## 7.61.2
4
10
 
5
11
  ### Patch Changes
@@ -13,7 +19,7 @@
13
19
 
14
20
  ### Patch Changes
15
21
 
16
- - `useBasket` and `useWishlist` should no longer trigger duplicate requests when used in multiple components
22
+ - `useBasket` and `useWishlist` should no longer trigger duplicate requests when used in multiple components. Note: As part of this change, the `options` parameter has been removed from both functions.
17
23
 
18
24
  ## 7.61.0
19
25
 
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.9.0"
6
6
  },
7
- "version": "7.61.1"
7
+ "version": "7.61.2"
8
8
  }
@@ -1,4 +1,4 @@
1
- import type { AddOrUpdateItemType, RpcMethodParameters } from '@scayle/storefront-core';
1
+ import type { AddOrUpdateItemType, RpcMethodParameters, BasketResponseData } from '@scayle/storefront-core';
2
2
  import { ExistingItemHandling } from '@scayle/storefront-core';
3
3
  import { type MaybeRefOrGetter } from '#imports';
4
4
  type UseBasketOptions = Partial<{
@@ -6,17 +6,17 @@ type UseBasketOptions = Partial<{
6
6
  key: string;
7
7
  }>;
8
8
  export declare function useBasket({ params, key, }?: UseBasketOptions): Promise<{
9
- data: any;
10
- items: import("vue").ComputedRef<any>;
11
- cost: import("vue").ComputedRef<any>;
12
- key: import("vue").ComputedRef<any>;
13
- packages: import("vue").ComputedRef<any>;
9
+ data: import("vue").Ref<BasketResponseData<import("@scayle/storefront-core").Product, import("@scayle/storefront-core").Variant> | null>;
10
+ items: import("vue").ComputedRef<import("@scayle/storefront-core").BasketItem<import("@scayle/storefront-core").Product, import("@scayle/storefront-core").Variant>[] | undefined>;
11
+ cost: import("vue").ComputedRef<import("@scayle/storefront-core").BasketTotalPrice | undefined>;
12
+ key: import("vue").ComputedRef<import("@aboutyou/backbone").BasketKey | undefined>;
13
+ packages: import("vue").ComputedRef<import("@aboutyou/backbone").BasketPackageInformation[] | undefined>;
14
14
  shippingDates: import("vue").ComputedRef<(string | null)[] | undefined>;
15
15
  isEmpty: import("vue").ComputedRef<boolean>;
16
- fetching: any;
17
- fetch: any;
18
- count: import("vue").ComputedRef<any>;
19
- countWithoutSoldOutItems: import("vue").ComputedRef<any>;
16
+ fetching: import("vue").Ref<boolean>;
17
+ fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions | undefined) => Promise<void>;
18
+ count: import("vue").ComputedRef<number | undefined>;
19
+ countWithoutSoldOutItems: import("vue").ComputedRef<number | undefined>;
20
20
  addItem: ({ variantId, promotionId, quantity, existingItemHandling, displayData, customData, itemGroup, }: AddOrUpdateItemType & {
21
21
  existingItemHandling?: 0 | 1 | 2 | 3 | undefined;
22
22
  }) => Promise<void>;
@@ -30,12 +30,12 @@ export declare function useBasket({ params, key, }?: UseBasketOptions): Promise<
30
30
  } | {
31
31
  productId: number;
32
32
  }) => boolean;
33
- products: import("vue").ComputedRef<any>;
33
+ products: import("vue").ComputedRef<import("@scayle/storefront-core").Product[]>;
34
34
  findItem: (item: {
35
35
  variantId: number;
36
36
  } | {
37
37
  productId: number;
38
- }) => any;
38
+ }) => import("@scayle/storefront-core").BasketItem<import("@scayle/storefront-core").Product, import("@scayle/storefront-core").Variant> | undefined;
39
39
  generateBasketKey: ({ keyTemplate, hashAlgorithm, shopId, userId, log, }: {
40
40
  keyTemplate: string;
41
41
  hashAlgorithm: import("@scayle/storefront-core").HashAlgorithm;
@@ -47,7 +47,7 @@ export declare function useBasket({ params, key, }?: UseBasketOptions): Promise<
47
47
  fromBasketKey: string;
48
48
  toBasketKey: string;
49
49
  }) => Promise<any>;
50
- error: any;
51
- status: any;
50
+ error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
51
+ status: import("vue").Ref<import("nuxt/dist/app/composables/asyncData").AsyncDataRequestStatus>;
52
52
  }>;
53
53
  export {};
@@ -6,12 +6,12 @@ import {
6
6
  HttpStatusCode,
7
7
  HttpStatusMessage
8
8
  } from "@scayle/storefront-core";
9
- import { useNuxtApp } from "nuxt/app";
9
+ import { useNuxtApp, useAsyncData } from "nuxt/app";
10
10
  import { computed } from "vue";
11
11
  import { useEventListener } from "@vueuse/core";
12
12
  import { rpcCall } from "../../rpc/rpcCall.mjs";
13
13
  import { useCurrentShop } from "../core/useCurrentShop.mjs";
14
- import { toValue, toRef, useAsyncData } from "#imports";
14
+ import { toValue, toRef } from "#imports";
15
15
  const onCheckoutUpdate = async (event, fetching, fetchCallback) => {
16
16
  if (fetching) {
17
17
  return;
@@ -1,14 +1,14 @@
1
- import type { RpcMethodParameters } from '@scayle/storefront-core';
1
+ import type { Product, WishlistItem, RpcMethodParameters, WishlistResponseData } from '@scayle/storefront-core';
2
2
  import type { MaybeRefOrGetter } from '#imports';
3
3
  type Options = Partial<{
4
4
  params: MaybeRefOrGetter<RpcMethodParameters<'getWishlist'>>;
5
5
  key: string;
6
6
  }>;
7
7
  export declare function useWishlist({ params, key, }?: Options): Promise<{
8
- data: any;
9
- count: import("vue").ComputedRef<any>;
10
- items: import("vue").ComputedRef<any>;
11
- products: import("vue").ComputedRef<any>;
8
+ data: import("vue").Ref<WishlistResponseData | null>;
9
+ count: import("vue").ComputedRef<number | undefined>;
10
+ items: import("vue").ComputedRef<WishlistItem[] | undefined>;
11
+ products: import("vue").ComputedRef<Product[]>;
12
12
  addItem: (item: {
13
13
  variantId?: number;
14
14
  productId?: number;
@@ -25,8 +25,8 @@ export declare function useWishlist({ params, key, }?: Options): Promise<{
25
25
  productId?: number;
26
26
  }) => Promise<void>;
27
27
  clear: () => Promise<void>;
28
- fetching: any;
29
- fetch: any;
28
+ fetching: import("vue").Ref<boolean>;
29
+ fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions | undefined) => Promise<void>;
30
30
  toggleItem: (item: {
31
31
  variantId?: number;
32
32
  productId?: number;
@@ -34,13 +34,13 @@ export declare function useWishlist({ params, key, }?: Options): Promise<{
34
34
  findItem: (item: {
35
35
  variantId?: number;
36
36
  productId?: number;
37
- }) => any;
37
+ }) => WishlistItem | undefined;
38
38
  contains: (item: {
39
39
  variantId: number;
40
40
  } | {
41
41
  productId: number;
42
42
  }) => boolean;
43
- error: any;
44
- status: any;
43
+ error: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null>;
44
+ status: import("vue").Ref<import("nuxt/dist/app/composables/asyncData").AsyncDataRequestStatus>;
45
45
  }>;
46
46
  export {};
@@ -3,11 +3,11 @@ import {
3
3
  HttpStatusMessage,
4
4
  HttpStatusCode
5
5
  } from "@scayle/storefront-core";
6
- import { useNuxtApp } from "nuxt/app";
6
+ import { useNuxtApp, useAsyncData } from "nuxt/app";
7
7
  import { computed } from "vue";
8
8
  import { rpcCall } from "../../rpc/rpcCall.mjs";
9
9
  import { useCurrentShop } from "../core/useCurrentShop.mjs";
10
- import { toValue, toRef, useAsyncData } from "#imports";
10
+ import { toValue, toRef } from "#imports";
11
11
  export async function useWishlist({
12
12
  params,
13
13
  key = "useWishlist"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.61.2",
4
+ "version": "7.61.3",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -72,7 +72,7 @@
72
72
  "knitwork": "1.0.0",
73
73
  "nitropack": "2.9.1",
74
74
  "ofetch": "1.3.3",
75
- "radash": "12.0.0",
75
+ "radash": "12.1.0",
76
76
  "uncrypto": "0.1.3",
77
77
  "unstorage": "1.10.1",
78
78
  "vue-router": "4.3.0",