@scayle/storefront-nuxt 7.84.3 → 7.84.5
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 +13 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/module.d.mts +2 -2
- package/dist/module.d.ts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/rpc.d.mts +1 -1
- package/dist/rpc.d.ts +1 -1
- package/dist/runtime/composables/core/useIDP.d.ts +7 -34
- package/dist/runtime/composables/core/useUser.d.ts +9 -20
- package/dist/runtime/composables/storefront/useBasket.d.ts +26 -106
- package/dist/runtime/composables/storefront/useBasket.mjs +5 -2
- package/dist/runtime/composables/storefront/useCategories.d.ts +6 -43
- package/dist/runtime/composables/storefront/useOrder.d.ts +12 -292
- package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +12 -292
- package/dist/runtime/composables/storefront/useQueryFilterState.mjs +4 -1
- package/dist/runtime/composables/storefront/useWishlist.d.ts +12 -52
- package/dist/runtime/composables/storefront/useWishlist.mjs +1 -1
- package/dist/runtime/createLog.mjs +1 -18
- package/dist/runtime/log.d.ts +6 -6
- package/dist/runtime/log.mjs +9 -5
- package/dist/shared/{storefront-nuxt.d852fe87.d.mts → storefront-nuxt.891170da.d.mts} +2 -2
- package/dist/shared/{storefront-nuxt.d852fe87.d.ts → storefront-nuxt.891170da.d.ts} +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 7.84.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @scayle/storefront-core@7.64.1
|
|
9
|
+
|
|
10
|
+
## 7.84.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Improve type definitions for exported composables
|
|
15
|
+
|
|
3
16
|
## 7.84.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.
|
|
1
|
+
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.891170da.mjs';
|
|
2
2
|
export { rpcCall } from './rpc.mjs';
|
|
3
3
|
export * from '@scayle/storefront-core';
|
|
4
4
|
export { LogLevel } from '@scayle/storefront-core';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.
|
|
1
|
+
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.891170da.js';
|
|
2
2
|
export { rpcCall } from './rpc.js';
|
|
3
3
|
export * from '@scayle/storefront-core';
|
|
4
4
|
export { LogLevel } from '@scayle/storefront-core';
|
package/dist/module.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { M as ModuleBaseOptions } from './shared/storefront-nuxt.
|
|
3
|
-
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.
|
|
2
|
+
import { M as ModuleBaseOptions } from './shared/storefront-nuxt.891170da.mjs';
|
|
3
|
+
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.891170da.mjs';
|
|
4
4
|
export { LogLevel } from '@scayle/storefront-core';
|
|
5
5
|
import '@scayle/unstorage-compression-driver';
|
|
6
6
|
import 'unstorage';
|
package/dist/module.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { M as ModuleBaseOptions } from './shared/storefront-nuxt.
|
|
3
|
-
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.
|
|
2
|
+
import { M as ModuleBaseOptions } from './shared/storefront-nuxt.891170da.js';
|
|
3
|
+
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.891170da.js';
|
|
4
4
|
export { LogLevel } from '@scayle/storefront-core';
|
|
5
5
|
import '@scayle/unstorage-compression-driver';
|
|
6
6
|
import 'unstorage';
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
package/dist/rpc.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RpcMethodName, RpcMethodParameters, RpcMethodReturnType, RpcContext } from '@scayle/storefront-core';
|
|
2
2
|
import { NuxtApp } from 'nuxt/app';
|
|
3
|
-
import { P as PublicShopConfig } from './shared/storefront-nuxt.
|
|
3
|
+
import { P as PublicShopConfig } from './shared/storefront-nuxt.891170da.mjs';
|
|
4
4
|
import '@scayle/unstorage-compression-driver';
|
|
5
5
|
import 'unstorage';
|
|
6
6
|
import 'zod';
|
package/dist/rpc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RpcMethodName, RpcMethodParameters, RpcMethodReturnType, RpcContext } from '@scayle/storefront-core';
|
|
2
2
|
import { NuxtApp } from 'nuxt/app';
|
|
3
|
-
import { P as PublicShopConfig } from './shared/storefront-nuxt.
|
|
3
|
+
import { P as PublicShopConfig } from './shared/storefront-nuxt.891170da.js';
|
|
4
4
|
import '@scayle/unstorage-compression-driver';
|
|
5
5
|
import 'unstorage';
|
|
6
6
|
import 'zod';
|
|
@@ -1,35 +1,8 @@
|
|
|
1
1
|
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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,
|
|
1
|
+
import type { AddOrUpdateItemType, RpcMethodParameters, RpcMethodReturnType, BasketItem, Product, BasketTotalPrice } from '@scayle/storefront-core';
|
|
2
2
|
import { ExistingItemHandling } from '@scayle/storefront-core';
|
|
3
|
-
import { type
|
|
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
|
-
|
|
9
|
-
|
|
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?:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
}) =>
|
|
36
|
-
|
|
37
|
-
findItem: (item: {
|
|
23
|
+
}) => BasketItem | undefined;
|
|
24
|
+
contains: (item: {
|
|
38
25
|
variantId: number;
|
|
39
26
|
} | {
|
|
40
27
|
productId: number;
|
|
41
|
-
}) =>
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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 {
|
|
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
|
|
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
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 {};
|