@scayle/storefront-nuxt 7.84.2 → 7.84.4

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
+ ## 7.84.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Improve type definitions for exported composables
8
+
9
+ ## 7.84.3
10
+
11
+ ### Patch Changes
12
+
13
+ -
14
+ - Updated dependencies
15
+ - @scayle/storefront-core@7.64.0
16
+
3
17
  ## 7.84.2
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": "7.84.2",
3
+ "version": "7.84.4",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -66,7 +66,7 @@ export default {
66
66
  }`;
67
67
  }
68
68
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
69
- const PACKAGE_VERSION = "7.84.2";
69
+ const PACKAGE_VERSION = "7.84.4";
70
70
  const logger = createConsola({
71
71
  fancy: true,
72
72
  formatOptions: {
@@ -1,35 +1,8 @@
1
1
  import type { MaybeRefOrGetter } from 'vue';
2
- import type { RpcMethodParameters } from '@scayle/storefront-core';
3
- export declare function useIDP(params?: MaybeRefOrGetter<RpcMethodParameters<'getExternalIdpRedirect'>>, key?: string): {
4
- data: import("vue").Ref<{
5
- [k: string]: string;
6
- }, {
7
- [k: string]: string;
8
- }>;
9
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
10
- fetching: import("vue").Ref<boolean, boolean>;
11
- error: import("vue").Ref<any, any>;
12
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
13
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
14
- handleIDPLoginCallback: (params: string | {
15
- code: string;
16
- }) => Promise<{
17
- message: string;
18
- }>;
19
- } & Promise<{
20
- data: import("vue").Ref<{
21
- [k: string]: string;
22
- }, {
23
- [k: string]: string;
24
- }>;
25
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
26
- fetching: import("vue").Ref<boolean, boolean>;
27
- error: import("vue").Ref<any, any>;
28
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
29
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
30
- handleIDPLoginCallback: (params: string | {
31
- code: string;
32
- }) => Promise<{
33
- message: string;
34
- }>;
35
- }>;
2
+ import type { RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
3
+ import { type UseRpcReturn } from '../core/useRpc';
4
+ type UseIDPBaseReturn = Pick<Awaited<UseRpcReturn<'getExternalIdpRedirect'>>, 'data' | 'error' | 'status' | 'fetch' | 'fetching' | 'refresh'> & {
5
+ handleIDPLoginCallback: (params: RpcMethodParameters<'handleIDPLoginCallback'>) => RpcMethodReturnType<'handleIDPLoginCallback'>;
6
+ };
7
+ export declare function useIDP(params?: MaybeRefOrGetter<RpcMethodParameters<'getExternalIdpRedirect'>>, key?: string): UseIDPBaseReturn & Promise<UseIDPBaseReturn>;
8
+ export {};
@@ -1,4 +1,6 @@
1
1
  import type { ShopUser, UpdatePasswordParams } from '@scayle/storefront-core';
2
+ import { type UseRpcReturn } from './useRpc';
3
+ import { type ComputedRef } from '#imports';
2
4
  export type ExtendedUseUserParams = {
3
5
  key?: string;
4
6
  /** @deprecated use immediate instead */
@@ -6,26 +8,13 @@ export type ExtendedUseUserParams = {
6
8
  immediate?: boolean;
7
9
  lazy?: boolean;
8
10
  };
9
- export declare function useUser(options?: ExtendedUseUserParams): {
10
- user: import("vue").ComputedRef<ShopUser | undefined>;
11
- isLoggedIn: import("vue").ComputedRef<boolean>;
12
- customerType: import("vue").ComputedRef<"guest" | "new" | "existing">;
13
- fetching: import("vue").Ref<boolean, boolean>;
14
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
15
- forceRefresh: () => Promise<void>;
11
+ type UseUserBaseReturn = Pick<Awaited<UseRpcReturn<'getUser'>>, 'error' | 'status' | 'fetch' | 'fetching'> & {
16
12
  updateUser: (payload: Partial<ShopUser>) => Promise<void>;
17
13
  updatePassword: (payload: UpdatePasswordParams) => Promise<void>;
18
- error: import("vue").Ref<any, any>;
19
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
20
- } & Promise<{
21
- user: import("vue").ComputedRef<ShopUser | undefined>;
22
- isLoggedIn: import("vue").ComputedRef<boolean>;
23
- customerType: import("vue").ComputedRef<"guest" | "new" | "existing">;
24
- fetching: import("vue").Ref<boolean, boolean>;
25
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
14
+ user: ComputedRef<ShopUser | undefined>;
15
+ isLoggedIn: ComputedRef<boolean>;
16
+ customerType: ComputedRef<'new' | 'guest' | 'existing'>;
26
17
  forceRefresh: () => Promise<void>;
27
- updateUser: (payload: Partial<ShopUser>) => Promise<void>;
28
- updatePassword: (payload: UpdatePasswordParams) => Promise<void>;
29
- error: import("vue").Ref<any, any>;
30
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
31
- }>;
18
+ };
19
+ export declare function useUser(options?: ExtendedUseUserParams): UseUserBaseReturn & Promise<UseUserBaseReturn>;
20
+ export {};
@@ -1,125 +1,45 @@
1
- import type { AddOrUpdateItemType, RpcMethodParameters, BasketResponseData } from '@scayle/storefront-core';
1
+ import type { AddOrUpdateItemType, RpcMethodParameters, RpcMethodReturnType, BasketItem, Product, BasketTotalPrice } from '@scayle/storefront-core';
2
2
  import { ExistingItemHandling } from '@scayle/storefront-core';
3
- import { type MaybeRefOrGetter } from '#imports';
3
+ import { type UseRpcReturn } from '../core/useRpc';
4
+ import { type MaybeRefOrGetter, type ComputedRef } from '#imports';
5
+ import type { BasketKey, BasketPackageInformation } from '@scayle/storefront-api';
4
6
  type UseBasketOptions = Partial<{
5
7
  params: MaybeRefOrGetter<RpcMethodParameters<'getBasket'>>;
6
8
  key: string;
7
9
  }>;
8
- export declare function useBasket({ params, key, }?: UseBasketOptions): {
9
- data: import("vue").Ref<BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>, BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>>;
10
- items: import("vue").ComputedRef<import("@scayle/storefront-api").BasketItem<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>[]>;
11
- cost: import("vue").ComputedRef<import("@scayle/storefront-api").BasketTotalPrice>;
12
- key: import("vue").ComputedRef<import("@scayle/storefront-api").BasketKey>;
13
- packages: import("vue").ComputedRef<import("@scayle/storefront-api").BasketPackageInformation[]>;
14
- shippingDates: import("vue").ComputedRef<(string | null)[] | undefined>;
15
- isEmpty: import("vue").ComputedRef<boolean>;
16
- fetching: import("vue").Ref<boolean, boolean>;
17
- pending: import("vue").Ref<boolean, boolean>;
18
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
19
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
20
- count: import("vue").ComputedRef<number>;
21
- countWithoutSoldOutItems: import("vue").ComputedRef<number>;
22
- addItem: ({ variantId, promotionId, quantity, existingItemHandling, displayData, customData, itemGroup, }: AddOrUpdateItemType & {
10
+ type UseBasketBaseReturn = Awaited<UseRpcReturn<'getBasket'>> & {
11
+ addItem: (item: AddOrUpdateItemType & {
23
12
  existingItemHandling?: ExistingItemHandling;
24
13
  }) => Promise<void>;
25
- addItems: (items: AddOrUpdateItemType[], existingItemHandling?: 1) => Promise<void>;
26
- removeItem: (item: {
27
- variantId: number;
28
- }) => Promise<void>;
29
- removeItemByKey: (itemKey: string) => Promise<void>;
30
- clear: () => Promise<void>;
31
- contains: (item: {
14
+ addItems: (items: AddOrUpdateItemType[], existingItemHandling?: typeof ExistingItemHandling.AddQuantityToExisting) => Promise<void>;
15
+ mergeBaskets: (args: {
16
+ fromBasketKey: string;
17
+ toBasketKey: string;
18
+ }) => RpcMethodReturnType<'mergeBaskets'>;
19
+ findItem: (item: {
32
20
  variantId: number;
33
21
  } | {
34
22
  productId: number;
35
- }) => boolean;
36
- products: import("vue").ComputedRef<import("@scayle/storefront-api").Product[]>;
37
- findItem: (item: {
23
+ }) => BasketItem | undefined;
24
+ contains: (item: {
38
25
  variantId: number;
39
26
  } | {
40
27
  productId: number;
41
- }) => import("@scayle/storefront-api").BasketItem<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant> | undefined;
42
- generateBasketKey: ({ keyTemplate, hashAlgorithm, shopId, userId, log, }: {
43
- keyTemplate: string;
44
- hashAlgorithm: import("@scayle/storefront-core").HashAlgorithm;
45
- shopId: string;
46
- userId: string;
47
- log?: import("@scayle/storefront-core").Log;
48
- }) => Promise<string>;
49
- mergeBaskets: (args: {
50
- fromBasketKey: string;
51
- toBasketKey: string;
52
- }) => Promise<{
53
- type: "failure";
54
- statusCode: number;
55
- basket: BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
56
- } | {
57
- readonly type: "success";
58
- readonly basket: BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
59
- } | {
60
- readonly type: "failure";
61
- readonly basket: BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
62
- readonly errors: import("@scayle/storefront-api").AddOrUpdateItemError[];
63
- } | undefined>;
64
- error: import("vue").Ref<any, any>;
65
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
66
- } & Promise<{
67
- data: import("vue").Ref<BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>, BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>>;
68
- items: import("vue").ComputedRef<import("@scayle/storefront-api").BasketItem<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>[]>;
69
- cost: import("vue").ComputedRef<import("@scayle/storefront-api").BasketTotalPrice>;
70
- key: import("vue").ComputedRef<import("@scayle/storefront-api").BasketKey>;
71
- packages: import("vue").ComputedRef<import("@scayle/storefront-api").BasketPackageInformation[]>;
72
- shippingDates: import("vue").ComputedRef<(string | null)[] | undefined>;
73
- isEmpty: import("vue").ComputedRef<boolean>;
74
- fetching: import("vue").Ref<boolean, boolean>;
75
- pending: import("vue").Ref<boolean, boolean>;
76
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
77
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
78
- count: import("vue").ComputedRef<number>;
79
- countWithoutSoldOutItems: import("vue").ComputedRef<number>;
80
- addItem: ({ variantId, promotionId, quantity, existingItemHandling, displayData, customData, itemGroup, }: AddOrUpdateItemType & {
81
- existingItemHandling?: ExistingItemHandling;
82
- }) => Promise<void>;
83
- addItems: (items: AddOrUpdateItemType[], existingItemHandling?: 1) => Promise<void>;
28
+ }) => boolean;
84
29
  removeItem: (item: {
85
30
  variantId: number;
86
31
  }) => Promise<void>;
87
32
  removeItemByKey: (itemKey: string) => Promise<void>;
88
33
  clear: () => Promise<void>;
89
- contains: (item: {
90
- variantId: number;
91
- } | {
92
- productId: number;
93
- }) => boolean;
94
- products: import("vue").ComputedRef<import("@scayle/storefront-api").Product[]>;
95
- findItem: (item: {
96
- variantId: number;
97
- } | {
98
- productId: number;
99
- }) => import("@scayle/storefront-api").BasketItem<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant> | undefined;
100
- generateBasketKey: ({ keyTemplate, hashAlgorithm, shopId, userId, log, }: {
101
- keyTemplate: string;
102
- hashAlgorithm: import("@scayle/storefront-core").HashAlgorithm;
103
- shopId: string;
104
- userId: string;
105
- log?: import("@scayle/storefront-core").Log;
106
- }) => Promise<string>;
107
- mergeBaskets: (args: {
108
- fromBasketKey: string;
109
- toBasketKey: string;
110
- }) => Promise<{
111
- type: "failure";
112
- statusCode: number;
113
- basket: BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
114
- } | {
115
- readonly type: "success";
116
- readonly basket: BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
117
- } | {
118
- readonly type: "failure";
119
- readonly basket: BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
120
- readonly errors: import("@scayle/storefront-api").AddOrUpdateItemError[];
121
- } | undefined>;
122
- error: import("vue").Ref<any, any>;
123
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
124
- }>;
34
+ products: ComputedRef<Product[]>;
35
+ count: ComputedRef<number>;
36
+ countWithoutSoldOutItems: ComputedRef<number>;
37
+ items: ComputedRef<BasketItem[]>;
38
+ cost: ComputedRef<BasketTotalPrice>;
39
+ key: ComputedRef<BasketKey>;
40
+ isEmpty: ComputedRef<boolean>;
41
+ packages: ComputedRef<BasketPackageInformation[]>;
42
+ shippingDates: ComputedRef<(string | null)[] | undefined>;
43
+ };
44
+ export declare function useBasket({ params, key, }?: UseBasketOptions): UseBasketBaseReturn & Promise<UseBasketBaseReturn>;
125
45
  export {};
@@ -11,7 +11,10 @@ import { computed } from "vue";
11
11
  import { extendPromise } from "../../utils/promise.mjs";
12
12
  import { useRpc } from "../core/useRpc.mjs";
13
13
  import { useRpcCall } from "../core/useRpcCall.mjs";
14
- import { toValue, toRef } from "#imports";
14
+ import {
15
+ toValue,
16
+ toRef
17
+ } from "#imports";
15
18
  export function useBasket({
16
19
  params,
17
20
  key = "useBasket"
@@ -152,7 +155,7 @@ export function useBasket({
152
155
  const shippingDates = computed(
153
156
  () => packages.value ? getShippingDates(packages.value) : void 0
154
157
  );
155
- return extendPromise(asyncData.then(() => ({})), {
158
+ return extendPromise(asyncData, {
156
159
  data,
157
160
  items,
158
161
  cost,
@@ -1,5 +1,5 @@
1
- import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions } from '../core/useRpc';
1
+ import type { RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
2
+ import { type UseRpcOptions, type UseRpcReturn } from '../core/useRpc';
3
3
  import type { MaybeRefOrGetter } from '#imports';
4
4
  type Options = Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getCategoriesByPath'>>;
@@ -7,45 +7,8 @@ type Options = Partial<{
7
7
  /** @deprecated use the second argument of the composable to define the key */
8
8
  key: string;
9
9
  }>;
10
- export declare function useCategories({ params, options, key: _key, }?: Options, key?: string): {
11
- data: import("vue").Ref<{
12
- categories: import("@scayle/storefront-api").Category[];
13
- activeNode: undefined;
14
- } | {
15
- categories: import("@scayle/storefront-api").Category;
16
- activeNode: import("@scayle/storefront-api").Category;
17
- }, {
18
- categories: import("@scayle/storefront-api").Category[];
19
- activeNode: undefined;
20
- } | {
21
- categories: import("@scayle/storefront-api").Category;
22
- activeNode: import("@scayle/storefront-api").Category;
23
- }>;
24
- error: import("vue").Ref<any, any>;
25
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
26
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
27
- fetching: import("vue").Ref<boolean, boolean>;
28
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
29
- getCategoryById: (id: number, includeHidden?: true) => Promise<import("@scayle/storefront-api").Category>;
30
- } & Promise<{
31
- data: import("vue").Ref<{
32
- categories: import("@scayle/storefront-api").Category[];
33
- activeNode: undefined;
34
- } | {
35
- categories: import("@scayle/storefront-api").Category;
36
- activeNode: import("@scayle/storefront-api").Category;
37
- }, {
38
- categories: import("@scayle/storefront-api").Category[];
39
- activeNode: undefined;
40
- } | {
41
- categories: import("@scayle/storefront-api").Category;
42
- activeNode: import("@scayle/storefront-api").Category;
43
- }>;
44
- error: import("vue").Ref<any, any>;
45
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
46
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
47
- fetching: import("vue").Ref<boolean, boolean>;
48
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
49
- getCategoryById: (id: number, includeHidden?: true) => Promise<import("@scayle/storefront-api").Category>;
50
- }>;
10
+ type UseCategoriesBaseReturn = Pick<Awaited<UseRpcReturn<'getCategoriesByPath'>>, 'data' | 'error' | 'status' | 'fetch' | 'fetching' | 'refresh'> & {
11
+ getCategoryById: (id: number, includeHidden?: true) => RpcMethodReturnType<'getCategoryById'>;
12
+ };
13
+ export declare function useCategories({ params, options, key: _key, }?: Options, key?: string): UseCategoriesBaseReturn & Promise<UseCategoriesBaseReturn>;
51
14
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
2
- import type { RpcOptions } from '../core/useRpc';
2
+ import { type RpcOptions, type UseRpcReturn } from '../core/useRpc';
3
3
  import type { Ref, MaybeRefOrGetter } from 'vue';
4
4
  type Options = Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getOrderById'>>;
@@ -7,299 +7,19 @@ type Options = Partial<{
7
7
  /** @deprecated use the second argument of the composable to define the key */
8
8
  key: string;
9
9
  }>;
10
+ type ItemsType = Exclude<Order['items'], undefined>;
11
+ type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
12
+ product: P;
13
+ variant: V;
14
+ };
15
+ type UserOrderBaseReturn<P, V> = Pick<Awaited<UseRpcReturn<'getOrderById'>>, 'error' | 'status' | 'fetch' | 'fetching' | 'refresh'> & {
16
+ data: Ref<Order & {
17
+ items?: NewItemsType<P, V>[];
18
+ }>;
19
+ };
10
20
  export declare function useOrder<P = {
11
21
  [k: string]: unknown;
12
22
  }, V = {
13
23
  [k: string]: unknown;
14
- }>({ params, options, key: _key }?: Options, key?: string): {
15
- data: Ref<Order & {
16
- items?: ({
17
- id?: import("@scayle/storefront-core").UniqueNumericIdentifierOfTheItem;
18
- availableQuantity?: import("@scayle/storefront-core").AvailableQuantityInTheWarehouse;
19
- currency?: import("@scayle/storefront-core").CharacterCurrencyCode1;
20
- customData?: {
21
- [k: string]: unknown;
22
- };
23
- deliveryForecast?: import("@scayle/storefront-core").DeliveryForecastFromWarehouse;
24
- isManuallyReturnedByCci?: import("@scayle/storefront-core").TheReturnShipmentHasBeenTriggeredByCCI;
25
- itemGroup?: null | {
26
- id: string;
27
- isMainItem: boolean;
28
- isRequired: boolean;
29
- };
30
- key: import("@scayle/storefront-core").UniqueIdentifierOfTheItem;
31
- lowestPriorPrice?: null | {
32
- relativeDifferenceToPrice: number;
33
- withTax: number;
34
- };
35
- merchant?: {
36
- id: number;
37
- [k: string]: unknown;
38
- };
39
- packageId: import("@scayle/storefront-core").PackageReference;
40
- price: {
41
- appliedReductions?: {
42
- amount: {
43
- absoluteWithTax: import("@scayle/storefront-core").ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
44
- relative: number;
45
- };
46
- category: "sale" | "campaign" | "voucher";
47
- code?: string;
48
- type: "relative" | "absolute";
49
- }[];
50
- overrideWithoutTax?: number;
51
- overrideWithTax?: number;
52
- reference?: {
53
- size?: string;
54
- unit?: string;
55
- withTax?: number;
56
- };
57
- tax: {
58
- [k: string]: {
59
- amount: import("@scayle/storefront-core").AbsoluteValueOfTheAppliedTax1;
60
- rate: import("@scayle/storefront-core").RelativeValueOfTheAppliedTax;
61
- };
62
- };
63
- undiscountedWithOutTax?: import("@scayle/storefront-core").UndiscountedItemPriceExcludingTaxes;
64
- undiscountedWithTax?: import("@scayle/storefront-core").UndiscountedItemPriceIncludingTaxes;
65
- withoutTax: import("@scayle/storefront-core").ItemPriceExcludingTaxes1;
66
- withTax: import("@scayle/storefront-core").ItemPriceIncludingTaxes1;
67
- };
68
- product: {
69
- [k: string]: unknown;
70
- };
71
- reservationKey?: string;
72
- status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
73
- variant: {
74
- [k: string]: unknown;
75
- };
76
- warehouseId?: import("@scayle/storefront-core").PickingWarehouseId;
77
- warehousePackageGroupId?: import("@scayle/storefront-core").WarehousePackageReference;
78
- createdAt: import("@scayle/storefront-core").TimestampOfItemCreation;
79
- updatedAt: import("@scayle/storefront-core").TimestampOfLastItemUpdate;
80
- } & {
81
- product: P;
82
- variant: V;
83
- })[];
84
- }, Order & {
85
- items?: ({
86
- id?: import("@scayle/storefront-core").UniqueNumericIdentifierOfTheItem;
87
- availableQuantity?: import("@scayle/storefront-core").AvailableQuantityInTheWarehouse;
88
- currency?: import("@scayle/storefront-core").CharacterCurrencyCode1;
89
- customData?: {
90
- [k: string]: unknown;
91
- };
92
- deliveryForecast?: import("@scayle/storefront-core").DeliveryForecastFromWarehouse;
93
- isManuallyReturnedByCci?: import("@scayle/storefront-core").TheReturnShipmentHasBeenTriggeredByCCI;
94
- itemGroup?: null | {
95
- id: string;
96
- isMainItem: boolean;
97
- isRequired: boolean;
98
- };
99
- key: import("@scayle/storefront-core").UniqueIdentifierOfTheItem;
100
- lowestPriorPrice?: null | {
101
- relativeDifferenceToPrice: number;
102
- withTax: number;
103
- };
104
- merchant?: {
105
- id: number;
106
- [k: string]: unknown;
107
- };
108
- packageId: import("@scayle/storefront-core").PackageReference;
109
- price: {
110
- appliedReductions?: {
111
- amount: {
112
- absoluteWithTax: import("@scayle/storefront-core").ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
113
- relative: number;
114
- };
115
- category: "sale" | "campaign" | "voucher";
116
- code?: string;
117
- type: "relative" | "absolute";
118
- }[];
119
- overrideWithoutTax?: number;
120
- overrideWithTax?: number;
121
- reference?: {
122
- size?: string;
123
- unit?: string;
124
- withTax?: number;
125
- };
126
- tax: {
127
- [k: string]: {
128
- amount: import("@scayle/storefront-core").AbsoluteValueOfTheAppliedTax1;
129
- rate: import("@scayle/storefront-core").RelativeValueOfTheAppliedTax;
130
- };
131
- };
132
- undiscountedWithOutTax?: import("@scayle/storefront-core").UndiscountedItemPriceExcludingTaxes;
133
- undiscountedWithTax?: import("@scayle/storefront-core").UndiscountedItemPriceIncludingTaxes;
134
- withoutTax: import("@scayle/storefront-core").ItemPriceExcludingTaxes1;
135
- withTax: import("@scayle/storefront-core").ItemPriceIncludingTaxes1;
136
- };
137
- product: {
138
- [k: string]: unknown;
139
- };
140
- reservationKey?: string;
141
- status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
142
- variant: {
143
- [k: string]: unknown;
144
- };
145
- warehouseId?: import("@scayle/storefront-core").PickingWarehouseId;
146
- warehousePackageGroupId?: import("@scayle/storefront-core").WarehousePackageReference;
147
- createdAt: import("@scayle/storefront-core").TimestampOfItemCreation;
148
- updatedAt: import("@scayle/storefront-core").TimestampOfLastItemUpdate;
149
- } & {
150
- product: P;
151
- variant: V;
152
- })[];
153
- }>;
154
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
155
- fetching: Ref<boolean, boolean>;
156
- error: Ref<any, any>;
157
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
158
- status: Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
159
- } & Promise<{
160
- data: Ref<Order & {
161
- items?: ({
162
- id?: import("@scayle/storefront-core").UniqueNumericIdentifierOfTheItem;
163
- availableQuantity?: import("@scayle/storefront-core").AvailableQuantityInTheWarehouse;
164
- currency?: import("@scayle/storefront-core").CharacterCurrencyCode1;
165
- customData?: {
166
- [k: string]: unknown;
167
- };
168
- deliveryForecast?: import("@scayle/storefront-core").DeliveryForecastFromWarehouse;
169
- isManuallyReturnedByCci?: import("@scayle/storefront-core").TheReturnShipmentHasBeenTriggeredByCCI;
170
- itemGroup?: null | {
171
- id: string;
172
- isMainItem: boolean;
173
- isRequired: boolean;
174
- };
175
- key: import("@scayle/storefront-core").UniqueIdentifierOfTheItem;
176
- lowestPriorPrice?: null | {
177
- relativeDifferenceToPrice: number;
178
- withTax: number;
179
- };
180
- merchant?: {
181
- id: number;
182
- [k: string]: unknown;
183
- };
184
- packageId: import("@scayle/storefront-core").PackageReference;
185
- price: {
186
- appliedReductions?: {
187
- amount: {
188
- absoluteWithTax: import("@scayle/storefront-core").ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
189
- relative: number;
190
- };
191
- category: "sale" | "campaign" | "voucher";
192
- code?: string;
193
- type: "relative" | "absolute";
194
- }[];
195
- overrideWithoutTax?: number;
196
- overrideWithTax?: number;
197
- reference?: {
198
- size?: string;
199
- unit?: string;
200
- withTax?: number;
201
- };
202
- tax: {
203
- [k: string]: {
204
- amount: import("@scayle/storefront-core").AbsoluteValueOfTheAppliedTax1;
205
- rate: import("@scayle/storefront-core").RelativeValueOfTheAppliedTax;
206
- };
207
- };
208
- undiscountedWithOutTax?: import("@scayle/storefront-core").UndiscountedItemPriceExcludingTaxes;
209
- undiscountedWithTax?: import("@scayle/storefront-core").UndiscountedItemPriceIncludingTaxes;
210
- withoutTax: import("@scayle/storefront-core").ItemPriceExcludingTaxes1;
211
- withTax: import("@scayle/storefront-core").ItemPriceIncludingTaxes1;
212
- };
213
- product: {
214
- [k: string]: unknown;
215
- };
216
- reservationKey?: string;
217
- status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
218
- variant: {
219
- [k: string]: unknown;
220
- };
221
- warehouseId?: import("@scayle/storefront-core").PickingWarehouseId;
222
- warehousePackageGroupId?: import("@scayle/storefront-core").WarehousePackageReference;
223
- createdAt: import("@scayle/storefront-core").TimestampOfItemCreation;
224
- updatedAt: import("@scayle/storefront-core").TimestampOfLastItemUpdate;
225
- } & {
226
- product: P;
227
- variant: V;
228
- })[];
229
- }, Order & {
230
- items?: ({
231
- id?: import("@scayle/storefront-core").UniqueNumericIdentifierOfTheItem;
232
- availableQuantity?: import("@scayle/storefront-core").AvailableQuantityInTheWarehouse;
233
- currency?: import("@scayle/storefront-core").CharacterCurrencyCode1;
234
- customData?: {
235
- [k: string]: unknown;
236
- };
237
- deliveryForecast?: import("@scayle/storefront-core").DeliveryForecastFromWarehouse;
238
- isManuallyReturnedByCci?: import("@scayle/storefront-core").TheReturnShipmentHasBeenTriggeredByCCI;
239
- itemGroup?: null | {
240
- id: string;
241
- isMainItem: boolean;
242
- isRequired: boolean;
243
- };
244
- key: import("@scayle/storefront-core").UniqueIdentifierOfTheItem;
245
- lowestPriorPrice?: null | {
246
- relativeDifferenceToPrice: number;
247
- withTax: number;
248
- };
249
- merchant?: {
250
- id: number;
251
- [k: string]: unknown;
252
- };
253
- packageId: import("@scayle/storefront-core").PackageReference;
254
- price: {
255
- appliedReductions?: {
256
- amount: {
257
- absoluteWithTax: import("@scayle/storefront-core").ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
258
- relative: number;
259
- };
260
- category: "sale" | "campaign" | "voucher";
261
- code?: string;
262
- type: "relative" | "absolute";
263
- }[];
264
- overrideWithoutTax?: number;
265
- overrideWithTax?: number;
266
- reference?: {
267
- size?: string;
268
- unit?: string;
269
- withTax?: number;
270
- };
271
- tax: {
272
- [k: string]: {
273
- amount: import("@scayle/storefront-core").AbsoluteValueOfTheAppliedTax1;
274
- rate: import("@scayle/storefront-core").RelativeValueOfTheAppliedTax;
275
- };
276
- };
277
- undiscountedWithOutTax?: import("@scayle/storefront-core").UndiscountedItemPriceExcludingTaxes;
278
- undiscountedWithTax?: import("@scayle/storefront-core").UndiscountedItemPriceIncludingTaxes;
279
- withoutTax: import("@scayle/storefront-core").ItemPriceExcludingTaxes1;
280
- withTax: import("@scayle/storefront-core").ItemPriceIncludingTaxes1;
281
- };
282
- product: {
283
- [k: string]: unknown;
284
- };
285
- reservationKey?: string;
286
- status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
287
- variant: {
288
- [k: string]: unknown;
289
- };
290
- warehouseId?: import("@scayle/storefront-core").PickingWarehouseId;
291
- warehousePackageGroupId?: import("@scayle/storefront-core").WarehousePackageReference;
292
- createdAt: import("@scayle/storefront-core").TimestampOfItemCreation;
293
- updatedAt: import("@scayle/storefront-core").TimestampOfLastItemUpdate;
294
- } & {
295
- product: P;
296
- variant: V;
297
- })[];
298
- }>;
299
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
300
- fetching: Ref<boolean, boolean>;
301
- error: Ref<any, any>;
302
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
303
- status: Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
304
- }>;
24
+ }>({ params, options, key: _key }?: Options, key?: string): UserOrderBaseReturn<P, V> & Promise<UserOrderBaseReturn<P, V>>;
305
25
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
2
- import type { RpcOptions } from '../core/useRpc';
2
+ import type { RpcOptions, UseRpcReturn } from '../core/useRpc';
3
3
  import type { Ref, MaybeRefOrGetter } from 'vue';
4
4
  type Options = Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getOrderDataByCbd'>>;
@@ -7,299 +7,19 @@ type Options = Partial<{
7
7
  /** @deprecated use the second argument of the composable to define the key */
8
8
  key: string;
9
9
  }>;
10
+ type ItemsType = Exclude<Order['items'], undefined>;
11
+ type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
12
+ product: P;
13
+ variant: V;
14
+ };
15
+ type UseOrderConfirmationBaseReturn<P, V> = Pick<Awaited<UseRpcReturn<'getOrderDataByCbd'>>, 'error' | 'status' | 'fetch' | 'fetching' | 'refresh'> & {
16
+ data: Ref<Order & {
17
+ items?: NewItemsType<P, V>[];
18
+ }>;
19
+ };
10
20
  export declare function useOrderConfirmation<P = {
11
21
  [k: string]: unknown;
12
22
  }, V = {
13
23
  [k: string]: unknown;
14
- }>({ params, options, key: _key }?: Options, key?: string): {
15
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
16
- fetching: Ref<boolean, boolean>;
17
- error: Ref<any, any>;
18
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
19
- status: Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
20
- data: Ref<Order & {
21
- items?: ({
22
- id?: import("@scayle/storefront-core").UniqueNumericIdentifierOfTheItem;
23
- availableQuantity?: import("@scayle/storefront-core").AvailableQuantityInTheWarehouse;
24
- currency?: import("@scayle/storefront-core").CharacterCurrencyCode1;
25
- customData?: {
26
- [k: string]: unknown;
27
- };
28
- deliveryForecast?: import("@scayle/storefront-core").DeliveryForecastFromWarehouse;
29
- isManuallyReturnedByCci?: import("@scayle/storefront-core").TheReturnShipmentHasBeenTriggeredByCCI;
30
- itemGroup?: null | {
31
- id: string;
32
- isMainItem: boolean;
33
- isRequired: boolean;
34
- };
35
- key: import("@scayle/storefront-core").UniqueIdentifierOfTheItem;
36
- lowestPriorPrice?: null | {
37
- relativeDifferenceToPrice: number;
38
- withTax: number;
39
- };
40
- merchant?: {
41
- id: number;
42
- [k: string]: unknown;
43
- };
44
- packageId: import("@scayle/storefront-core").PackageReference;
45
- price: {
46
- appliedReductions?: {
47
- amount: {
48
- absoluteWithTax: import("@scayle/storefront-core").ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
49
- relative: number;
50
- };
51
- category: "sale" | "campaign" | "voucher";
52
- code?: string;
53
- type: "relative" | "absolute";
54
- }[];
55
- overrideWithoutTax?: number;
56
- overrideWithTax?: number;
57
- reference?: {
58
- size?: string;
59
- unit?: string;
60
- withTax?: number;
61
- };
62
- tax: {
63
- [k: string]: {
64
- amount: import("@scayle/storefront-core").AbsoluteValueOfTheAppliedTax1;
65
- rate: import("@scayle/storefront-core").RelativeValueOfTheAppliedTax;
66
- };
67
- };
68
- undiscountedWithOutTax?: import("@scayle/storefront-core").UndiscountedItemPriceExcludingTaxes;
69
- undiscountedWithTax?: import("@scayle/storefront-core").UndiscountedItemPriceIncludingTaxes;
70
- withoutTax: import("@scayle/storefront-core").ItemPriceExcludingTaxes1;
71
- withTax: import("@scayle/storefront-core").ItemPriceIncludingTaxes1;
72
- };
73
- product: {
74
- [k: string]: unknown;
75
- };
76
- reservationKey?: string;
77
- status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
78
- variant: {
79
- [k: string]: unknown;
80
- };
81
- warehouseId?: import("@scayle/storefront-core").PickingWarehouseId;
82
- warehousePackageGroupId?: import("@scayle/storefront-core").WarehousePackageReference;
83
- createdAt: import("@scayle/storefront-core").TimestampOfItemCreation;
84
- updatedAt: import("@scayle/storefront-core").TimestampOfLastItemUpdate;
85
- } & {
86
- product: P;
87
- variant: V;
88
- })[];
89
- }, Order & {
90
- items?: ({
91
- id?: import("@scayle/storefront-core").UniqueNumericIdentifierOfTheItem;
92
- availableQuantity?: import("@scayle/storefront-core").AvailableQuantityInTheWarehouse;
93
- currency?: import("@scayle/storefront-core").CharacterCurrencyCode1;
94
- customData?: {
95
- [k: string]: unknown;
96
- };
97
- deliveryForecast?: import("@scayle/storefront-core").DeliveryForecastFromWarehouse;
98
- isManuallyReturnedByCci?: import("@scayle/storefront-core").TheReturnShipmentHasBeenTriggeredByCCI;
99
- itemGroup?: null | {
100
- id: string;
101
- isMainItem: boolean;
102
- isRequired: boolean;
103
- };
104
- key: import("@scayle/storefront-core").UniqueIdentifierOfTheItem;
105
- lowestPriorPrice?: null | {
106
- relativeDifferenceToPrice: number;
107
- withTax: number;
108
- };
109
- merchant?: {
110
- id: number;
111
- [k: string]: unknown;
112
- };
113
- packageId: import("@scayle/storefront-core").PackageReference;
114
- price: {
115
- appliedReductions?: {
116
- amount: {
117
- absoluteWithTax: import("@scayle/storefront-core").ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
118
- relative: number;
119
- };
120
- category: "sale" | "campaign" | "voucher";
121
- code?: string;
122
- type: "relative" | "absolute";
123
- }[];
124
- overrideWithoutTax?: number;
125
- overrideWithTax?: number;
126
- reference?: {
127
- size?: string;
128
- unit?: string;
129
- withTax?: number;
130
- };
131
- tax: {
132
- [k: string]: {
133
- amount: import("@scayle/storefront-core").AbsoluteValueOfTheAppliedTax1;
134
- rate: import("@scayle/storefront-core").RelativeValueOfTheAppliedTax;
135
- };
136
- };
137
- undiscountedWithOutTax?: import("@scayle/storefront-core").UndiscountedItemPriceExcludingTaxes;
138
- undiscountedWithTax?: import("@scayle/storefront-core").UndiscountedItemPriceIncludingTaxes;
139
- withoutTax: import("@scayle/storefront-core").ItemPriceExcludingTaxes1;
140
- withTax: import("@scayle/storefront-core").ItemPriceIncludingTaxes1;
141
- };
142
- product: {
143
- [k: string]: unknown;
144
- };
145
- reservationKey?: string;
146
- status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
147
- variant: {
148
- [k: string]: unknown;
149
- };
150
- warehouseId?: import("@scayle/storefront-core").PickingWarehouseId;
151
- warehousePackageGroupId?: import("@scayle/storefront-core").WarehousePackageReference;
152
- createdAt: import("@scayle/storefront-core").TimestampOfItemCreation;
153
- updatedAt: import("@scayle/storefront-core").TimestampOfLastItemUpdate;
154
- } & {
155
- product: P;
156
- variant: V;
157
- })[];
158
- }>;
159
- } & Promise<{
160
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
161
- fetching: Ref<boolean, boolean>;
162
- error: Ref<any, any>;
163
- refresh: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
164
- status: Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
165
- data: Ref<Order & {
166
- items?: ({
167
- id?: import("@scayle/storefront-core").UniqueNumericIdentifierOfTheItem;
168
- availableQuantity?: import("@scayle/storefront-core").AvailableQuantityInTheWarehouse;
169
- currency?: import("@scayle/storefront-core").CharacterCurrencyCode1;
170
- customData?: {
171
- [k: string]: unknown;
172
- };
173
- deliveryForecast?: import("@scayle/storefront-core").DeliveryForecastFromWarehouse;
174
- isManuallyReturnedByCci?: import("@scayle/storefront-core").TheReturnShipmentHasBeenTriggeredByCCI;
175
- itemGroup?: null | {
176
- id: string;
177
- isMainItem: boolean;
178
- isRequired: boolean;
179
- };
180
- key: import("@scayle/storefront-core").UniqueIdentifierOfTheItem;
181
- lowestPriorPrice?: null | {
182
- relativeDifferenceToPrice: number;
183
- withTax: number;
184
- };
185
- merchant?: {
186
- id: number;
187
- [k: string]: unknown;
188
- };
189
- packageId: import("@scayle/storefront-core").PackageReference;
190
- price: {
191
- appliedReductions?: {
192
- amount: {
193
- absoluteWithTax: import("@scayle/storefront-core").ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
194
- relative: number;
195
- };
196
- category: "sale" | "campaign" | "voucher";
197
- code?: string;
198
- type: "relative" | "absolute";
199
- }[];
200
- overrideWithoutTax?: number;
201
- overrideWithTax?: number;
202
- reference?: {
203
- size?: string;
204
- unit?: string;
205
- withTax?: number;
206
- };
207
- tax: {
208
- [k: string]: {
209
- amount: import("@scayle/storefront-core").AbsoluteValueOfTheAppliedTax1;
210
- rate: import("@scayle/storefront-core").RelativeValueOfTheAppliedTax;
211
- };
212
- };
213
- undiscountedWithOutTax?: import("@scayle/storefront-core").UndiscountedItemPriceExcludingTaxes;
214
- undiscountedWithTax?: import("@scayle/storefront-core").UndiscountedItemPriceIncludingTaxes;
215
- withoutTax: import("@scayle/storefront-core").ItemPriceExcludingTaxes1;
216
- withTax: import("@scayle/storefront-core").ItemPriceIncludingTaxes1;
217
- };
218
- product: {
219
- [k: string]: unknown;
220
- };
221
- reservationKey?: string;
222
- status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
223
- variant: {
224
- [k: string]: unknown;
225
- };
226
- warehouseId?: import("@scayle/storefront-core").PickingWarehouseId;
227
- warehousePackageGroupId?: import("@scayle/storefront-core").WarehousePackageReference;
228
- createdAt: import("@scayle/storefront-core").TimestampOfItemCreation;
229
- updatedAt: import("@scayle/storefront-core").TimestampOfLastItemUpdate;
230
- } & {
231
- product: P;
232
- variant: V;
233
- })[];
234
- }, Order & {
235
- items?: ({
236
- id?: import("@scayle/storefront-core").UniqueNumericIdentifierOfTheItem;
237
- availableQuantity?: import("@scayle/storefront-core").AvailableQuantityInTheWarehouse;
238
- currency?: import("@scayle/storefront-core").CharacterCurrencyCode1;
239
- customData?: {
240
- [k: string]: unknown;
241
- };
242
- deliveryForecast?: import("@scayle/storefront-core").DeliveryForecastFromWarehouse;
243
- isManuallyReturnedByCci?: import("@scayle/storefront-core").TheReturnShipmentHasBeenTriggeredByCCI;
244
- itemGroup?: null | {
245
- id: string;
246
- isMainItem: boolean;
247
- isRequired: boolean;
248
- };
249
- key: import("@scayle/storefront-core").UniqueIdentifierOfTheItem;
250
- lowestPriorPrice?: null | {
251
- relativeDifferenceToPrice: number;
252
- withTax: number;
253
- };
254
- merchant?: {
255
- id: number;
256
- [k: string]: unknown;
257
- };
258
- packageId: import("@scayle/storefront-core").PackageReference;
259
- price: {
260
- appliedReductions?: {
261
- amount: {
262
- absoluteWithTax: import("@scayle/storefront-core").ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
263
- relative: number;
264
- };
265
- category: "sale" | "campaign" | "voucher";
266
- code?: string;
267
- type: "relative" | "absolute";
268
- }[];
269
- overrideWithoutTax?: number;
270
- overrideWithTax?: number;
271
- reference?: {
272
- size?: string;
273
- unit?: string;
274
- withTax?: number;
275
- };
276
- tax: {
277
- [k: string]: {
278
- amount: import("@scayle/storefront-core").AbsoluteValueOfTheAppliedTax1;
279
- rate: import("@scayle/storefront-core").RelativeValueOfTheAppliedTax;
280
- };
281
- };
282
- undiscountedWithOutTax?: import("@scayle/storefront-core").UndiscountedItemPriceExcludingTaxes;
283
- undiscountedWithTax?: import("@scayle/storefront-core").UndiscountedItemPriceIncludingTaxes;
284
- withoutTax: import("@scayle/storefront-core").ItemPriceExcludingTaxes1;
285
- withTax: import("@scayle/storefront-core").ItemPriceIncludingTaxes1;
286
- };
287
- product: {
288
- [k: string]: unknown;
289
- };
290
- reservationKey?: string;
291
- status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
292
- variant: {
293
- [k: string]: unknown;
294
- };
295
- warehouseId?: import("@scayle/storefront-core").PickingWarehouseId;
296
- warehousePackageGroupId?: import("@scayle/storefront-core").WarehousePackageReference;
297
- createdAt: import("@scayle/storefront-core").TimestampOfItemCreation;
298
- updatedAt: import("@scayle/storefront-core").TimestampOfLastItemUpdate;
299
- } & {
300
- product: P;
301
- variant: V;
302
- })[];
303
- }>;
304
- }>;
24
+ }>({ params, options, key: _key }?: Options, key?: string): UseOrderConfirmationBaseReturn<P, V> & Promise<UseOrderConfirmationBaseReturn<P, V>>;
305
25
  export {};
@@ -1,14 +1,11 @@
1
- import type { Product, WishlistItem, RpcMethodParameters, WishlistResponseData } from '@scayle/storefront-core';
2
- import type { MaybeRefOrGetter } from '#imports';
1
+ import type { Product, WishlistItem, RpcMethodParameters } from '@scayle/storefront-core';
2
+ import { type UseRpcReturn } from '../core/useRpc';
3
+ import type { MaybeRefOrGetter, ComputedRef } from '#imports';
3
4
  type Options = Partial<{
4
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getWishlist'>>;
5
6
  key: string;
6
7
  }>;
7
- export declare function useWishlist({ params, key, }?: Options): {
8
- data: import("vue").Ref<WishlistResponseData, WishlistResponseData>;
9
- count: import("vue").ComputedRef<number>;
10
- items: import("vue").ComputedRef<WishlistItem[]>;
11
- products: import("vue").ComputedRef<Product[]>;
8
+ type UseWishlistBaseReturn = Awaited<UseRpcReturn<'getWishlist'>> & {
12
9
  addItem: (item: {
13
10
  variantId?: number;
14
11
  productId?: number;
@@ -25,60 +22,23 @@ export declare function useWishlist({ params, key, }?: Options): {
25
22
  productId?: number;
26
23
  }) => Promise<void>;
27
24
  clear: () => Promise<void>;
28
- fetching: import("vue").Ref<boolean, boolean>;
29
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
30
- toggleItem: (item: {
31
- variantId?: number;
32
- productId?: number;
33
- }) => Promise<void>;
34
25
  findItem: (item: {
35
- variantId?: number;
36
- productId?: number;
26
+ variantId: number;
27
+ } | {
28
+ productId: number;
37
29
  }) => WishlistItem | undefined;
38
30
  contains: (item: {
39
31
  variantId: number;
40
32
  } | {
41
33
  productId: number;
42
34
  }) => boolean;
43
- error: import("vue").Ref<any, any>;
44
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
45
- } & Promise<{
46
- data: import("vue").Ref<WishlistResponseData, WishlistResponseData>;
47
- count: import("vue").ComputedRef<number>;
48
- items: import("vue").ComputedRef<WishlistItem[]>;
49
- products: import("vue").ComputedRef<Product[]>;
50
- addItem: (item: {
51
- variantId?: number;
52
- productId?: number;
53
- }) => Promise<void>;
54
- removeItem: (item: {
55
- variantId?: number;
56
- productId?: number;
57
- }) => Promise<void>;
58
- replaceItem: (item: {
59
- variantId?: number;
60
- productId?: number;
61
- }, newItem: {
62
- variantId?: number;
63
- productId?: number;
64
- }) => Promise<void>;
65
- clear: () => Promise<void>;
66
- fetching: import("vue").Ref<boolean, boolean>;
67
- fetch: (opts?: import("nuxt/dist/app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
68
35
  toggleItem: (item: {
69
36
  variantId?: number;
70
37
  productId?: number;
71
38
  }) => Promise<void>;
72
- findItem: (item: {
73
- variantId?: number;
74
- productId?: number;
75
- }) => WishlistItem | undefined;
76
- contains: (item: {
77
- variantId: number;
78
- } | {
79
- productId: number;
80
- }) => boolean;
81
- error: import("vue").Ref<any, any>;
82
- status: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
83
- }>;
39
+ count: ComputedRef<number>;
40
+ items: ComputedRef<WishlistItem[]>;
41
+ products: ComputedRef<Product[]>;
42
+ };
43
+ export declare function useWishlist({ params, key, }?: Options): UseWishlistBaseReturn & Promise<UseWishlistBaseReturn>;
84
44
  export {};
@@ -99,7 +99,7 @@ export function useWishlist({
99
99
  const products = computed(() => {
100
100
  return items.value?.map((item) => item.product) || [];
101
101
  });
102
- return extendPromise(asyncData.then(() => ({})), {
102
+ return extendPromise(asyncData, {
103
103
  data,
104
104
  count,
105
105
  items,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.84.2",
4
+ "version": "7.84.4",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -60,7 +60,7 @@
60
60
  "@nuxt/kit": "^3.12.2",
61
61
  "@opentelemetry/api": "^1.9.0",
62
62
  "@scayle/h3-session": "^0.4.0",
63
- "@scayle/storefront-core": "^7.63.1",
63
+ "@scayle/storefront-core": "7.64.0",
64
64
  "@scayle/unstorage-compression-driver": "^0.1.3",
65
65
  "@vueuse/core": "^10.11.0",
66
66
  "consola": "^3.2.3",
@@ -86,9 +86,9 @@
86
86
  "@nuxt/test-utils": "3.14.0",
87
87
  "@scayle/eslint-config-storefront": "4.3.0",
88
88
  "@scayle/eslint-plugin-vue-composable": "0.2.0",
89
- "@types/node": "20.14.14",
89
+ "@types/node": "20.14.15",
90
90
  "dprint": "0.47.2",
91
- "eslint": "9.8.0",
91
+ "eslint": "9.9.0",
92
92
  "eslint-formatter-gitlab": "5.1.0",
93
93
  "fishery": "2.2.2",
94
94
  "h3": "1.12.0",